Skip to main content

Python Library for cloudflare analytics web

Project description

Cloudflare Analytics

I just effing annoyed with the metric retention in cloudflare, and the data is actually depend plan you are using, I know cloudflare have graphql so you could get all the metric all you want (within you pricing plan), but I want to make it simple, you see when you get to Web Analytics or Traffic menu in cloudpeler that the data what I want to take it, so this library is just simply imitate what the dashboard cloudpeler do.

How to Install

pip install cfmetrics

and to use

from cfmetrics import Auth

cf = Auth(CF_API_KEY, CF_API_EMAIL)
zone = cf.Account(CF_ACCOUNT_ID).Zone(CF_ZONE_ID)

# Here is the available function

# to get all A and CNAME records
getDNSRecord = zone.get_dns_records()

# Data Overview
getDataOverview = zone.get_overview()

# Domain plan
getDomainPlan = zone.get_domain_plan()

# Web Analytics 
# by default it will take 32 days ago from today
getWebAnalytics = zone.get_web_analytics()

# HTTP Traffic
# by default it will take 32 days ago from today
# This only available for Business plan
getHttpTraffics = zone.get_traffics()

License

This Project is licensed under the GNU Affero General Public License v3 (AGPL v3) See the LICENSE file for details

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

cfmetrics-0.1.4.tar.gz (7.3 kB view details)

Uploaded Source

File details

Details for the file cfmetrics-0.1.4.tar.gz.

File metadata

  • Download URL: cfmetrics-0.1.4.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for cfmetrics-0.1.4.tar.gz
Algorithm Hash digest
SHA256 157fb0e9b97a0902b54688db2343ca3955161a19f7a16dc8f323aa758a14a532
MD5 4506568fee1460771ac775ec4d167397
BLAKE2b-256 18e66b49d3f02a5597b8246b96073f54c8bc07b8fa33353ff53dd4ed3c4f6707

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