Skip to main content

Check whether an IP address belongs to a cloud provider

Project description

RadixTarget

Python Version License Black tests Codecov

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

radixtarget-3.0.15.tar.gz (108.2 kB view details)

Uploaded Source

Built Distribution

radixtarget-3.0.15-py3-none-any.whl (108.8 kB view details)

Uploaded Python 3

File details

Details for the file radixtarget-3.0.15.tar.gz.

File metadata

  • Download URL: radixtarget-3.0.15.tar.gz
  • Upload date:
  • Size: 108.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.21

File hashes

Hashes for radixtarget-3.0.15.tar.gz
Algorithm Hash digest
SHA256 dedfad3aea1e973f261b7bc0d8936423f59ae4d082648fd496c6cdfdfa069fea
MD5 5171ac0b282ef76298df3cce64b37eab
BLAKE2b-256 26891c19b98c48f703fe654f3e7d8986556573fe412945f13842240b7cf87e9a

See more details on using hashes here.

File details

Details for the file radixtarget-3.0.15-py3-none-any.whl.

File metadata

  • Download URL: radixtarget-3.0.15-py3-none-any.whl
  • Upload date:
  • Size: 108.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.21

File hashes

Hashes for radixtarget-3.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 1e1d0dd3e8742ffcfc42084eb238f31f6785626b876ab63a9f28a29e97bd3bb0
MD5 9fae13d73b53a15d9310ab808858115f
BLAKE2b-256 3ab4b461d1c1d200a76216fd4c277492c706ec2a8552fd015158ae063dcc6940

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page