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": 0,
  "uploadSpeed": 0,
  "downloadUnit": "",
  "downloaded": 0,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 0,
  "bufferBloat": 0,
  "userLocation": "",
  "userIp": "",
  "serverLocation": [
   ""
  ],
  "isDone": false
 },
 {
  "downloadSpeed": 1.5,
  "uploadSpeed": 0,
  "downloadUnit": "Mbps",
  "downloaded": 0.12,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 0,
  "bufferBloat": 89,
  "userLocation": "Chicago, US",
  "userIp": "172.183.91.174",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false
 },
 {
  "downloadSpeed": 170,
  "uploadSpeed": 0,
  "downloadUnit": "Mbps",
  "downloaded": 20,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 0,
  "bufferBloat": 89,
  "userLocation": "Chicago, US",
  "userIp": "172.183.91.174",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false
 },
 {
  "downloadSpeed": 280,
  "uploadSpeed": 0,
  "downloadUnit": "Mbps",
  "downloaded": 50,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 0,
  "bufferBloat": 89,
  "userLocation": "Chicago, US",
  "userIp": "172.183.91.174",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false
 },
 {
  "downloadSpeed": 280,
  "uploadSpeed": 0,
  "downloadUnit": "Mbps",
  "downloaded": 60,
  "uploadUnit": "Mbps",
  "uploaded": 0,
  "latency": 85,
  "bufferBloat": 89,
  "userLocation": "Chicago, US",
  "userIp": "172.183.91.174",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false
 },
 {
  "downloadSpeed": 280,
  "uploadSpeed": 38,
  "downloadUnit": "Mbps",
  "downloaded": 60,
  "uploadUnit": "Kbps",
  "uploaded": 0,
  "latency": 85,
  "bufferBloat": 89,
  "userLocation": "Chicago, US",
  "userIp": "172.183.91.174",
  "serverLocation": [
   "Barranquilla, CO",
   "Cartagena de Indias, CO",
   "Bogot\u00e1, CO"
  ],
  "isDone": false
 }
]

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.6a0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastcom_speed_cli-0.1.6a0.tar.gz
  • Upload date:
  • Size: 15.5 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.6a0.tar.gz
Algorithm Hash digest
SHA256 e89e02f962d1a34a7b704ef50a215290fe7afe4d53e9074be028877529b09d52
MD5 219b50902827352f04a95fd8d3432979
BLAKE2b-256 264d7dd1506f07b5444a0faa2a23dcbee0de0e588f5dac5ae88b4d06e419f3e8

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for fastcom_speed_cli-0.1.6a0-py3-none-any.whl
Algorithm Hash digest
SHA256 ade76f23d477447078e4530acf10c000d5a80919395525d8bc4224785f4b4153
MD5 674089a2cc5fbedda87b53878a7536fc
BLAKE2b-256 0386b615731ed4b0e6e294aaed7d2c8889b02590667d1882994dbf789848e12e

See more details on using hashes here.

Provenance

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