EasyI2L - Easy IP2Location Wrapper
easyi2l is a Python wrapper around the IP2LOCATION library. It allows you to automatically download and load the IP2LOCATION database, simplifying the process of working with IP geolocation data.
Features
- Automatic Download: Fetches the IP2LOCATION database directly using your IP2LOCATION token.
- Database Loading: Automatically loads the downloaded database for immediate use.
- Simple API: Retrieve IP geolocation data with minimal setup.
Installation
Install the package via pip:
pip install easyi2l
Usage
Before using the package, ensure you have the IP2LOCATION_TOKEN environment variable set. You can obtain a token from IP2Location LITE.
Example
Here's a simple example of how to use easyi2l:
from pathlib import Path
from easyi2l import EasyI2L, DBType
# Download to the default folder
db = EasyI2L.download(DBType.DB11LITEBIN).load()
# Or specify a custom download folder
# db = EasyI2L.download(DBType.DB11LITEBIN, folder=Path("./ipdb")).load()
# Retrieve all data for an IP address
print(db.get_all("1.1.1.1"))
Environment Setup
You need to set the IP2LOCATION_TOKEN environment variable for the package to function correctly. The package uses load_dotenv from the dotenv module to load this variable from a .env file in your working directory.
Create a .env file with the following content:
IP2LOCATION_TOKEN=your_token_here
Contributing
Feel free to open issues or submit pull requests to improve the library.
License
This project is licensed under the MIT License.
Metadata
Release files for easyi2l 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| easyi2l-0.0.9.tar.gz | 4.5 kB | Without provenance | Details for easyi2l-0.0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| easyi2l-0.0.9-py3-none-any.whl | Python 3 | none | any | Details for easyi2l-0.0.9-py3-none-any.whl |
Total release size: 10.9 kB
Release files / easyi2l-0.0.9.tar.gz
| Download URL | easyi2l-0.0.9.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e93647fc1d9eda0949f8beb11420eb9d75811a57c3f747d25458ed68fdf1ff61
|
|
BLAKE2b-256 checksum How to use checksums |
d7cba65176ad0980f91e342a5405dde588a35e67d21735e59ac6f208d77f45ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.18
|
Release files / easyi2l-0.0.9-py3-none-any.whl
| Download URL | easyi2l-0.0.9-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3eaf37ccc7ca3765311a7fde7546267d822a150330127eed019af8bc0df94ef3
|
|
BLAKE2b-256 checksum How to use checksums |
4c2aafdf10d59923d1b2677247ed3a7018567b5d79c685e1f84ff91f1b42e1ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.8.18
|
Security for easyi2l 0.0.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.