Metadata-Version: 2.4
Name: pyctrld
Version: 0.1.1
Summary: Non-official Control D API for Python
Author-email: xenolex <alexey.belkov@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/xenolex/PyCtrlD
Project-URL: Documentation, https://github.com/xenolex/PyCtrlD#readme
Project-URL: Repository, https://github.com/xenolex/PyCtrlD
Project-URL: Bug Tracker, https://github.com/xenolex/PyCtrlD/issues
Keywords: controld,dns,api,client,privacy,ad-blocking
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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: Topic :: Internet :: Name Service (DNS)
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.11.9
Requires-Dist: requests>=2.32.5
Requires-Dist: backports.strenum>=1.0.0; python_version < "3.11"
Dynamic: license-file

# PyCtrlD

[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A unofficial Python client library for the [Control D](https://controld.com/) API.

## What not supported?

Organizations endpoint and features are not tested and may not work as expected.

## Installation

```bash
pip install pyctrld
```

Or with [uv](https://github.com/astral-sh/uv):

```bash
uv add pyctrld
```

## Quick Start

```python
from pyctrld import ControlDApi

# Initialize the API client
api = ControlDApi(token="your_api_token_here")

# List all devices
devices = api.devices.list_all_devices()
for device in devices:
    print(f"Device: {device.name} - {device.status}")

# Get account information
account = api.accounts.fetch()
print(f"Account: {account.email}")

# List all profiles
profiles = api.profiles.profiles.list()
for profile in profiles:
    print(f"Profile: {profile.name}")

# Create a new device
from pyctrld import CreateDeviceFormData

new_device = api.devices.create(
    data=CreateDeviceFormData(
        name="My DNS Device",
        icon="router",
        profile_id="PK123456"
    )
)
print(f"Created device with ID: {new_device.device_id}")
```

## Disclaimer

This is an **unofficial** library and is not affiliated with, officially maintained by, or endorsed by Control D. Use at your own risk.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Links

- [Control D Website](https://controld.com/)
- [Control D API Documentation](https://docs.controld.com/reference/get-started)
- [PyCtrlD GitHub Repository](https://github.com/xenolex/PyCtrlD)

## Support

If you encounter any issues or have questions:

1. Check the [GitHub Issues](https://github.com/xenolex/PyCtrlD/issues)
2. Review the [Control D API Documentation](https://docs.controld.com/reference/get-started)
3. Open a new issue with detailed information about your problem
