Registry / devops / geoip2-tools

geoip2-tools

JSON →
library0.1.1pypypiunverified

geoip2-tools provides command-line utilities for the automatic update and administration of MaxMind GeoIP2 databases. It simplifies the process of downloading and managing the GeoLite2 or GeoIP2 databases. The current version is 0.1.1, and the project appears to be in a stable state with a slow release cadence, primarily focusing on bug fixes.

pip install geoip2-tools
INSTALL
IMPORT
SIG · GEOIP2-TOOLS
G
geoip2-tools
devopspythonv0.1.1
Install
4.7s avg
Import
Disk
31MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 31.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 4.7s · import 0.000s · 33MB
31MB installed
● package 31MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Manager
from geoip2_tools import Manager
from geoip2_tools import Manager

This quickstart demonstrates how to configure your MaxMind credentials via environment variables and then use the `geoip2-tools` CLI to update and check the status of your GeoIP2 databases. Ensure you replace the placeholder credentials with your own.

# 1. Set your MaxMind account ID and license key as environment variables # (Replace 'YOUR_ACCOUNT_ID' and 'YOUR_LICENSE_KEY' with your actual credentials) export GEOIP2_ACCOUNT_ID="YOUR_ACCOUNT_ID" export GEOIP2_LICENSE_KEY="YOUR_LICENSE_KEY" # 2. Run the update command to download/update databases geoip2-tools update # 3. Check the status of your databases geoip2-tools status
geoip2-tools --version
Debug
Known issues
gotchaThis library is designed for *managing* GeoIP2 databases (downloading, updating). It is not for performing GeoIP lookups within Python code. For that, you should use the `geoip2` library directly (e.g., `from geoip2.database import Reader`).
fix
Use `pip install geoip2` and `from geoip2.database import Reader` for in-application lookups.
affects: All versions
gotchaTo download or update GeoIP2 databases, you *must* provide your MaxMind Account ID and License Key. These can be set via `GEOIP2_ACCOUNT_ID` and `GEOIP2_LICENSE_KEY` environment variables, or through a configuration file.
fix
Before running `geoip2-tools update`, set environment variables: `export GEOIP2_ACCOUNT_ID='...'` and `export GEOIP2_LICENSE_KEY='...'`. Alternatively, configure them in a `geoip2-tools.yaml` file.
affects: All versions
gotchaThe default database download location might not be suitable for your production environment. Databases are typically stored in `/usr/local/share/GeoIP` (Linux) or a user's data directory. Consider configuring a custom path if needed.
fix
Use the `--database-path` option with CLI commands or configure the `database_path` in `geoip2-tools.yaml` to specify a desired storage location.
affects: All versions
Upgrade
Version history
0.1.1latest on PyPI · released Oct 29, 2020
Audit
Dependencies
geoip2requiredRequired for interacting with MaxMind GeoIP2 data formats and underlying API logic.
clickrequiredUsed for building the command-line interface (CLI).
requestsrequiredUsed for making HTTP requests to download GeoIP2 database updates from MaxMind.
Agent activity
11 hits · last 30 days
node
10
Resources
geoip2-tools — pip install geoip2-tools · libregistry