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.0.0.16.tar.gz (98.7 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.0.0.16-py3-none-any.whl (98.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for radixtarget-1.0.0.16.tar.gz
Algorithm Hash digest
SHA256 922cb70a10f25def1897211e57698ff82b5cfaee2c03a7583101e96e0145905d
MD5 2008db41de714f9979acbff4f1e09e8b
BLAKE2b-256 d3a5de202d247b9bcd9e82802f6d5b84a0ddf270744931a8572ceed192495578

See more details on using hashes here.

File details

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

File metadata

  • Download URL: radixtarget-1.0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 98.8 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.0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 d99e7a2291ef427dc1ec9d4a953a4cd23e43c8925c501a52a49d675d7c3b7609
MD5 f710ae52a9a0ea5757dfbefac3785dfa
BLAKE2b-256 88d32f02bf27be89e8d2e91890939cb5e8392170034d138e6bc001fd4ea1db9c

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