Metadata-Version: 2.4
Name: pydhcp
Version: 0.2.1rc1
Summary: A Python DHCP library and server implementation
Project-URL: Homepage, https://github.com/jose-pr/pydhcp/
Project-URL: Documentation, https://jose-pr.github.io/pydhcp/
Project-URL: Issues, https://github.com/jose-pr/pydhcp/issues
Author: jose-pr
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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: Typing :: Typed
Requires-Python: >=3.9
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: hatchling; extra == 'dev'
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pip-audit; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs; extra == 'docs'
Requires-Dist: mkdocs-material; extra == 'docs'
Requires-Dist: mkdocstrings[python]; extra == 'docs'
Description-Content-Type: text/markdown

# pydhcp

[![Version](https://img.shields.io/pypi/v/pydhcp.svg)](https://pypi.org/project/pydhcp/)
[![Python versions](https://img.shields.io/pypi/pyversions/pydhcp.svg)](https://pypi.org/project/pydhcp/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://jose-pr.github.io/pydhcp/)

A Python DHCP library and server implementation.

## Features

- **DHCP Packet Parsing** — Full support for parsing and constructing DHCP packets.
- **DHCP Server** — Highly customizable and async-friendly DHCP server.

## Installation

```bash
pip install pydhcp
```

## Quick start

### Synchronous Server
```python
from pydhcp.server import DhcpServer

server = DhcpServer()
server.listen()
```

### Asynchronous Server
```python
import asyncio
from pydhcp.server import AsyncDhcpServer

async def main():
    server = AsyncDhcpServer()
    await server.start()
    # Keep running or handle other async tasks
    # To stop: await server.stop()

asyncio.run(main())
```

## Command Line Interface (CLI)

`pydhcp` includes a command line interface for listing network adapters, decoding packets, running benchmarks, and starting servers.

```bash
# List all network interfaces
pydhcp interfaces

# Decode a hex-encoded DHCP packet
pydhcp packet --decode "01010600..."

# Run performance benchmarks
pydhcp bench

# Start the DHCP server from JSON or INI config
pydhcp server --config config.json

# Increase logging while debugging
pydhcp server --listen 127.0.0.1:6767 --log-level debug
```

## Development

See development notes for environment setup, dependency install, and test commands.

### Releasing

This project follows [Semantic Versioning](https://semver.org/) and keeps a
[`CHANGELOG.md`](CHANGELOG.md). Pushing a tag matching `v*` triggers the release
workflow.

### Documentation site

MkDocs builds the API reference from `docs/`, published on every release. The docs also include a "Common DHCP Options" page with typed examples.

## License

MIT — see [LICENSE](LICENSE).
