Skip to main content

Python client for the Cloudflare v4 API

Project description

pycf

Python client for Cloudflare API v4

Using pip

pip install cloudflare-api

Sample code can be found inside /test.py

Usage from source

git clone https://github.com/nikhiljohn10/pycf
cd pycf

Create a secret.py in the root directory with following content:

API_TOKEN = ""
ACCOUNT_ID = ""

The above variable need to be assigned with your own api token and account id from Cloudflare dashboard.

Then run the following command in terminal:

make test

Available endpoints

Worker Script

  • list - List all existing workers
  • upload - Upload a new worker with binding if given
  • download - Download an existing worker
  • delete - Delete an existing worker

Workers KV

  • list - List all existing Namespaces
  • id - Find the namespace id of the namespace
  • create - Create a new namespace
  • rename - Rename an existing namespace
  • delete - Delete an existing namespace

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

cloudflare-api-1.0.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloudflare_api-1.0.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file cloudflare-api-1.0.2.tar.gz.

File metadata

  • Download URL: cloudflare-api-1.0.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.7.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for cloudflare-api-1.0.2.tar.gz
Algorithm Hash digest
SHA256 9ff9f59bd20c540903c60a4317d1f40da4262900d068ce35ead18c55e46a760d
MD5 3ad9e84e2cd5bfc014fa5e642648a75a
BLAKE2b-256 90fd0b6f1209740a0760f4178efb754da9a3f65dd877417183b026e3d5a19e54

See more details on using hashes here.

File details

Details for the file cloudflare_api-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: cloudflare_api-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.7.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

File hashes

Hashes for cloudflare_api-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c33a5c2b3cd9d2908df4736b732f30703ed7e3732bff46bb7c5cc17bbd97ef78
MD5 8aca00934622d61a2599f510805445d1
BLAKE2b-256 27c180e922715a1e9ce545f90990048fb74fe6f349b234858601d83e083fb69a

See more details on using hashes here.

Supported by

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