help interacting with nftables
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nfttools-0.1.2.tar.gz
.
File metadata
- Download URL: nfttools-0.1.2.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58612e0044c5198a6096e46c3eb997e51f8f2509ecfb73e4d96aed3e2692df26 |
|
MD5 | 388beee764ea3b168bf24f78f0ed809d |
|
BLAKE2b-256 | 76eaf0d495d49e9d734abdbda21731cd52fbda0bd1b4f60d6543ac6c4c65ac2b |
File details
Details for the file nfttools-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: nfttools-0.1.2-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e32eaf6f5ba8bb9e9802757fb87bcf83eae02ac56638f24dad60a7367a7e7a7 |
|
MD5 | 952b07de6f821b92edeb8d3aa368693b |
|
BLAKE2b-256 | da3e91b732e474dab1dce1f6bf252fdbc54de4ae7a394b7cc0c404f622b6568e |