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. Written in pure python and capable of roughly 100,000 lookups per second regardless of the size of the database.

Used by:

Installation (PyPi)

pip install radixtarget

Example Usage

from radixtarget import RadixTarget

rt = RadixTarget()

# IPv4
rt.insert("192.168.1.0/24")
rt.search("192.168.1.10") # IPv4Network("192.168.1.0/24")
rt.search("192.168.2.10") # None

# ipv6
rt.insert("dead::/64")
rt.search("dead::beef") # IPv6Network("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

# Custom data nodes
rt.insert("evilcorp.co.uk", "custom_data")
rt.search("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-1.1.0.18.tar.gz (98.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

radixtarget-1.1.0.18-py3-none-any.whl (98.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for radixtarget-1.1.0.18.tar.gz
Algorithm Hash digest
SHA256 1a3306891a22f7ff2c71d6cd42202af8852cdb4fb68e9a1e9a76a3f60aa98ab6
MD5 2971388458ebd8bc54a96fd98dd31dca
BLAKE2b-256 8c1967a158229e14089efa732a8b3378331e6491b8c23873c73f0cef5763ca1c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for radixtarget-1.1.0.18-py3-none-any.whl
Algorithm Hash digest
SHA256 05e95de6afb0ee4dfa31c53bd25a34a193ae5bb46dc7624e0424bbcfed2c4cea
MD5 7adf38bc96d26e68c3e7f5d07b8ed534
BLAKE2b-256 b1bc2edf877ebf151cadf3896275925d3f5a76a2e8a4e6d6d80267f7e97abf32

See more details on using hashes here.

Supported by

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