Check whether an IP address belongs to a cloud provider
Project description
RadixTarget
RadixTarget is a performant radix implementation designed for quick lookups of IP addresses/networks and DNS hostnames.
RadixTarget is:
- Written in pure python
- Capable of ~100,000 lookups per second regardless of database size
- 100% test coverage
- Used by:
Installation (PyPi)
pip install radixtarget
Example Usage
from radixtarget import RadixTarget
rt = RadixTarget()
# IPv4
rt.add("192.168.1.0/24")
rt.get("192.168.1.10") # IPv4Network("192.168.1.0/24")
rt.get("192.168.2.10") # None
# IPv6
rt.add("dead::/64")
rt.get("dead::beef") # IPv6Network("dead::/64")
rt.get("dead:cafe::beef") # None
# DNS
rt.add("net")
rt.add("www.example.com")
rt.add("test.www.example.com")
rt.get("net") # "net"
rt.get("evilcorp.net") # "net"
rt.get("www.example.com") # "www.example.com"
rt.get("asdf.test.www.example.com") # "test.www.example.com"
rt.get("example.com") # None
# Custom data nodes
rt.add("evilcorp.co.uk", "custom_data")
rt.get("www.evilcorp.co.uk") # "custom_data"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
radixtarget-2.0.0.51.tar.gz
(104.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file radixtarget-2.0.0.51.tar.gz.
File metadata
- Download URL: radixtarget-2.0.0.51.tar.gz
- Upload date:
- Size: 104.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11544c36895d4f74634d34e548db2bf60c3a483a0982171b700065aeaa03a6ed
|
|
| MD5 |
59554ab0da472e4f6e83040e79bb6c91
|
|
| BLAKE2b-256 |
894b059b62b57dcaade075c12913967f3ea8b7e214b47abe9b6a0e001aa00a14
|
File details
Details for the file radixtarget-2.0.0.51-py3-none-any.whl.
File metadata
- Download URL: radixtarget-2.0.0.51-py3-none-any.whl
- Upload date:
- Size: 104.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5d25736f5024fcd748835c2da03149b5590d13e4f2995961f6a5bb54ec54132
|
|
| MD5 |
4637b7ad6e47807c3b5f66848696cca0
|
|
| BLAKE2b-256 |
b3efa41599952218e63ac302d534ff55194a8a30b378a3598da16496eff84df6
|