Skip to main content

Python CLI and python class for retrieving user's realtime performance statistics

Project description

cloudflarepycli

Python CLI and python class for retrieving user's realtime performance statistics.

Purpose

Retrieve near-term performance data about the service provided to a user by an ISP. The data includes up and download speeds, latency, and jitter. The CLI makes it possible to pipe the data to other processes for possible uploading, analysis etc. and/or to build a GUI for displayying current and past data. The cloudflareclass.py module is useful for varying the types of test taht are done. I will use both in future projects to expand the functionality.

Install

Type 'pip install cloudflarepycli' in the Python environment you want to use.

CLI usage

Type 'cfspeedtest' in the environment where you installed the package. Note that this is a shell command, not a Python command.

Options

-h, --help show help message and exit --debug log network io --json write json to sysout instead of fornmatted results --version show program's version number and exit

cloudflareclass usage

(WIP) For now see the source code.

Source repository

https://github.com/tevslin/cloudflarepycli

How it works

Ping tests for latency and jitter are done with Google, Cloudflare,and openDNS.

The cloudflareclass.py module makes Python requests to various subaddresses of speed.cloudflare.com. Their API is not documented, as far as I know, and so that is a vulnerability for this code. There is also a request to ipdatabase.com and the return is screen-scraped for the actual ISP name.

Mirroring the performance of the Cloudflare webpage, the CLI does multiple uploads and downloads with different block sizes and the 90th percentile of all these tests is used for calculating up and download times. Results are similar to those obtained from the webpage. Tests can be varied using the cloudflareclass module.

Unlike Ookla's speedtest CLI, Cloudflare does not require downloading a licensed exe. Cloudflare uses test sites from its own network of cacheing and hosting centers. This is useful because much of the content users would be retrieving is actually coming from these centers. On the other hand, coverage may be thin in some parts of the world.

Privacy

No identifying information is sent to any website other than the IP address which servers can see in an HTTP request. Cloudflare can propbably deduce somethiing from the tests it runs. No results are sent anywhere. Because this an application and not running in a browser, there are no cookies.

Full source is available in this package.

Background

Billions of federal dollars are being disbursed to improve broadband availability and quality, especially in rural areas. Tools are needed to assure that ISPs deliver the quality they promise. This software is a pro bono contribution to getting those tools written.

##Disclaimers

No claims of any sort are made for this software. It has been lightly tested on Windows 10 and not in other environments although it "should" be cross platform. Use and/or redistribute solely at your own risk. No commitemnt is made to maintain this software. As noted above, changes made by Clouflare or ipdatabase.com might breeak the functionality.

I have no affiliation with Cloudflare, any hosting service, or any ISP (except as a customer).

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

cloudflarepycli-0.50.7.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

cloudflarepycli-0.50.7-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file cloudflarepycli-0.50.7.tar.gz.

File metadata

  • Download URL: cloudflarepycli-0.50.7.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for cloudflarepycli-0.50.7.tar.gz
Algorithm Hash digest
SHA256 82a9b39dc84c13ba10f2138475910625cfc04f7612fd47bfb6ceaf72d1f546ca
MD5 a6aed413e52168fcdff384bdeff6e402
BLAKE2b-256 4d27a0a738b9a4f7e16dd884de7e3ebe983640a09f622828431f10edba8a2e9c

See more details on using hashes here.

File details

Details for the file cloudflarepycli-0.50.7-py3-none-any.whl.

File metadata

  • Download URL: cloudflarepycli-0.50.7-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

File hashes

Hashes for cloudflarepycli-0.50.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c7c1086f3804a339fe1f40c5de25462f15561d628ae10817179901ace7bb9b98
MD5 14c5fe47c9b238b537e13d0c61bcc571
BLAKE2b-256 2bf837e6303af098cebd92c911aeae7faffac74cc224a9f28bef9bef06f241f4

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