Skip to main content

Professional Python client for the cdmon Domains & DNS API

Project description

pycdmon

Professional Python client for cdmon Domains & DNS API.

  • Full endpoint coverage for core domain + DNS operations
  • Sync and async clients
  • Typed payload helpers
  • Clean error model (CdmonApiError, CdmonTransportError)
  • Designed for human and agent workflows

Install

pip install pycdmon

Or from source:

pip install -e .[dev]

Quickstart

from pycdmon import CdmonDomainsClient

with CdmonDomainsClient(api_key="YOUR_API_KEY") as client:
    result = client.check("example.com")
    print(result["data"]["result"]["available"])

Async usage

import asyncio
from pycdmon import AsyncCdmonDomainsClient

async def main() -> None:
    async with AsyncCdmonDomainsClient(api_key="YOUR_API_KEY") as client:
        print(await client.check("example.com"))

asyncio.run(main())

CLI (cdmon)

After installation, a cdmon command is available:

export CDMON_API_KEY="your_api_key"
cdmon check example.com
cdmon info example.com
cdmon authcode example.com
cdmon renew example.com --period 1
cdmon transfer example.com 'AUTH-CODE'
cdmon dns-records example.com
cdmon dns-create example.com --host @ --type A --destination 1.2.3.4 --ttl 900
cdmon dns-delete example.com --host @ --type A
cdmon price com create
cdmon periods com renew
cdmon balance
cdmon status check

You can also pass the key inline:

cdmon --api-key "$CDMON_API_KEY" check example.com

Supported operations

  • Endpoint status: status
  • Domains: check, info, authcode, list_domains, register, renew, transfer, restore
  • Domain options: set_block, set_whois_private, set_dnssec, modify_contact
  • DNS: set_nameservers, get_dns_records, create_dns_record, edit_dns_record, delete_dns_record, send_dns_key
  • Billing/meta: get_price, get_periods, balance
  • Auto-renewal: get_autorenewal, manage_autorenewal

Error handling

from pycdmon import CdmonApiError, CdmonDomainsClient

try:
    with CdmonDomainsClient(api_key="...") as client:
        client.transfer("example.com", "wrong-authcode")
except CdmonApiError as exc:
    print(exc.status_code, exc.message)
    print(exc.payload)

Agent-friendly repo workflow

This repository is structured to be easy for coding agents:

  • src/ strict package layout
  • tests/ isolated, deterministic HTTP tests
  • examples/ runnable snippets
  • docs/ implementation and API notes
  • CI with lint + tests

Suggested autonomous loop for agents:

  1. Add/update behavior in src/pycdmon
  2. Add/adjust tests in tests/
  3. Run ruff check . && pytest
  4. Keep commits small and descriptive

Releases

This repository supports automatic releases from main using Python Semantic Release and Conventional Commits.

Why this approach

This is a Python package, so the release automation is now Python-native:

  • no package.json
  • no Node-based semantic-release
  • versioning is configured in pyproject.toml
  • the workflow uses python-semantic-release, build, and optional twine

Conventional Commits are still used, but they are only the input convention for deciding the version bump. They do not imply a Node/npm release stack.

How it works

  • merge changes into main
  • GitHub Actions runs validation (ruff check . and pytest)
  • python-semantic-release inspects commit messages since the last tag
  • if a release is warranted, it will:
    • determine the next version
    • update pyproject.toml
    • create the release commit and tag
    • publish the GitHub Release
  • if PYPI_TOKEN is defined in repository secrets, the workflow also publishes to PyPI
  • if PYPI_TOKEN is not defined but PYPI_MASTER_TOKEN exists, the workflow falls back to that token for PyPI publication

Commit conventions

Use Conventional Commits so release automation can infer version bumps:

  • fix: -> patch release
  • feat: -> minor release
  • feat!: or any commit with BREAKING CHANGE: -> major release
  • docs:, test:, chore: -> no release by default

Example:

git commit -m "fix: handle TXT DNS records with value field"

Notes

  • The release workflow only runs on pushes to main.
  • The repository must allow GitHub Actions to push release commits and tags using GITHUB_TOKEN.
  • If branch protection is strict, make sure it still permits the release workflow to push the generated release commit.
  • If neither PYPI_TOKEN nor PYPI_MASTER_TOKEN is present, the workflow still creates the Git tag and GitHub Release and skips the PyPI upload.

API reference source

Based on cdmon official API docs: https://apidedominioscat.docs.apiary.io/#introduction/endpoints-disponibles

License

MIT

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

pycdmon-1.0.0.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycdmon-1.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file pycdmon-1.0.0.tar.gz.

File metadata

  • Download URL: pycdmon-1.0.0.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for pycdmon-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e411aad391316e146da28849ddd6bc75428263a242a94fb529d65f6aed811abb
MD5 a5f12857b7b2bf2e15bea14dea746759
BLAKE2b-256 bdee5463bd0c4191922fd8b768a25bcb8b5cbc66a6774e87042c0d9f8b29ed68

See more details on using hashes here.

File details

Details for the file pycdmon-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pycdmon-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for pycdmon-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3abd83b15d370596409700d886cf56365d126836e74d7523e59b51a5fa78107
MD5 e9a63467ac24aef310cd1fb59a85e024
BLAKE2b-256 31abaa75b84a75d05affd398c92bd78a5ad80276a16746d02a778d5e422f01cd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page