Check whether an IP address belongs to a cloud provider
Project description
PyRadix
PyRadix is a performant radix implementation designed for looking up IP addresses, IP networks, and DNS hostnames. Written in pure python.
Used by:
Example
from pyradix import RadixTree
rt = RadixTree()
# IPv4
rt.insert("192.168.1.0/24")
rt.search("192.168.1.10") # ipaddress.ip_network("192.168.1.0/24")
rt.search("192.168.2.10") # None
# ipv6
rt.insert("dead::/64")
rt.search("dead::beef") # ipaddress.ip_network("dead::/64")
rt.search("dead:cafe::beef") # None
# DNS
rt.insert("net")
rt.insert("www.example.com")
rt.insert("test.www.example.com")
rt.search("net") # "net"
rt.search("evilcorp.net") # "net"
rt.search("www.example.com") # "www.example.com"
rt.search("asdf.test.www.example.com") # "test.www.example.com"
rt.search("example.com") # None
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-0.0.9.tar.gz
(92.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-0.0.9.tar.gz.
File metadata
- Download URL: radixtarget-0.0.9.tar.gz
- Upload date:
- Size: 92.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.8.1-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33fd621476b57e725e97e741848fa69cf12fc69811ce7c3168e50930e8b472fa
|
|
| MD5 |
550d9b2e5ebfacd8cee49fdb68cdc13c
|
|
| BLAKE2b-256 |
39ac74e84cdfa2bd205f1c1aea2a3112ea6b1fe232254c2eda19ec18dc98b3a8
|
File details
Details for the file radixtarget-0.0.9-py3-none-any.whl.
File metadata
- Download URL: radixtarget-0.0.9-py3-none-any.whl
- Upload date:
- Size: 86.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.8.1-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05d33613ec3844880c96dea09b0f0a87f52efb1ad1ec44fcb26d23aefa71c5da
|
|
| MD5 |
7bce05dd2af1e5e3050d0e1091cd9f3b
|
|
| BLAKE2b-256 |
e1761f987d2453b8b3d20e3dcb3b2755c234de2c2b818a88fb203156b9cf4371
|