Skip to main content

Update Cloudflare DNS 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


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.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

pycfdns-2.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file pycfdns-2.0.1.tar.gz.

File metadata

  • Download URL: pycfdns-2.0.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for pycfdns-2.0.1.tar.gz
Algorithm Hash digest
SHA256 9890e3015a68c170a8bc9ebb72265a849a24b13f623897466c2de1e93bd5e30c
MD5 0b73c6a51f002a2761a9be52c2aab27f
BLAKE2b-256 b09bda4d81868ddef77a538145773a966869d12959a242b656e186712a0c1eed

See more details on using hashes here.

File details

Details for the file pycfdns-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: pycfdns-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.0

File hashes

Hashes for pycfdns-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9051d82753fa3a00aaaaca6d8f06b5d356ecf98cfa9e91973d8fb586211d1d10
MD5 db9dbffd0b0047f986c383524357f19a
BLAKE2b-256 1db581d42d26465a455f204b5278b1d958ce80593beb231d612c8fb578415ad4

See more details on using hashes here.

Supported by

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