Tool Open source

ip2region

ip2region is an offline IP-to-region localization library and IP data management framework for IPv4 and IPv6. It stores localization data in the xdb format, supports customizable region fields, and provides tools that generate xdb files from raw IP ranges while merging adjacent segments and deduplicating and compressing identical region data. The xdb query interface returns unified results for IPv4 and IPv6, with clients and generation tools for languages including Go, PHP, Java, C, Lua, Rust, Python, JavaScript, C#, Erlang, C++, and others. The repository includes city-level data with country, province, city, ISP, and ISO alpha-2 code fields, plus optional memory-caching modes for faster queries; it also notes that the included raw data is updated irregularly and can be replaced or edited for custom or higher-frequency data requirements.

View repository Visit site