Skip to main content

Easily get the country code from an ip address.

Project description

location_ipfire_db_reader

Main usage:

from location_ipfire_db_reader import LocationDatabase
from pathlib import Path


location_db = Path('location.db')
# This call will download the location database into the provided file.
#   It will not re-download it if there are no updates.
LocationDatabase.download(location_db)

db = LocationDatabase(location_db)
print(db.find_country('8.8.8.8'))  # US

Should work for both IP4 & IP6.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

location_ipfire_db_reader-1.0.1.tar.gz (11.8 kB view hashes)

Uploaded Source

Built Distribution

location_ipfire_db_reader-1.0.1-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page