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

EMAIL = "example@example.com"
TOKEN = "5cdba21d55cdba21d55cdba21d5"
ZONE = "example.com"
UPDATE_RECORDS = ["test"]

async def example():
    """Example usage of pycfdns."""
    async with aiohttp.ClientSession() as session:
        cfupdate = CloudflareUpdater(session, EMAIL, 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-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

pycfdns-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pycfdns-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for pycfdns-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a6ecae2fd944e23d6ae855191bf3683c219b2e91642a9dfc94a849a7eced1bdf
MD5 f42ae68a4ebe39dd0b66959e96a9b082
BLAKE2b-256 55d7e1fcdc925d03b0e84bbc7e4add0676663306602fe1ca39bc9f84dbd07781

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycfdns-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for pycfdns-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38830a9aa88878389095810d3c7c1dd80bcbc60319846596d74891b84de3ebb5
MD5 7b11370488e715f5545927380e8a9bcc
BLAKE2b-256 44974201bbf4567facc90ba813265e4d75f6d15bb38a53269801a340677590e5

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