maxmind / mmdbwriter

Go library for writing MaxMind DB (mmdb) files
Apache License 2.0
114 stars 28 forks source link

Build geoip2 database #68

Closed zanpakuto closed 11 months ago

zanpakuto commented 11 months ago

I have created an mmdb file using the golang mmdbwriter, but had a hard time reading it geoip2 readers because of exceptions while reading the file (https://pypi.org/project/geoip2/).

I'm wondering if there is way to create a geoip2 compatible mmdb that could be read by geoip2 readers.

What is the actual difference between geoip2 and mmdbwriter?

oschwald commented 11 months ago

MMDB is a data format that allows arbitrarily structured records. The various GeoIP2 databases have metadata and records that follow particular formats that geoip2 expects. If you are building a database from scratch that does not follow the record format of the MaxMind databases exactly, I would recommend reading them with maxminddb in Python rather than geoip2. maxminddb can return data in an arbitrary record format.

All MaxMind databases are made using mmdbwriter in Go or MaxMind::DB::Writer in Perl.