Skip to main content

This package provides a command-line and Python interface for netflix's fast.com for speedtest

Project description

python-fast-cli

Test your download and upload speed using netflix's fast.com.

This package provides a command-line and Python interface for Fast.com, offering a comprehensive alternative to other similar tools. Unlike others, it allows you to modify all settings directly from the interface as you would on the Fast.com website. Additionally, it outputs results as a time series, enabling more detailed analysis of bandwidth performance.

implementation

this is pure python package based on python version of playwright

The playwright need to install browsers at the first time it is been used.

installation

pip install -U fastcom-speed-cli

from source

  • clone the repo
  • cd into the repo dir
  • pip install .

Usage

command line

  • if it is installed via pip, then there is entry point at ~/.local/bin/fast-cli
  • if used from the source repo, one can invoke it via python3 -m fast_speedtest.cli
usage: fast-cli [-h] [--min-duration MIN_DURATION] [--max-duration MAX_DURATION] [--measure-upload-latency MEASURE_UPLOAD_LATENCY]
              [--min-connections MIN_CONNECTIONS] [--max-connections MAX_CONNECTIONS] [--should-persist SHOULD_PERSIST]
              [--show-advanced SHOW_ADVANCED] [--no-install-browser] [--no-upload] [--interval CHECK_INTERVAL] [--json]

options:
  -h, --help            show this help message and exit
  --min-duration MIN_DURATION
                        [default: 5]
  --max-duration MAX_DURATION
                        [default: 30]
  --measure-upload-latency MEASURE_UPLOAD_LATENCY
                        [default: False]
  --min-connections MIN_CONNECTIONS
                        [default: 1]
  --max-connections MAX_CONNECTIONS
                        [default: 8]
  --should-persist SHOULD_PERSIST
                        [default: True]
  --show-advanced SHOW_ADVANCED
                        [default: True]
  --no-install-browser  do not automatically install ['chromium']
  --no-upload           do not wait for upload test
  --interval CHECK_INTERVAL
                        data collection interval [default: 1.0]

By default, when this command is run for the first time, it will attempt to install the browser to ~/.cache/ms-playwright using the playwright command. If you are certain that the browser is already installed via Playwright, you can suppress this behavior by using the --no-install-browser flag. To control the browser binary location read this for detail.

If you get warning about Host system is missing dependencies to run browsers., normally it won't cause any real problem, since the fast.com only use limited features. But if it really cause problem make sure you have installed all the system dependencies.

use as lib

import fast_speedtest.api
...

example

python3 -m fast_speedtest.cli --min-duration 2 --max-duration 3 --max-connections 1 --no-upload --interval 1 --json

[
 {
  "downloadSpeed": 350,
  "uploadSpeed": 0,
  "downloadUnit": "Kbps",
  "downloaded": 0.02,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 0,
  "bufferBloat": 92,
  "userLocation": "Chicago, US",
  "userIp": "172.183.162.214",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false,
  "time": "2024-08-05T04:52:29.802055+00:00"
 },
 {
  "downloadSpeed": 94,
  "uploadSpeed": 0,
  "downloadUnit": "Mbps",
  "downloaded": 8.7,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 0,
  "bufferBloat": 92,
  "userLocation": "Chicago, US",
  "userIp": "172.183.162.214",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false,
  "time": "2024-08-05T04:52:30.829972+00:00"
 },
 {
  "downloadSpeed": 270,
  "uploadSpeed": 0,
  "downloadUnit": "Mbps",
  "downloaded": 40,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 0,
  "bufferBloat": 92,
  "userLocation": "Chicago, US",
  "userIp": "172.183.162.214",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false,
  "time": "2024-08-05T04:52:31.838278+00:00"
 },
 {
  "downloadSpeed": 270,
  "uploadSpeed": 0,
  "downloadUnit": "Mbps",
  "downloaded": 50,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 90,
  "bufferBloat": 92,
  "userLocation": "Chicago, US",
  "userIp": "172.183.162.214",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false,
  "time": "2024-08-05T04:52:32.847574+00:00"
 },
 {
  "downloadSpeed": 270,
  "uploadSpeed": 0,
  "downloadUnit": "Mbps",
  "downloaded": 50,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 90,
  "bufferBloat": 92,
  "userLocation": "Chicago, US",
  "userIp": "172.183.162.214",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false,
  "time": "2024-08-05T04:52:33.855684+00:00"
 },
 {
  "downloadSpeed": 270,
  "uploadSpeed": 0,
  "downloadUnit": "Mbps",
  "downloaded": 50,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 90,
  "bufferBloat": 92,
  "userLocation": "Chicago, US",
  "userIp": "172.183.162.214",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false,
  "time": "2024-08-05T04:52:34.863142+00:00"
 },
 {
  "downloadSpeed": 270,
  "uploadSpeed": 0,
  "downloadUnit": "Mbps",
  "downloaded": 50,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 90,
  "bufferBloat": 92,
  "userLocation": "Chicago, US",
  "userIp": "172.183.162.214",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false,
  "time": "2024-08-05T04:52:35.870352+00:00"
 },
 {
  "downloadSpeed": 270,
  "uploadSpeed": 0,
  "downloadUnit": "Mbps",
  "downloaded": 50,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 90,
  "bufferBloat": 92,
  "userLocation": "Chicago, US",
  "userIp": "172.183.162.214",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false,
  "time": "2024-08-05T04:52:36.878271+00:00"
 },
 {
  "downloadSpeed": 270,
  "uploadSpeed": 40,
  "downloadUnit": "Mbps",
  "downloaded": 50,
  "uploadUnit": "Kbps",
  "uploaded": 0,
  "latency": 90,
  "bufferBloat": 92,
  "userLocation": "Chicago, US",
  "userIp": "172.183.162.214",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false,
  "time": "2024-08-05T04:52:37.885847+00:00"
 }
]

It is possible that the firewall block the fast.com upload/download then there will be an error, the json output looks like this:

[
  {
  "error": "* Could not reach our servers to perform the test. You may not be connected to the internet",
  "time": "2024-08-05T06:46:26.457695+02:00"
 }

]

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

fastcom_speed_cli-0.1.6.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

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

fastcom_speed_cli-0.1.6-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file fastcom_speed_cli-0.1.6.tar.gz.

File metadata

  • Download URL: fastcom_speed_cli-0.1.6.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for fastcom_speed_cli-0.1.6.tar.gz
Algorithm Hash digest
SHA256 1bb99182a798bea42520448fad36d268040fdf5b7072e154d4983ab1ff7a0ce4
MD5 f2e5d970d047f8f8bf6993988a451521
BLAKE2b-256 9a303bf680f45724b65d94b37a9cae3deb0a4912fb534253639f71224650f10d

See more details on using hashes here.

File details

Details for the file fastcom_speed_cli-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for fastcom_speed_cli-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 03e14160403203787be6614e58dc9a38ee0b8fc3b1a911adbecbd6f941779ca4
MD5 dd9d3b995b4d01a13b0a690e920a185f
BLAKE2b-256 71bfd5b4f80ad3cf8b9ab8d7822fb32c73889d6cb7544ef01c5020dcd8d6e605

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