Metadata-Version: 2.4
Name: opynsense
Version: 0.1.4
Summary: A Python library for interacting with OpnSense router OS through the REST API
License: GPL-3.0
License-File: LICENSE
Author: Oliver Galbraith
Author-email: olivergalbraith0@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: restpylot (>=0.1.1,<0.2.0)
Project-URL: Documentation, https://github.com/ollie-galbraith/opynsense
Project-URL: Homepage, https://github.com/ollie-galbraith/opynsense
Project-URL: Repository, https://github.com/ollie-galbraith/opynsense
Description-Content-Type: text/markdown

# OpynSense

OpynSense is a Python client library for interacting with the OpnSense router API, providing convenient access to DHCP and lease management via Kea. It is designed for automation and integration with network infrastructure in homelab or enterprise environments.

## Features

- Authenticate and manage sessions with OpnSense
- Retrieve DHCPv4 configuration and reservations
- Search and filter DHCP leases by interface description
- Extensible for additional OpnSense API endpoints

## Installation

Install via pip (after packaging):

```bash
pip install opynsense
```

## Usage

```python
from opynsense.main import OpnSense

# Initialize client
opnsense = OpnSense(auth='your_auth_token', base_url='https://your-opnsense/api')

# Access Kea DHCPv4 configuration
dhcp = opnsense.KeaDHCPv4()
config = dhcp.get()

# Access DHCP reservations
reservations = dhcp.Reservation().get()

# Search DHCP reservations
search_results = dhcp.Reservation().search()

# Access and search DHCP leases
leases = opnsense.KeaLeasev4().search(interface_description='LAN')
```

## Project Structure

- `src/opynsense/main.py`: Main OpnSense client class
- `src/opynsense/classes/kea.py`: Kea DHCP and lease management classes
- `tests/`: Unit tests

## License

See [LICENSE](LICENSE) for details.

