File: example.py

package info (click to toggle)
pycfdns 3.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 196 kB
  • sloc: python: 233; makefile: 7
file content (20 lines) | stat: -rw-r--r-- 464 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""Example usage of pycfdns."""
import os
import asyncio

import aiohttp
from pycfdns import Client


async def example():
    """Example usage of pycfdns."""
    async with aiohttp.ClientSession() as client_session:
        client = Client(
            api_token=os.getenv("CF_API_TOKEN"),
            client_session=client_session,
        )
        zones = await client.list_zones()
        print(zones)


asyncio.get_event_loop().run_until_complete(example())