{"id":15705821,"url":"https://github.com/ludeeus/pycfdns","last_synced_at":"2025-05-06T21:07:58.678Z","repository":{"id":32458316,"uuid":"134461669","full_name":"ludeeus/pycfdns","owner":"ludeeus","description":"Update Cloudflare DNS records.","archived":false,"fork":false,"pushed_at":"2023-11-03T21:09:26.000Z","size":89,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T21:07:48.952Z","etag":null,"topics":["cloudflare","cloudflare-api","dns","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pycfdns/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ludeeus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-22T18:53:42.000Z","updated_at":"2024-08-19T17:28:43.000Z","dependencies_parsed_at":"2024-06-21T14:10:45.549Z","dependency_job_id":"3e2d1bc7-513a-42bb-b9e6-94af759f0fcc","html_url":"https://github.com/ludeeus/pycfdns","commit_stats":{"total_commits":45,"total_committers":6,"mean_commits":7.5,"dds":0.4222222222222223,"last_synced_commit":"bfb4924817364c11426c7ba196bfc7d12b485e8d"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ludeeus%2Fpycfdns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ludeeus%2Fpycfdns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ludeeus%2Fpycfdns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ludeeus%2Fpycfdns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ludeeus","download_url":"https://codeload.github.com/ludeeus/pycfdns/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252769420,"owners_count":21801378,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare","cloudflare-api","dns","python"],"created_at":"2024-10-03T20:20:25.746Z","updated_at":"2025-05-06T21:07:58.660Z","avatar_url":"https://github.com/ludeeus.png","language":"Python","readme":"# Manage DNS Records hosted by Cloudflare\n\n_[Cloudflare] DNS API Python Wrapper._\n\n## Quick start\n\n### Installation\n\n```bash\npython3 -m pip install pycfdns\n```\n\n### Example usage\n\n```python\n...\nimport aiohttp\nfrom pycfdns import Client\n...\n    async with aiohttp.ClientSession() as client_session:\n        client = Client(api_token=\"abc123\", client_session=client_session)\n        zones = await client.list_zones()\n        print(zones)\n...\n```\n\n## API\n\nBelow is a quick overview of the classes and methods that are available in this package.\n\nThis package uses [`mypy`] to ensure it is strictly typed, and all API modesl are created as [`TypedDict`] objects.\n\nAnything that is not exported in the base of the module (in the [`__init__.py`](pycfdns/__init__.py) file) are considered internal to this package and will change wihtout any notice, yoo should consider not using anything not found there.\n\n### Client\n\nThe [`Client` class][Client] is your entrypoint to this package, this is what's providing the methods described below.\n\nThis method accepts the folowing arguments:\n\nArgument | Type | Description\n--|--|--\n`api_token` | `str` | This is your personal API token to interface with the [Cloudflare API], you can generate this token here: \u003chttps://developers.cloudflare.com/api/tokens/create\u003e\n`client_session` | `ClientSession` | This neesd to be an instance of `ClientSession` from the [`aiohttp`] pacakge.\n`timeout` | `int \\| None` | This determines how long an API call can use (in seconds) before it times out, the default is `10` seconds.\n\n#### List Zones\n\nThe [`Client.list_zones` method][list_zones_method] can be used to list all zones available with the `api_token` passed to the [`Client` object][Client].\n\nThis method takes no arguments.\n\n```python\n...\nclient = Client(session=session, api_token=\"abc123\")\nzones = await client.list_zones()\n...\n```\n\nThe `zones` variable in this example will be a list of [`ZoneModel` objects][ZoneModel].\n\n#### List Records\n\nThe [`Client.list_dns_records` method][list_dns_records_method] can be used to list all records within a zone.\n\nThis method accepts the folowing arguments:\n\nArgument | Type | Description\n--|--|--\n`zone_id` | `str` | The ID of the zone to list records for.\n`name` | `str \\| None` | If this is passed in it will only match record matching the name.\n`type` | `str \\| None` | If this is passed in it will only match record matching the type.\n\n\n```python\n...\nclient = Client(api_token=\"abc123\", client_session=client_session)\nrecords = await client.list_dns_records()\n...\n```\n\nThe `records` variable in this example will be a list of [`RecordModel` objects][RecordModel].\n\n#### Update Record\n\nThe [`Client.update_dns_record` method][update_dns_record_method] can be used to update a record in a zone.\n\nThis method accepts the folowing arguments:\n\nArgument | Type| Description\n--|--|--\n`zone_id` | `str` | The ID of the zone the record exist in.\n`record_id` | `str` | The ID of the record to list records for.\n`record_name` | `str` | The name of the record.\n`record_type` | `str` | The type of the record.\n`record_content` | `str` | The content of the record.\n`record_comment` | `str \\| None` | The comment of the record.\n`record_proxied` | `bool \\| None` | The proxied state of the record.\n`record_tags` | `list[str] \\| None` | The tags of the record.\n`record_ttl` | `int \\| None` | The TTL value of the record.\n\n```python\n...\nclient = Client(api_token=\"abc123\", client_session=client_session)\nrecord = await client.update_dns_record(zone_id=\"abc123\", record_id=\"abc123\", record_name=\"abc\", record_content=\"1.1.1.1\", record_type=\"A\")\n...\n```\n\nThe `record` variable in this example will be a [`RecordModel` object][RecordModel] representing the updated record.\n\n\n### Exceptions\n\nThis package have 2 defined exceptions:\n\n- [`AuthenticationException`], this will be raised when the Cloudflare API returns a status code assosiated with authentication issues.\n- [`ComunicationException`], this will be raised when there are issues communicating with the [Cloudflare API].\n\n\n## Versioning\n\nThis package follows the [SemVer] framework to determine how to set the version.\n\n## Publishing\n\nThis package is published to [PyPI] when a new [GitHub] release is made.\n\nThe publishing itself is handled in [GitHub actions] with [this workflow][release_workflow].\n\n[A history of release actions can be found here][release_history].\n\nThere is no fixed schedule for when a new version is published.\n\n\n## Disclaimer\n\n_This Python wrapper for the Cloudflare API is an independent project and is not endorsed, sponsored, or affiliated with Cloudflare, Inc. The use of Cloudflare's name, trademarks, and other intellectual property is for descriptive purposes only. All rights to Cloudflare's name, trademarks, and other intellectual property belong to Cloudflare, Inc. Use this wrapper at your own risk and ensure that you abide by Cloudflare's terms of service and API usage guidelines._\n\n\u003c!-- Links --\u003e\n[Cloudflare]: https://www.cloudflare.com/\n[Cloudflare API]: https://developers.cloudflare.com/api/\n[`mypy`]: https://www.mypy-lang.org/\n[`aiohttp`]: https://docs.aiohttp.org/en/stable/\n[`TypedDict`]: https://peps.python.org/pep-0589/\n[SemVer]: https://semver.org/\n[PyPi]: https://pypi.org/project/pycfdns/\n[GitHub]: https://github.com/\n[GitHub actions]: https://github.com/features/actions\n\n[release_workflow]: https://github.com/ludeeus/pycfdns/blob/main/.github/workflows/publish.yml\n[release_history]: https://github.com/ludeeus/pycfdns/actions/workflows/publish.yml\n\n[Client]: https://github.com/search?q=repo%3Aludeeus%2Fpycfdns+symbol%3AClient+path%3Apycfdns%2Fclient.py\u0026type=code\n[list_zones_method]: https://github.com/search?q=repo%3Aludeeus%2Fpycfdns+symbol%3Alist_zones+path%3Apycfdns%2Fclient.py\u0026type=code\n[list_dns_records_method]: https://github.com/search?q=repo%3Aludeeus%2Fpycfdns+symbol%3Alist_dns_records+path%3Apycfdns%2Fclient.py\u0026type=code\n[update_dns_record_method]: https://github.com/search?q=repo%3Aludeeus%2Fpycfdns+symbol%3Aupdate_dns_record+path%3Apycfdns%2Fclient.py\u0026type=code\n\n[`AuthenticationException`]: https://github.com/search?q=repo%3Aludeeus%2Fpycfdns+symbol%3AAuthenticationException+path%3Apycfdns%2Fexceptions.py\u0026type=code\n[`ComunicationException`]: https://github.com/search?q=repo%3Aludeeus%2Fpycfdns+symbol%3AComunicationException+path%3Apycfdns%2Fexceptions.py\u0026type=code\n\n[ZoneModel]: https://github.com/search?q=repo%3Aludeeus%2Fpycfdns+symbol%3AZoneModel+path%3Apycfdns%2Fmodels.py\u0026type=code\n[RecordModel]: https://github.com/search?q=repo%3Aludeeus%2Fpycfdns+symbol%3ARecordModel+path%3Apycfdns%2Fmodels.py\u0026type=code","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fludeeus%2Fpycfdns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fludeeus%2Fpycfdns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fludeeus%2Fpycfdns/lists"}