Convert Kea DHCP leases to JSON format
Project description
Kea Leases to JSON
A Python tool to convert ISC Kea DHCP leases files to JSON format.
Supports both IPv4 and IPv6 leases. Includes a directory watcher for real-time conversion.
Features
- Converts Kea leases CSV files to JSON
- Handles both IPv4 and IPv6 addresses
- Watches a directory for changes and updates the JSON output automatically
- Command-line interface
Installation
You can install the latest release from PyPI:
pip install kea-leases-to-json
Or, to install from source:
git clone https://github.com/yourusername/kea-leases-to-json.git
cd kea-leases-to-json
pip install .
Usage
After installation, you can use the command-line tool:
kea-leases-to-json /path/to/kea/leases/dir /path/to/output.json
Options
source_dir(required): Directory containing Kea lease CSV filestarget_file(required): Output JSON file path--extension: File extension to look for (default:.csv)--log-level: Logging level - choices: DEBUG, INFO, WARNING, ERROR, CRITICAL (default: INFO)--single-run: Run once and exit, useful for testing. By default, the script starts a watcher for any file changes--daemonize: Run the process as a daemon in the background (only works when not in single-run mode)--pid: PID file path for the daemon process (default:/var/run/kea_leases_to_json.pid)
Example
kea-leases-to-json \
./leases \
./leases.json \
--extension .csv \
--log-level DEBUG \
--single-run
CI & Test Coverage
The test suite is run automatically on every push and pull request using GitHub Actions. Coverage results are uploaded to Codecov and displayed above.
To run tests and check coverage locally:
pytest --cov=kea_leases_to_json --cov-report=term
License
This project is licensed under the GNU GPL v3.
Contributing
Pull requests
Project details
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kea_leases_to_json-0.1.3.tar.gz.
File metadata
- Download URL: kea_leases_to_json-0.1.3.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8ad0007d867d0c93466dda74e2022798b411e4ca5a274f17842175903b13140
|
|
| MD5 |
a49e96152c9338464f7a7fa59876118c
|
|
| BLAKE2b-256 |
fb4437cf63080d19efcadec19cfae5c4393211fb840395fe4fa13b3f45a312f0
|
Provenance
The following attestation bundles were made for kea_leases_to_json-0.1.3.tar.gz:
Publisher:
publish.yml on cjuniorfox/kea-leases-to-json
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kea_leases_to_json-0.1.3.tar.gz -
Subject digest:
f8ad0007d867d0c93466dda74e2022798b411e4ca5a274f17842175903b13140 - Sigstore transparency entry: 705352110
- Sigstore integration time:
-
Permalink:
cjuniorfox/kea-leases-to-json@45e393b12e36adf157b87d30e7dd34950564dbcb -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/cjuniorfox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@45e393b12e36adf157b87d30e7dd34950564dbcb -
Trigger Event:
release
-
Statement type:
File details
Details for the file kea_leases_to_json-0.1.3-py3-none-any.whl.
File metadata
- Download URL: kea_leases_to_json-0.1.3-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f476f6ad25cddea7851eea2ffc49f45dd426c5a81b3c61076e3c32b9a56d8153
|
|
| MD5 |
37fc3e591368b726b4a246e23ac5900e
|
|
| BLAKE2b-256 |
5b0c6d44b5ff15c0b770429ecdb24e0cf1c04daeeb039972614ce2af5b5374fb
|
Provenance
The following attestation bundles were made for kea_leases_to_json-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on cjuniorfox/kea-leases-to-json
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kea_leases_to_json-0.1.3-py3-none-any.whl -
Subject digest:
f476f6ad25cddea7851eea2ffc49f45dd426c5a81b3c61076e3c32b9a56d8153 - Sigstore transparency entry: 705352124
- Sigstore integration time:
-
Permalink:
cjuniorfox/kea-leases-to-json@45e393b12e36adf157b87d30e7dd34950564dbcb -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/cjuniorfox
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@45e393b12e36adf157b87d30e7dd34950564dbcb -
Trigger Event:
release
-
Statement type: