Library for Tornado web framework to locate IPs or server names.
Project description
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
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
torip-0.2.2.tar.gz
(5.6 kB
view details)
Built Distribution
torip-0.2.2-py3-none-any.whl
(6.4 kB
view details)
File details
Details for the file torip-0.2.2.tar.gz
.
File metadata
- Download URL: torip-0.2.2.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dde409c4e1ac56c8d8e03c6084d802ea3e3f90c465491af0c74c2e0bad8f7dd |
|
MD5 | 5528175abe3459999716a04084d67374 |
|
BLAKE2b-256 | ff0f8add0263da28ea312a20f6caff6fd3cba84b1c728832b3d82330dc9c01f1 |
File details
Details for the file torip-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: torip-0.2.2-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70737fd5b43b32858f0da968b15d0db7cb0297eb8863961b5377adaf919c27e2 |
|
MD5 | d449b6f29ff1c04ee441f2c0a96422a3 |
|
BLAKE2b-256 | e3ced07c7e07b7a1fd21cc49d89c24258ebb594dfa5480387bb68283cb379114 |