getgeo-python
getgeo-python is a python wrapper for the API provided by getgeoapi.com.
This API allows the one to access a wide range of information to better understand ones customers.
Information provided by getgeoapi.com includes:
- City data | Find out where your customers are from
- Country data | Customize your application based on your user's country
- Security data | Check if your user appeared in any security blacklist and could be a threat to your business
- Currency data | Find out the preferred currency of your visitors and display prices in their preferred currency
- Time zone data | Retrieve the time zone of your visitors to customize your offers and promotions
- ASN data | Access information about the internet provided by your users
Why use getgeoapi.com:
- IPv4 and IPv6 | Access location and security data whether you have an IPv4 or IPv6 address
- Reliable | Scalable infrastructure with 99.99% up time
- Secure | 256-bit SSL encryption to ensure your data is transmitted safely
- Fast | Average response time is 66ms
Usage
Requirements
For you to be able to use this package you must have Python 3 installed in your system.
You must also have an api_key provided by getgeoapi.com. To get an api_key for your application, simply create an account, and click the 'Generate API Key' button.
Copy your api_key to a secure location.
Installation
To use getgeo-python, you need to first install it as follows:
# upgrade pip
pip install --upgrade pip
# install getgeo-python
pip install getgeo-python
Once installation is complete, you can now start using getgeo-python.
Usage
Import GetGeoData class, and create a new instance of it by providing your api key.
# import GetGeoData
from getgeo.geodata import GetGeoData
# setup api key
your_api_key = "exampleofapikey"
# create a new instance of GetGeoData
ip_data = GetGeoData("your_api_key")
Don't forget to replace "exampleofapikey" with your actual api_key.
The class GetGeoData has two instance methods, i.e.:
get_my_geo_dataget_geo_data
The get_my_geo_data method returns information based on your IP address. While the get_geo_data method, takes one argument (any IP address__IPV4 or IPV6), and returns information based on the IP address.
The response of both methods in in json format.
Example:
# get my own geo data
my_geo_data = ip_data.get_my_geo_data()
print(my_geo_data)
# get geo data of given IP address
# Google's IPv6 address
# 2001:4860:4860::8888
geo_data = ip_data.get_geo_data("2001:4860:4860::8888")
print(geo_data)
For more information visit getgeoapi.com.
Release files for getgeo-python 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| getgeo-python-1.1.0.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| getgeo_python-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / getgeo-python-1.1.0.tar.gz
| Download URL | getgeo-python-1.1.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4452a896bfa63244a8fceca4e5e0d40d7fe7a8cbfe91173492e9cd06e73e4730
|
|
BLAKE2b-256 checksum How to use checksums |
49e79cee6c03be181d4c00bfd63562210785182ed391c686f119edd6abda4d0c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|
Release files / getgeo_python-1.1.0-py3-none-any.whl
| Download URL | getgeo_python-1.1.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b81edf4957a90bb86de7d741a3384aab5e911e3760b448811ba75f8893d2b5e1
|
|
BLAKE2b-256 checksum How to use checksums |
65593a15ea3e0314217589873b4daf7cbe0e25b3219f8a9ac2f29f61ac8edf08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.6
|