# 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:
```shell
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:
```shell
pip3 install -e <path to root of "src" directory>
```
---
## License
[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)
- **[MIT license](https://opensource.org/licenses/MIT)**
- Copyright 2024 © <a href="https://github.com/towalink/nfttools" target="_blank">Dirk Henrici</a>.
Raw data
{
"_id": null,
"home_page": "https://www.github.com/towalink/nfttools",
"name": "nfttools",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "nftables validation parsing",
"author": "Dirk Henrici",
"author_email": "towalink.nfttools@henrici.name",
"download_url": "https://files.pythonhosted.org/packages/76/ea/f0d495d49e9d734abdbda21731cd52fbda0bd1b4f60d6543ac6c4c65ac2b/nfttools-0.1.2.tar.gz",
"platform": null,
"description": "# NftTools\n\nHelp interacting with nftables\n\nNftTools 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.\n\n---\n\n## Features\n\n- Convert an nftables rule into its JSON representation.\n- Validate an nftables rule by temporary applying it in a helper chain.\n- Convert simple rules into a dictionary representation.\n- Convert that dictionary representation into an nftables rule.\n- Supports IPv4 and IPv6.\n- Provides limited support for sets.\n\n---\n\n## Installation\n\nInstall using PyPi:\n\n```shell\npip3 install nfttools\n```\n\nNote: 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.\n\n---\n\n## Reporting bugs\n\nIn case you encounter any bugs, please report the expected behavior and the actual behavior so that the issue can be reproduced and fixed.\n\n---\n## Developers\n\n### Clone repository\n\nClone this repo to your local machine using `https://github.com/towalink/nfttools.git`\n\nInstall the module temporarily to make it available in your Python installation:\n```shell\npip3 install -e <path to root of \"src\" directory>\n```\n\n---\n\n## License\n\n[![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n\n- **[MIT license](https://opensource.org/licenses/MIT)**\n- Copyright 2024 \u00a9 <a href=\"https://github.com/towalink/nfttools\" target=\"_blank\">Dirk Henrici</a>.\n",
"bugtrack_url": null,
"license": null,
"summary": "help interacting with nftables",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://www.github.com/towalink/nfttools",
"PyPi": "https://pypi.org/project/nfttools/",
"Repository": "https://www.github.com/towalink/nfttools"
},
"split_keywords": [
"nftables",
"validation",
"parsing"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "da3e91b732e474dab1dce1f6bf252fdbc54de4ae7a394b7cc0c404f622b6568e",
"md5": "952b07de6f821b92edeb8d3aa368693b",
"sha256": "6e32eaf6f5ba8bb9e9802757fb87bcf83eae02ac56638f24dad60a7367a7e7a7"
},
"downloads": -1,
"filename": "nfttools-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "952b07de6f821b92edeb8d3aa368693b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6804,
"upload_time": "2024-09-17T20:06:38",
"upload_time_iso_8601": "2024-09-17T20:06:38.550624Z",
"url": "https://files.pythonhosted.org/packages/da/3e/91b732e474dab1dce1f6bf252fdbc54de4ae7a394b7cc0c404f622b6568e/nfttools-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "76eaf0d495d49e9d734abdbda21731cd52fbda0bd1b4f60d6543ac6c4c65ac2b",
"md5": "388beee764ea3b168bf24f78f0ed809d",
"sha256": "58612e0044c5198a6096e46c3eb997e51f8f2509ecfb73e4d96aed3e2692df26"
},
"downloads": -1,
"filename": "nfttools-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "388beee764ea3b168bf24f78f0ed809d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 7147,
"upload_time": "2024-09-17T20:06:40",
"upload_time_iso_8601": "2024-09-17T20:06:40.548520Z",
"url": "https://files.pythonhosted.org/packages/76/ea/f0d495d49e9d734abdbda21731cd52fbda0bd1b4f60d6543ac6c4c65ac2b/nfttools-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-17 20:06:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "towalink",
"github_project": "nfttools",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "nfttools"
}