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
- Fork the repo
- Create a feature branch (
git checkout -b feature/foo) - Commit your changes (
git commit -am 'Add foo feature') - Push to the branch (
git push origin feature/foo) - 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)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| simple_ip_tools-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
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
|