Skip to main content

simple_ip_tools

A small Python library for managing IP networks using the standard ipaddress module and efficient prefix lookups with pytricia.

Features

  • Add, remove, and list IPv4/IPv6 networks
  • Fast longest‑prefix match queries
  • Simple, lightweight API

Requirements

  • Python 3.6+
  • pytricia
  • ipaddress (built‑in on Python ≥3.3; installed via requirements for older versions)

Installation

pip install -r requirements.txt

or for local development:

pip install -e .

Usage

import simple_ip_tools

simple_ip_tools.gen_db_from_maxmind_csv("ipdb.bin")
ipdb = simple_ip_tools.load_db("ipdb.bin")
simple_ip_tools.lookup_db(ipdb, "1.2.3.4")
simple_ip_tools.lookup_db(ipdb, "2a01:cb06:c200:3e51:103d:6143:42e0:3d48")

Contributing

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/foo)
  3. Commit your changes (git commit -am 'Add foo feature')
  4. Push to the branch (git push origin feature/foo)
  5. Open a pull request

License

MIT License – see LICENSE for details.

Metadata

Release files for simple-ip-tools 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for simple-ip-tools 0.2.1
File Interpreter ABI Platform Actions
simple_ip_tools-0.2.1-py3-none-any.whl Python 3 none any Details for simple_ip_tools-0.2.1-py3-none-any.whl

Release files / simple_ip_tools-0.2.1-py3-none-any.whl

Download URL simple_ip_tools-0.2.1-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bf7e8b22b796e4bcf2ea5e9ebedddde3340ca60bbb01626edc3ac4d267ffc25
BLAKE2b-256 checksum
How to use checksums
a4ca929c8a4536023ccdf29d4360f1b9d958fd0aa462b6bf5e2413e35c92ea21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for simple-ip-tools 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page