IP Geolocation for Python (geolocation-api-python)
Python library for Abstract free IP Geolocation API.
Full documentation can be found on Abstract IP Geolocation API page.
Getting started
Getting started with Abstract IP Geolocation API is very simple, you just need to install the library into your project as follow:
pip install abstract-ip-geolocation-api
From there you can then call the geolocationapi as follow:
# Import abstract ip geolocation api module
import importlib
abstract_ip_geolocation_api = importlib.import_module("abstract-ip-geolocation-api")
# Initiate the geolocation api with a free API key retrieved on https://www.abstractapi.com/ip-geolocation-api
geolocation_api = abstract_ip_geolocation_api.v1('YOUR_API_KEY')
# Fetch location data for a given IP
# Note: If you don't provide an ip_address value, then the requester IP will be used
location_data = geolocation_api.geolocate(ip_address="ANY_IP_ADDRESS")
# Process location data and potential errors
if 'ip_address' in location_data:
# Location data has been successfully retrieved
country = location_data['country']
city = location_data['city']
print(country)
elif 'error' in location_data:
# Handle Abstract related errors
error = location_data['error']
print(error)
else:
# No location data available for this IP
print('No location data available for this IP')
Metadata
Release files for abstract-ip-geolocation-api 1.5.2
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 | |
|---|---|---|---|---|
| abstract-ip-geolocation-api-1.5.2.tar.gz | 2.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| abstract_ip_geolocation_api-1.5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.6 kB
Release files / abstract-ip-geolocation-api-1.5.2.tar.gz
| Download URL | abstract-ip-geolocation-api-1.5.2.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2eb2e5fca04c5b32c889667971a6914cb987cc43b2d0fe3da1dc6613164ca2a8
|
|
BLAKE2b-256 checksum How to use checksums |
493f9e8cd1ec3f7fc1f685634ed7a6168be42d59e3312ff4e3a0a3f7150ff215
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
|
Release files / abstract_ip_geolocation_api-1.5.2-py3-none-any.whl
| Download URL | abstract_ip_geolocation_api-1.5.2-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d469897169db4592a4487964f2e0dd0d22417e56dca07edc03c859bc41364cd
|
|
BLAKE2b-256 checksum How to use checksums |
f73b566b7fffa516e203c27d3fc49b46629154bd8a50b979b7fedc3d9831bf35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
|
Security for abstract-ip-geolocation-api 1.5.2
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.