Skip to main content

Update Cloudflare DNS A-records.

Project description

Update CloudFlare DNS A records.

Update A 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)


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

Uploaded Source

Built Distribution

pycfdns-1.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycfdns-1.1.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for pycfdns-1.1.1.tar.gz
Algorithm Hash digest
SHA256 02228499f5500b7d805906ddbc848880739ceebb2b25b70b9c1a9a6fcf1881d8
MD5 966e141de596a181b80cc151f1fe05d0
BLAKE2b-256 cb62b4bb70936b66d77bfcf2640b9f546d2eb247a4d44f44a4c6d268d3f0a7b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycfdns-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for pycfdns-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 616d07f9130f65fa3fdbba6020859907432d8a74e6e1796c36a0d1833701907b
MD5 366b8ada9d7f3fd831934e97019b45d9
BLAKE2b-256 ccd412d5e6168743b4fb7e8a7f40a6874d35b0f8c090217e3cb0213f6157d821

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