Skip to main content

speedtest-cli

PyPI version PyPI license PyPI pyversions CI Quality Gate Status

Next generation CLI for testing internet bandwidth using speedtest.net

Getting started

Installation

PyPI

You can install speedtest-cli-ng from PyPI using either standard Python packaging tools or uv.

Using pip

If you have pip only. You can also use pipx to run the tool without installing.

pip install speedtest-cli-ng

Using uv

You can run the tool instantly without explicitly managing environments:

uvx speedtest-cli-ng

or install it globally:

uv tool install speedtest-cli-ng

Usage

To view the available options, run the help command:

speedtest-cli --help
usage: speedtest-cli [-h] [-l] [-s SERVER] [--search SEARCH]
                     [--location LAT,LON] [--no-download] [--no-upload]
                     [-t THREADS | --single] [--share] [--bytes] [--json]
                     [--debug] [--version]

Next generation CLI for testing internet bandwidth using speedtest.net.

options:
  -h, --help            show this help message and exit

Core Options:
  -l, --list            Show available speedtest.net servers sorted by distance. (default: False)
  -s SERVER, --server SERVER
                        Specify a server id to test against. (default: None)
  --search SEARCH       Find servers matching a country or city name, anywhere in the world. (default: None)
  --location LAT,LON    Find servers near these coordinates instead of near your IP address. (default: None)

Transfer Modifiers:
  --no-download         Do not perform the download test. (default: False)
  --no-upload           Do not perform the upload test. (default: False)
  -t THREADS, --threads THREADS
                        Set the number of concurrent connections instead of using downloaded config. (default: None)
  --single              Use one concurrent connection. Simulates a typical file transfer. (default: False)

Output Options:
  --share               Generate and provide a URL to the speedtest.net share results image. (default: False)
  --bytes               Display values in bytes instead of bits. Does not affect image generation or JSON output. (default: ('bit', 1))
  --json                Suppress verbose output, only show basic information in JSON format. Speeds listed in bit/s. (default: False)

Miscellaneous Options:
  --debug               Show verbose debugging output. (default: False)
  --version             show program's version number and exit

Testing against other regions

By default only the servers nearest to your IP address are offered. To use servers elsewhere:

speedtest-cli --list --search Germany
speedtest-cli --search Tokyo

# Servers nearest to a point; use '=' so negative numbers aren't read as flags
speedtest-cli --list --location=-33.87,151.21

The service has no continent filter, so a search such as Europe returns unrelated results. Search by country, or use --location with the coordinates of the area you want. The result is a normal server list, so pick one with --server ID.

If you run --search without --list then a test will start for the nearest server from the chosen region.

Development

Requirements

  • Python 3.14+
  • uv 0.13+
  • prek 0.5+

Setup pre-commit hooks

You can install hooks to automatically run the validation checks:

uv tool install prek
prek install

Install dependencies

This will install project's dependencies

uv sync

Basic workflow

# Run pre-commit checks for changed files
prek

# Run all pre-commit checks
prek --all-files

# Run format
uv run ruff format --check .

# Run lint
uv run ruff check .

# Run typecheck
uv run ty check

# Run tests
uv run pytest

Building

Build both sdist and wheel package:

uv run build

The output will be in the dist/ directory.

Acknowledgments

This project is a heavily refactored and modernized fork of the original speedtest-cli created by Matt Martz. While the codebase has been completely rewritten to support modern Python standards, concurrent thread pools, and memory-safe streaming, it was built upon the foundational concepts of the original tool.

License

This project is licensed under the terms of the Apache License 2.0.


Made with 🩵 by Michał Korczak


Metadata

Release files for speedtest-cli-ng 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for speedtest-cli-ng 1.2.0
File Size Uploaded Provenance Actions
speedtest_cli_ng-1.2.0.tar.gz 57.8 kB Without provenance Details for speedtest_cli_ng-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for speedtest-cli-ng 1.2.0
File Interpreter ABI Platform Actions
speedtest_cli_ng-1.2.0-py3-none-any.whl Python 3 none any Details for speedtest_cli_ng-1.2.0-py3-none-any.whl

Total release size: 86.5 kB

Release files / speedtest_cli_ng-1.2.0.tar.gz

Download URL speedtest_cli_ng-1.2.0.tar.gz
Size 57.8 kB
Tags Source
SHA-256 checksum
How to use checksums
764428142fbf7b36a7c6940e000ee06f4dc86b7620a35e8e86612a3ca89c5fe5
BLAKE2b-256 checksum
How to use checksums
3e470a764ef52fc15b3d625d05644d60e523838c7058acf2c6ec489c6c7d1876
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / speedtest_cli_ng-1.2.0-py3-none-any.whl

Download URL speedtest_cli_ng-1.2.0-py3-none-any.whl
Size 28.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbc8a618298127dd2369d6f47c800ba3353c98bce895b764cb0fe41e0d96c761
BLAKE2b-256 checksum
How to use checksums
8b1da2d797346e94f32468cf97d5d40b254550acbf9ba8a8a6b4c104a6de783b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for speedtest-cli-ng 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page