geoip2fast
GeoIP2Fast is the fastest GeoIP2 country/city/asn lookup library that supports IPv4 and IPv6. A search takes less than 0.00003 seconds. It has its own data file updated twice a week with Maxmind-Geolite2-CSV, supports IPv4/IPv6 and is Pure Python!
Decision gist · record as of 2026-08-14
Yes, with conditions. Install if you need fast, offline IP geolocation and are willing to manage data file downloads separately. The library is actively maintained, has no dependencies, and supports current Python versions. High install friction (separate data file requirement) and the need to choose between country/city and IPv4/IPv6 variants make it less suitable for quick prototyping, but it is well-suited for production systems where speed and offline operation matter.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- A .dat.gz data file must be present in the library directory or application directory; the default geoip2fast.dat.gz (country IPv4 only) is included, but city or IPv6 databases require separate download.
- Installation friction is high because the package requires a separate binary data file (.dat.gz) to function; the pip package includes only country-level IPv4 data, and city or IPv6variants must be downloaded separately or generated manually.
- The library itself has no runtime dependencies and is actively maintained.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
last release 2024-06-21 (784 days) · last repo commit 2026-06-05 · 91 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 214,693 downloads/mo, #9,410 on PyPI
Alternatives
Verify before relying
pip install geoip2fast
from geoip2fast import GeoIP2Fast
geo = GeoIP2Fast()
result = geo.lookup('8.8.8.8')
print(result)- Whether the lookup speed claim of 'less than 0.00003 seconds' is measured under realistic application conditions or in controlled benchmarks.
- Compatibility and performance behavior under PyPy3 compared to CPython across different data file sizes.
- Whether the reduced versions (geoip2fastmin.py, geoip2fastminified.py) are production-ready or still in testing.
What it is and what it does
GeoIP2Fast is a pure-Python geolocation library that maps IP addresses to geographic and network information using local binary data files. It loads Maxmind GeoLite2 data into memory and performs lookups via binary search on ordered IP ranges, returning country codes, city names, ASN names, and CIDR blocks for both IPv4 and IPv6 addresses. The library requires no external dependencies or network calls—only the Python file and a .dat.gz data file.
The package ships with a small country-level IPv4 database, but city and IPv6 variants must be downloaded separately or generated from Maxmind CSV files using the included geoip2dat.py tool. Data files are updated twice weekly. The library supports Python 3.7 through 3.13 and PyPy3, runs on Linux, Windows, and macOS, and is designed for applications that need fast, offline geolocation without external service dependencies.
Use it for
- Geoblock or route traffic based on IP country origin in web applications or APIs.
- Enrich server logs or analytics with geolocation data without making external API calls.
- Identify ASN and network ownership for security monitoring or abuse detection.
- Resolve city-level location for user analytics or localization features in high-throughput services.
- Generate test data using the random IP address generation functions for unit or integration tests.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Install if you need fast, offline IP geolocation and are willing to manage data file downloads separately. The library is actively maintained, has no dependencies, and supports current Python versions. High install friction (separate data file requirement) and the need to choose between country/city and IPv4/IPv6 variants make it less suitable for quick prototyping, but it is well-suited for production systems where speed and offline operation matter.
Install
geoip2fast on PyPI
Before you install
Installation friction is high because the package requires a separate binary data file (.dat.gz) to function; the pip package includes only country-level IPv4 data, and city or IPv6variants must be downloaded separately or generated manually. The library itself has no runtime dependencies and is actively maintained.
A .dat.gz data file must be present in the library directory or application directory; the default geoip2fast.dat.gz (country IPv4 only) is included, but city or IPv6 databases require separate download.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install geoip2fast
from geoip2fast import GeoIP2Fast
geo = GeoIP2Fast()
result = geo.lookup('8.8.8.8')
print(result)
Verify before relying
- Whether the lookup speed claim of 'less than 0.00003 seconds' is measured under realistic application conditions or in controlled benchmarks.
- Compatibility and performance behavior under PyPy3 compared to CPython across different data file sizes.
- Whether the reduced versions (geoip2fastmin.py, geoip2fastminified.py) are production-ready or still in testing.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Actively maintained 784 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 214,693 / month, #9,410 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: Windows :: Windows 10Operating System :: Microsoft :: Windows :: Windows 11Operating System :: POSIXOperating System :: POSIX :: BSDOperating System :: POSIX :: BSD :: FreeBSDOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: PyPyTopic :: InternetTopic :: Internet :: FingerTopic :: Scientific/EngineeringTopic :: SecurityTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: LocalizationTopic :: System :: MonitoringTopic :: System :: NetworkingTopic :: System :: Systems AdministrationTopic :: Utilities |
Evidence: geoip2fast-1.2.2.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “geoip lookup library”
- geoip2fastGeoIP2Fast performs fast geolocation lookups for IPv4 and IPv6…
- maxminddb-geolite2Provides geolocation lookups by IP address using MaxMind's GeoLite2…
- geoip2Queries MaxMind's GeoIP web services and databases to look up…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also IP2Location · maxminddb-geolite2 · pyasn · geoip2-tools · ipinfo · maxminddb · geoip2 · ip3country · ipwhois · cidr-trie