speedtest-cli

repository·master·Indexed 12 days ago

https://github.com/sivel/speedtest-cli

A command line interface and Python API for testing internet bandwidth using speedtest.net. It provides various CLI flags for controlling bandwidth tests, including options for CSV and JSON output, server selection, and secure HTTPS communication.

Tokens
1K
Snippets
4
Records
6
Agent score
46%

What's inside speedtest-cli

  1. Understand latency and inconsistency in speedtest-cli

    master

    Users should be aware of the following limitations regarding accuracy and latency:

    • Latency Reporting: This tool is not a reliable latency reporting tool. Reported latency is a relative value used to determine the lowest latency server for the actual speed test, not an indicator of ICMP-style latency.
    • Inconsistency with Speedtest.net: Results may differ from the official Speedtest.net website due to:
      1. Speedtest.net's migration to pure socket tests (vs. this tool's HTTP-based tests).
      2. The implementation being written in Python.
      3. Variations in Python execution speed across different versions.
      4. Local CPU and Memory capacity/speed.
  2. Install speedtest-cli from GitHub

    master

    To install the latest development version directly from GitHub, use pip with the git URL, or clone the repository and run the setup script manually.

    # Via pip
    pip install git+https://github.com/sivel/speedtest-cli.git
    
    # Via git clone
    git clone https://github.com/sivel/speedtest-cli.git
    cd speedtest-cli
    python setup.py install
  3. Install speedtest-cli as a standalone script

    master

    You can download the speedtest.py script directly and make it executable. This is useful for environments where you don't want to manage Python packages.

    # Using wget
    wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
    chmod +x speedtest-cli
    
    # Using curl
    curl -Lo speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
    chmod +x speedtest-cli
  4. Reference: speedtest-cli CLI flags

    master

    The following flags are available for the speedtest-cli command line interface:

    FlagDescription
    -h, --helpShow this help message and exit
    --no-downloadDo not perform download test
    --no-uploadDo not perform upload test
    --singleOnly use a single connection instead of multiple. This simulates a typical file transfer
    --bytesDisplay values in bytes instead of bits. Does not affect the image generated by --share, nor output from --json or --csv
    --shareGenerate and provide a URL to the speedtest.net share results image, not displayed with --csv
    --simpleSuppress verbose output, only show basic information
    --csvSuppress verbose output, only show basic information in CSV format. Speeds listed in bit/s and not affected by --bytes
    --csv-delimiter CSV_DELIMITERSingle character delimiter to use in CSV output. Default ","
    --csv-headerPrint CSV headers
    --jsonSuppress verbose output, only show basic information in JSON format. Speeds listed in bit/s and not affected by --bytes
    --listDisplay a list of speedtest.net servers sorted by distance
    --server SERVERSpecify a server ID to test against. Can be supplied multiple times
    --exclude EXCLUDEExclude a server from selection. Can be supplied multiple times
    --mini MINIURL of the Speedtest Mini server
    --source SOURCESource IP address to bind to
    --timeout TIMEOUTHTTP timeout in seconds. Default 10
    --secureUse HTTPS instead of HTTP when communicating with speedtest.net operated servers
    --no-pre-allocateDo not pre allocate upload data. Pre allocation is enabled by default to improve upload performance. To support systems with insufficient memory, use this option to avoid a MemoryError
    --versionShow the version number and exit