cflare [WIP]
Pythonic Cloudflare Ops
Making Cloudflare a little easier to work with in Python
Most Objects returned from the API are Dataclass Objects, allowing easier manipulation and accessing properties.
Installation
Dependencies: requests, typer, dataclasses-json
pip install --upgrade cflare
Environment Variables
Authentication
- API User:
CFLARE_USER,CLOUDFLARE_USER - API Key:
CFLARE_KEY,CLOUDFLARE_KEY - API Token:
CFLARE_TOKEN,CLOUDFLARE_TOKEN
Records Important Note: Content takes priority over IP Address due to how default value is created.
- Domain Name:
CFLARE_DOMAIN,CLOUDFLARE_DOMAIN - Subdomain Name:
CFLARE_SUBDOMAIN,CLOUDFLARE_SUBDOMAIN - Record Type:
CFLARE_RECORD,CLOUDFLARE_RECORD,[Default = 'A'] - IP Address:
CFLARE_ADDRESS,CLOUDFLARE_ADDRESS,[Default = Host IP Address] - Content:
CFLARE_CONTENT,CLOUDFLARE_CONTENT - TTL:
CFLARE_TTL,CLOUDFLARE_TTL,[Default = 1 or Auto] - Proxied:
CFLARE_PROXIED,CLOUDFLARE_PROXIED,[Default = False]
Quick Start CLI
cflare auth --email user@email.com --key supersecureapikey
# This will sync the Host VM's Public IP Address to A Record app.mydomain.com = 123.123.123 [VM Public IP]
cflare sync --domain mydomain.com --subdomain app
Quick Start API
from cflare import CFlareAPI, CFlareAuth, save_config
# Auth: Optional.
## Save Auth Explicitly. Will be reloaded next time around.
auth = CFlareAuth(api_user='', api_key='')
save_config(auth.data)
## Pass Auth to the API Explicitly
cfapi = CFlareAPI(auth)
# Or skip the above steps and have it be picked up from environment variables
cfapi = CFlareAPI()
domains = cfapi.all_domains
# ['domain1.com', 'domain2.com'...]
# Pass params explicitly
res = cfapi.sync(domain='', subdomain='', **config)
# Or call and have it be picked up by environment variables
res = cfapi.sync()
Metadata
Release files for cflare 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cflare-0.0.2.tar.gz | 9.3 kB | Without provenance | Details for cflare-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cflare-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for cflare-0.0.2-py3-none-any.whl |
Total release size: 19.2 kB
Release files / cflare-0.0.2.tar.gz
| Download URL | cflare-0.0.2.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ff3ab1c30206947df8b97f9165e9690717c3f6979ebba8d9d338d7500a581e4
|
|
BLAKE2b-256 checksum How to use checksums |
1d719902ae04a33ad8a3524d5d3a4f103f08894617b625cebdc2263e468366f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.10
|
Release files / cflare-0.0.2-py3-none-any.whl
| Download URL | cflare-0.0.2-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7bfaf1332b8fae40badae3d3abc520c2638f706ad9dcdf92e35d3694cf53a54
|
|
BLAKE2b-256 checksum How to use checksums |
2ee2f63a58402c4e043c98ed7fd1786812e31c1851be323b5aad68076242bf34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.10
|
Security for cflare 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.