NftTools
Help interacting with nftables
NftTools provides helpers to work with nftables from Python. It builds on python-nftables which itself uses libnftables. Note that the API is not yet stable and can change from one version to the next.
Features
- Convert an nftables rule into its JSON representation.
- Validate an nftables rule by temporary applying it in a helper chain.
- Convert simple rules into a dictionary representation.
- Convert that dictionary representation into an nftables rule.
- Supports IPv4 and IPv6.
- Provides limited support for sets.
Installation
Install using PyPi:
pip3 install nfttools
Note: The tool uses python3-nftables as dependency. If you don't use Debian's operating system package (or Alpine's py3-nftables) but attempt to install pip-nftables instead, the latter might complain on missing "schema.json". Workaround: Use the operating system package or copy it's "schema.json" to the place pip-nftables is looking for that file.
Reporting bugs
In case you encounter any bugs, please report the expected behavior and the actual behavior so that the issue can be reproduced and fixed.
Developers
Clone repository
Clone this repo to your local machine using https://github.com/towalink/nfttools.git
Install the module temporarily to make it available in your Python installation:
pip3 install -e <path to root of "src" directory>
License
- MIT license
- Copyright 2024 © Dirk Henrici.
Metadata
Release files for nfttools 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| nfttools-0.1.2.tar.gz | 7.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nfttools-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.0 kB
Release files / nfttools-0.1.2.tar.gz
| Download URL | nfttools-0.1.2.tar.gz |
|---|---|
| Size | 7.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
58612e0044c5198a6096e46c3eb997e51f8f2509ecfb73e4d96aed3e2692df26
|
|
BLAKE2b-256 checksum How to use checksums |
76eaf0d495d49e9d734abdbda21731cd52fbda0bd1b4f60d6543ac6c4c65ac2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Release files / nfttools-0.1.2-py3-none-any.whl
| Download URL | nfttools-0.1.2-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e32eaf6f5ba8bb9e9802757fb87bcf83eae02ac56638f24dad60a7367a7e7a7
|
|
BLAKE2b-256 checksum How to use checksums |
da3e91b732e474dab1dce1f6bf252fdbc54de4ae7a394b7cc0c404f622b6568e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.3
|
Security for nfttools 0.1.2
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.