torip
Python library for Tornado web framework to locate IPs or server names.
Torip will provide you information like country, city, zip code or the url of google maps.
Installation
$ pip install torip
Available APIs
Torip supports the following APIs:
[abstractapi] ABAPI
It is also the default API.
from torip.locator import Locator
locator = Locator(api_name='abstractapi', api_token=<Your API TOKEN>)
or
from torip.locator import Locator
locator = Locator(api_token=<Your API TOKEN>) # default API
[ip-api] IPAPI
from torip.locator import Locator
locator = Locator(api_name='ip-api')
Example
import tornado
from torip.locator import Locator
ip = '<IP ADDRESS>'
@tornado.gen.coroutine
def function():
try:
locator = Locator(api_token='<YOUR API TOKEN>')
result = yield locator.locate(ip)
print(result)
except Exception as e:
print(str(e))
finally:
ioloop.stop()
ioloop = tornado.ioloop.IOLoop.instance()
ioloop.add_callback(function)
ioloop.start()
Docs
Metadata
Release files for torip 0.2.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 | |
|---|---|---|---|
| torip-0.2.2.tar.gz | 5.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| torip-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.0 kB
Release files / torip-0.2.2.tar.gz
| Download URL | torip-0.2.2.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8dde409c4e1ac56c8d8e03c6084d802ea3e3f90c465491af0c74c2e0bad8f7dd
|
|
BLAKE2b-256 checksum How to use checksums |
ff0f8add0263da28ea312a20f6caff6fd3cba84b1c728832b3d82330dc9c01f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
|
Release files / torip-0.2.2-py3-none-any.whl
| Download URL | torip-0.2.2-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70737fd5b43b32858f0da968b15d0db7cb0297eb8863961b5377adaf919c27e2
|
|
BLAKE2b-256 checksum How to use checksums |
e3ced07c7e07b7a1fd21cc49d89c24258ebb594dfa5480387bb68283cb379114
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0
|