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 you need to have Cloudlfare API KEY with Zone and Account Read Analytics, also DNS Record Read
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
File details
Details for the file cfmetrics-0.2.0.tar.gz.
File metadata
- Download URL: cfmetrics-0.2.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c319de7fe3aece2aa5a457fc6980126e1dba29bdef56d53980c1d84f992fb447
|
|
| MD5 |
ee6389aaa7d46da1aaba422bbed35a1f
|
|
| BLAKE2b-256 |
81e97a15b8676cbc4dc0e7f1130e49e71c52d934a10c1c2c5bc4fd1157804f6d
|