mmdb-writer
Make `mmdb` format ip library file which can be read by maxmind official language reader
What it is and what it does
mmdb-writer is a Python library that creates MaxMind DB (MMDB) format files—the binary database format used by MaxMind's GeoIP and other IP-based lookup services. It takes IP networks (specified using netaddr's IPSet) and associates them with arbitrary data (country codes, ISP names, etc.), then writes them to a .mmdb file that can be read by MaxMind's official readers in any supported language.
The library handles MMDB's type system, which includes multiple integer and float types (int32, uint16, uint32, uint64, uint128, float, double). Since Python has only one integer and one float type, mmdb-writer lets you specify how integers should be encoded (auto-detection by value size, or explicit types like i32, u16, u32, u64, u128) and provides type wrappers (MmdbI32, MmdbF32) for fine-grained control. This is especially important when Java clients will read the resulting database, as Java's deserialization depends on correct MMDB type metadata.
Use it for:
- Build a custom IP geolocation database by mapping IP ranges to country codes, cities, or ISP information.
- Create a private IP-to-metadata lookup service for internal network management or security applications.
- Convert CSV or other structured IP data sources into MMDB format for distribution to MaxMind reader clients.
- Generate test MMDB files with specific IP ranges and data for unit testing geolocation-dependent code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates MaxMind DB (MMDB) format files from IP networks and associated data, compatible with MaxMind's official language readers.
Yes, if you need to create or customize MMDB files in Python. The library is actively maintained, has low install friction, carries a permissive MIT license, and supports current Python versions (3.9–3.13). No known vulnerabilities. Consider the pure-Python performance baseline before committing to large-scale database generation; the Rust beta branch is available if speed becomes a bottleneck.
Install
mmdb-writer on PyPI
pip
pip install mmdb-writeruv
uv add mmdb-writerpoetry
poetry add mmdb-writerInstalling mmdb-writer
Before you install
Low friction install with a single runtime dependency (netaddr). Active maintenance with recent releases; last commit 2026-06-01 and marked Production/Stable.
License in practice
MIT license (permissive) — you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install mmdb_writer
from netaddr import IPSet
from mmdb_writer import MMDBWriter
writer = MMDBWriter()
writer.insert_network(IPSet(['1.1.0.0/24']), {'country': 'US'})
writer.to_db_file('output.mmdb')
Verify before relying
- Whether the pure-Python version's performance is acceptable for your use case, given the Rust beta branch claims 6–8× speedup.
- Compatibility guarantees with specific MaxMind reader versions across different languages.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — netaddr |
| Maintenance | actively maintained — 74 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 534,139/month — #6,138 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mmdb_writer-0.2.7-py3-none-any.whl
Keywords: mmdb, maxmind
Tags
More Build Tools packages
Provides reusable utilities for Python…
permissive · top 100 on PyPI
tqdmWraps any iterable to display a real-time…
copyleft · top 100 on PyPI
pippip is the standard installer for Python…
permissive · top 100 on PyPI
hatchlingHatchling is a standards-compliant Python build…
permissive · top 100 on PyPI
grpcio-toolsGenerates Python gRPC service stubs and message…
permissive · top 1,000 on PyPI
pre-commitpre-commit is a framework for installing and…
permissive · top 1,000 on PyPI
maxminddbReads MaxMind DB files to look up geolocation…
permissive · top 5,000 on PyPI
maxminddb-geolite2Provides geolocation lookups by IP address…
unclear · top 15,000 on PyPI
geoip2Queries MaxMind's GeoIP web services and…
permissive · top 5,000 on PyPI
geoip2-toolsAutomates downloading and updating of MaxMind…
permissive · top 15,000 on PyPI
types-maxminddbProvides type stubs for the maxminddb package,…
permissive · top 15,000 on PyPI
IP2LocationLooks up geolocation data (country, region,…
permissive · top 15,000 on PyPI
geoip2fastGeoIP2Fast performs fast geolocation lookups…
permissive · top 15,000 on PyPI
mpxjReads and writes project management file…
copyleft · top 15,000 on PyPI
minfraudPython client library for MaxMind's minFraud…
permissive · top 15,000 on PyPI
IPyIPy provides Python classes for parsing,…
permissive · top 5,000 on PyPI