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:
    • BBOT
    • cloudcheck Written in pure python and capable of roughly 100,000 lookups per second regardless of database size, it's perfect for production .

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

Uploaded Source

Built Distribution

radixtarget-2.0.0.39-py3-none-any.whl (104.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: radixtarget-2.0.0.39.tar.gz
  • Upload date:
  • Size: 103.8 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.39.tar.gz
Algorithm Hash digest
SHA256 07b323539076ac77fa9c68a8f18557336e9c7271a4bdee5a8451ce773fbf547c
MD5 dbdad4a18b6e6d1fdb808a6b2c663c19
BLAKE2b-256 3aac54d3fbbac0d7c7b9ec6a0cbbd02d77750d36d821700c4c78ad59ab01772e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for radixtarget-2.0.0.39-py3-none-any.whl
Algorithm Hash digest
SHA256 c10b7e088fa97837c659824c627f68f4d75acb4f194ff54f4c10937175c8654c
MD5 386918662b4f17b4198fc87212928abe
BLAKE2b-256 ba918575e01960eb1c9ba7c71a6db24d984dfd5982d52fa461ff7f2bad9cfe07

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