maxminddb 1.4.1 copy "maxminddb: ^1.4.1" to clipboard
maxminddb: ^1.4.1 copied to clipboard

A library for querying MaxMind databases (like GeoLite2-City.mmdb).

CI

dart-maxmindDB #

This dart library is capable of searching ip addresses in MAXMINDs mmdb databases.

As its main use case, this library can be used to get the geo location of an IP address by using the GeoLite2 Database.

Usage in command line: #

  • dart pub global activate maxminddb
  • maxminddb search 1.2.3.4
  • Usage documentation: maxminddb -h

Usage in a dart program: #

  1. Initialize the database:
    var database = await MaxMindDatabase.memory(
         File('GeoLite2-City.mmdb').readAsBytesSync());
    
    // OR
    
    var database = await MaxMindDatabase.file(File('GeoLite2-City.mmdb'));
    
  2. Search the database:
    print(await database.search('8.8.8.8'));
    
    The result might vary depending on the database you are using.

The database can either be loaded in memory or queried from a file system. Depending on the compute power and disk speed, loading the database in memory should be roughly 20 times faster.

The library can be benchmarked using the benchmark example.

4
likes
160
pub points
72%
popularity

Publisher

unverified uploader

A library for querying MaxMind databases (like GeoLite2-City.mmdb).

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

args, extendedip

More

Packages that depend on maxminddb