Update Cloudflare DNS A-records.
Project description
Update CloudFlare DNS records.
Update records in your DNS zone.
Install
python3 -m pip install pycfdns
Example
"""Example usage of pycfdns."""
import asyncio
import aiohttp
from pycfdns import CloudflareUpdater
API_TOKEN = "5cdba21d55cdba21d55cdba21d5"
ZONE = "example.com"
UPDATE_RECORDS = ["test"]
async def example():
"""Example usage of pycfdns."""
async with aiohttp.ClientSession() as session:
cfupdate = CloudflareUpdater(session, API_TOKEN, ZONE, UPDATE_RECORDS)
zone_id = await cfupdate.get_zone_id()
records = await cfupdate.get_record_info(zone_id)
for record in records:
print(record.record_name)
await cfupdate.update_records(zone_id, records, "127.0.0.1")
asyncio.get_event_loop().run_until_complete(example())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pycfdns-2.0.0.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file pycfdns-2.0.0.tar.gz
.
File metadata
- Download URL: pycfdns-2.0.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | efa28c3e76492a543e87fa92281502aedbba2414365ab82aa677da0b8dcf6217 |
|
MD5 | 44ce6fb6e9c90bd4cf7ef35d0beef0ec |
|
BLAKE2b-256 | e9d6426de21acbb2068d6a3e980f9eb8b9f68bc4e58f764900a5e19acc12aa4e |
File details
Details for the file pycfdns-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: pycfdns-2.0.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c56476dd23f88b23a243a652eb5d4abd1ae82793a8cfc33252d30ccfabad3384 |
|
MD5 | 87a6cb64edbdcf0bdcc124e2a8ea1957 |
|
BLAKE2b-256 | 114e17928186ad3d07e434e766ef7a4f1b3af5888b0d888e8bc3dd3b0ce7baa2 |