maxmind / GeoIP2-python

Python code for GeoIP2 webservice client and database reader
https://geoip2.readthedocs.org/en/latest/
Apache License 2.0
1.1k stars 140 forks source link

Query mmdb file to get ips examples #168

Closed YardenMarkus closed 4 months ago

YardenMarkus commented 4 months ago

I'm looking for ipv6 examples to run some tests and I can't find a way to query mmdb file to get a few IP addresses. I can only query it with a specific IP. For example, I need some ipv6 with and without ISP, and a few ips from different countries. Is there a way to do this?

oschwald commented 4 months ago

The data is only indexed by IP. You could iterate over the database until you find a record that meets your needs or you could similarly grep one of the CSV databases for such data.

That said, if you are writing unit or integration tests, I would suggest using the test databases from this repo.