maxminddb-geolite2 is a Python library that provides convenient access to MaxMind's GeoLite2 City database. It packages a version of the GeoLite2 City database directly within the Python package, aiming to simplify integration by eliminating the need for separate database downloads for basic usage. The latest release, version 2018.703, was published in July 2018.
pip install maxminddb-geolite2Verified import paths — ran on the pinned version, not inferred.
Initialise the geolite2 reader and perform an IP lookup. Remember to close the reader when done to free up resources.
This library cannot be used to automatically fetch current GeoLite2 databases. To use up-to-date data, users must manually obtain a GeoLite2 database (`.mmdb` file) from MaxMind (requiring a MaxMind account and license key) and use the `maxminddb` library directly, or use MaxMind's `geoipupdate` tool.
Always use the most current GeoLite2 database available from MaxMind for accurate results. This requires manual download and integration with the `maxminddb` library, as this wrapper cannot update its bundled data.
Consider migrating to the official `maxminddb` library and managing GeoLite2 database downloads and updates independently using MaxMind's recommended tools (e.g., `geoipupdate`).
To get current geolocation data, download the latest GeoLite2 database (`.mmdb` file) from your MaxMind account (requires registration and a license key). Then, use the lower-level `maxminddb` library to load and query this up-to-date `.mmdb` file.
Reinstall `maxminddb-geolite2` to ensure a fresh, uncorrupted bundled database, or if using a manually supplied database, redownload the `.mmdb` file from MaxMind's website to ensure its integrity.
This library is not designed for database updates. To keep GeoLite2 data current, register for a MaxMind account, obtain a license key, and use MaxMind's `geoipupdate` program or a custom script to download the latest `.mmdb` files, then use the `maxminddb` library to access them.
No resource links recorded.