Skip to main content

Python client for CloudFlare.

Project description

Build Status

A Python client for CloudFlare API v4 and Host API.

It provides two levels of integration against the CloudFlare API:

  1. A low level API, with one method per API endpoint (pycloudflare.services).

  2. A high level ORM API (pycloudflare.models).

Only a subset of the CloudFlare API is currently supported:

  • Users

  • Zones

  • Zone Settings

  • DNS Records

  • Page Rules

  • User creation & authentication through CloudFlare’s partner-facing Host API.

Usage

Get all our zones at CloudFlare

>>> cf = CloudFlareService()
>>> for domain in cf.get_zones():
>>>     print domain['name'], domain['id']

Configuration

The Host (Partner) API service client is configured when it is instantiated and reads its configuration from configuration.json.

The configuration file should be in the format:

{
    "common": {
        "cloudflare": {
            "api_key": "HOST API KEY HERE",
         }
    }
}

Testing

Install development requirements:

pip install -r requirements.txt

Tests can then be run by doing:

nosetests

The integration tests require a host API key. They can be run with:

nosetests tests/test_integration.py

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

pycloudflare-0.4.1.tar.gz (14.2 kB view details)

Uploaded Source

File details

Details for the file pycloudflare-0.4.1.tar.gz.

File metadata

File hashes

Hashes for pycloudflare-0.4.1.tar.gz
Algorithm Hash digest
SHA256 b2d522ce8823578f37b29e83fe627b1667e37e090bef97a70591369bf954e277
MD5 79b6706d4927ea9db3120fa45e9a237c
BLAKE2b-256 54cafff5a849903ce03a0d409d54185d79a12c54e066e03df2b9f7c72e8b123d

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