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
Built Distribution
File details
Details for the file location_ipfire_db_reader-1.0.2.tar.gz
.
File metadata
- Download URL: location_ipfire_db_reader-1.0.2.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.10.9 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0690bc3922b08b6f33186ef4d1ef536bb60421eba2ae3337593efb80dd71023 |
|
MD5 | 6cbd67aaad425ed144de05529323ce4f |
|
BLAKE2b-256 | 4d4e0bd661965d1ca88e76d92949941e3325809c2c2bf9e22512ce29e1ee56b1 |
File details
Details for the file location_ipfire_db_reader-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: location_ipfire_db_reader-1.0.2-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.10.9 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc33b721575797a1595a5ce8f2d227486133ce0bd2c0dbe270dfdc0d9b6bfa89 |
|
MD5 | 247573ceeb68b6c1b040bbd1e77f5ad5 |
|
BLAKE2b-256 | 557db23fa3b6d7906a3a8deed615a0b2cdbfe554e4bfc7f628908b388e7bf939 |