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-2.0.0.48.tar.gz (104.1 kB view details)

Uploaded Source

Built Distribution

radixtarget-2.0.0.48-py3-none-any.whl (104.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for radixtarget-2.0.0.48.tar.gz
Algorithm Hash digest
SHA256 54b9320611d333ed4e8cac107c2e973e8a12f9342e663a90bcd653a3e0bc8fd8
MD5 b75dcf3ad866b20e89fba9c879d035e2
BLAKE2b-256 02857b30613112c1ce093ff00d2502e52f14df491c75cc429e366bd8bb56a142

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for radixtarget-2.0.0.48-py3-none-any.whl
Algorithm Hash digest
SHA256 7b42de779f307436f725fef45028ac335336febc6ce12214b20ba78da47c0593
MD5 b69419b3c050126db6b7f7155209f300
BLAKE2b-256 39c554eeece68c37f68cf6e12327f6de15397a8c0ac80dacba909c7635e8b040

See more details on using hashes here.

Supported by

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