Skip to main content

fastdotcom

fastdotcom is an asynchronous Python library and CLI for running internet speed tests using Netflix's Fast.com API v2. It measures download speed, upload speed, and unloaded/loaded HTTP latency without requiring raw ICMP socket privileges.

Features

  • Pure asyncio + aiohttp: Native async client with optional external aiohttp.ClientSession injection (ideal for Home Assistant and other async applications).
  • Download & Upload Speed Tests: Dynamically scales parallel connections and stops early once throughput stabilizes.
  • Unloaded & Loaded Latency: Measures HTTP RTT via keep-alive /speedtest/range/0-0 probes (works in rootless containers without raw ICMP privileges).
  • Backwards-Compatible Sync API: Preserves fast_com() returning a metrics dictionary.
  • Command-Line Interface: Includes a fastdotcom CLI with human-readable and --json output.
  • Typed: Ships with frozen dataclasses, typed exceptions, and PEP 561 py.typed.

Installation

Install fastdotcom from PyPI:

pip install fastdotcom

Usage

import asyncio
from fastdotcom import async_fast_com


async def main() -> None:
    result = await async_fast_com(max_time=10)
    print(f"Download: {result.download_speed:.2f} Mbps")
    print(f"Upload: {result.upload_speed:.2f} Mbps")
    print(f"Unloaded Ping: {result.unloaded_ping:.2f} ms")
    print(f"Loaded Ping: {result.loaded_ping:.2f} ms")


asyncio.run(main())

You can also pass an existing aiohttp.ClientSession (which fastdotcom will never close):

import aiohttp
from fastdotcom import FastDotComClient

async with aiohttp.ClientSession() as session:
    async with FastDotComClient(session=session) as client:
        result = await client.run_speedtest(max_time=10)

Synchronous API

import fastdotcom

result = fastdotcom.fast_com(max_time=10)
print(result)

Example output:

{
    "download_speed": 189.08,
    "upload_speed": 125.36,
    "unloaded_ping": 23.53,
    "loaded_ping": 61.8,
    "success": 1,
}
  • Download Speed: Measured download speed in Mbps.
  • Upload Speed: Measured upload speed in Mbps.
  • Unloaded Ping: Average HTTP latency (ms) when the network is idle.
  • Loaded Ping: Average HTTP latency (ms) during the download test.
  • Success: 1 when the speed test succeeds. Network, timeout, or token errors raise a FastDotComError subclass (FastDotComConnectionError, FastDotComTimeoutError, or FastDotComTokenError).

CLI

fastdotcom
fastdotcom --max-time 10 --json
fastdotcom --no-upload --no-latency

Requirements

  • Python 3.11 or newer
  • aiohttp>=3.10.0

License

fastdotcom is released under the MIT License. See LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a pull request on GitHub.

Metadata

Release files for fastdotcom 0.1.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 fastdotcom 0.1.0
File Size Uploaded Provenance Actions
fastdotcom-0.1.0.tar.gz 136.4 kB With provenance Details for fastdotcom-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastdotcom 0.1.0
File Interpreter ABI Platform Actions
fastdotcom-0.1.0-py3-none-any.whl Python 3 none any Details for fastdotcom-0.1.0-py3-none-any.whl

Total release size: 153.7 kB

Release files / fastdotcom-0.1.0.tar.gz

Download URL fastdotcom-0.1.0.tar.gz
Size 136.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8dc9b57be88c20d73ee98a6836d1596342d71f79fc665c97c046ad87263388c7
BLAKE2b-256 checksum
How to use checksums
e98147db1992f92dfe3416d112f4a9066c3c972172c3061f52cfff150512704e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / fastdotcom-0.1.0-py3-none-any.whl

Download URL fastdotcom-0.1.0-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bab01bf48c84855431172020d39f850942ce3c208eaad907e133de32dbc8b6aa
BLAKE2b-256 checksum
How to use checksums
ba339c9e8c86587b80cbf2adf5090c983e8c8c3b78aecb77a83e9ecd69c28a45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for fastdotcom 0.1.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fastdotcom-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

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