ip3country
A zero-dependency, local, fast, tiny ip-address to country lookup
Decision gist · record as of 2026-08-14
Yes. Zero dependencies, active maintenance, permissive license, and a proven track record of high download volume make this a reliable choice for any application needing fast, local IP-to-country lookup. The small footprint and offline operation are significant advantages over larger geolocation libraries. Verify that IP2Location LITE's accuracy meets your geographic coverage needs before deploying.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installs cleanly with no runtime dependencies.
- Actively maintained with a recent commit on 2026-08-12 and steady releases since first_release 2021-10-04.
License · maintenance · safety
ISC (permissive) — Licensed under ISC (permissive), allowing commercial and private use with minimal restrictions. Attribution to IP2Location LITE data is required per the CCA license of the underlying database.
last release 2025-07-10 (400 days) · last repo commit 2026-08-12 · 4 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 8,613,615 downloads/mo, #1,602 on PyPI
Alternatives
Verify before relying
pip install ip3country
from ip3country import CountryLookup
lookup = CountryLookup()
print(lookup.lookupStr("123.45.67.8")) # 'KR'- Whether accuracy for country-level lookups meets your specific use case (IP2Location LITE accuracy varies by region and IP type).
- Whether the compacted database is updated regularly and how to refresh it if needed.
What it is and what it does
ip3country is a minimal IP-to-country lookup library designed for speed and size. It maps IP addresses to their ISO 3166-1 alpha-2 country codes using a compacted database derived from IP2Location LITE data, all in under 500KB with zero external dependencies. The library supports both string and numeric IP address formats and is built for applications that need fast, local country detection without the overhead of larger geolocation libraries.
The package is actively maintained and ranks in the top 5000 PyPI packages by download volume. It was created at Statsig to power country-level feature flag rollouts and A/B tests, making it suitable for any application requiring lightweight, offline country-level IP geolocation without network calls or large data files.
Use it for
- Evaluate location-based feature flags or A/B test conditions based on user IP country.
- Filter or route traffic by country in a lightweight, self-contained service.
- Add country-level analytics or logging to requests without external API calls.
- Implement country-based access controls or compliance checks in edge functions.
- Populate country metadata in high-volume logging pipelines where size and speed matter.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Zero dependencies, active maintenance, permissive license, and a proven track record of high download volume make this a reliable choice for any application needing fast, local IP-to-country lookup. The small footprint and offline operation are significant advantages over larger geolocation libraries. Verify that IP2Location LITE's accuracy meets your geographic coverage needs before deploying.
Install
ip3country on PyPI
Before you install
Installs cleanly with no runtime dependencies. Actively maintained with a recent commit on 2026-08-12 and steady releases since first_release 2021-10-04.
License in practice
Licensed under ISC (permissive), allowing commercial and private use with minimal restrictions. Attribution to IP2Location LITE data is required per the CCA license of the underlying database.
Quickstart
pip install ip3country
from ip3country import CountryLookup
lookup = CountryLookup()
print(lookup.lookupStr("123.45.67.8")) # 'KR'
Verify before relying
- Whether accuracy for country-level lookups meets your specific use case (IP2Location LITE accuracy varies by region and IP type).
- Whether the compacted database is updated regularly and how to refresh it if needed.
Package facts
| License | ISC permissive |
| Python support | Supports the current Python release >=2.0 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 400 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,613,615 / month, #1,602 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries |
Evidence: ip3country-0.4.0-py3-none-any.whl
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 › “ip address to country code lookup”
- ip3countryLooks up the ISO 3166-1 alpha-2 country code for an IP address using…
- IP2LocationLooks up geolocation data (country, region, city, latitude/longitude,…
- maxminddb-geolite2Provides geolocation lookups by IP address using MaxMind's GeoLite2…
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 · pycountry-convert · geoip2fast · iso3166 · maxminddb-geolite2 · geoip2 · country_list · ipinfo · pgeocode · pycountry