--- id: mmdb-writer version: "0.2.7" license: unclear license_treatment: permissive maintenance: active --- # mmdb-writer — Make `mmdb` format ip library file which can be read by maxmind official language reader License: permissive · Maintenance: active · Downloads: 534.1K/mo ## 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 above — 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 pip install mmdb-writer uv add mmdb-writer poetry add mmdb-writer ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 534.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags mmdb file generator, maxmind db writer, ip geolocation database creation, create mmdb format files, ip network data storage, ip-geolocation, database-generation [View on SkillFed](https://skillfed.io/packages/mmdb-writer) · [View on PyPI](https://pypi.org/project/mmdb-writer/)