Skip to content

Getting Started

Installation

Install cacholong-cloud-cli from PyPI:

bash
pip install cacholong-cloud-cli

The SDK (cacholong_sdk) is included in this package and can be imported directly.

Obtaining an API Key

Generate an API token in the Cacholong control panel at cp.cacholong.eu under your profile settings → API.

Connecting to the API

The SDK communicates with the Cacholong API at https://api.cacholong.eu/api/v1/. Pass your API key as the second argument to connection:

python
import asyncio
from cacholong_sdk import connection, DnsZone

async def main():
    async with connection("https://api.cacholong.eu/api/v1/", "YOUR-API-KEY") as api:
        ctrl = DnsZone(api)
        async for zone in ctrl.fetch_all():
            print(zone["domain"])

asyncio.run(main())

connection is an async context manager. The HTTP session is opened on entry and closed on exit.