fastdotcom-ng
A clean-room, modern asyncio + aiohttp Python library and CLI to measure Internet speed (download, upload, unloaded latency, and loaded latency) using Netflix's Fast.com API v2 — designed as a 100% drop-in compatible replacement for fastdotcom in Home Assistant.
Highlights
- Pure
asyncio+aiohttp: Zerorequests,urllib.request,threading, oricmplib. - Single API v2 Discovery Call: Discovers client metadata and targets in one call, with UTF-8 +
latin-1fallback decoding for non-UTF-8 city names. - Rootless HTTP Latency Probes: Uses
GET /speedtest/range/0-0keep-alive requests instead of ICMP raw sockets (works unprivileged inside containers and Home Assistant OS). - Dynamic Scaling & Clean Cancellation: Dynamically scales parallel connections (
1 -> 3 -> 5 -> max) with sliding-window speed tracking and guaranteed task cleanup. - Zero-Bottleneck Upload Streaming: Streams a pre-allocated reusable buffer with explicit
Content-Length(required by Netflix OCA endpoints) instead of callingos.urandom()per loop. - Home Assistant Drop-In & Native Async Ready:
from fastdotcom import fast_comprovides synchronous drop-in compatibility.async_fast_com(session=...)andFastDotComClient(session=...)accept an externalaiohttp.ClientSessionwithout ever closing caller-owned sessions.- Typed exceptions (
FastDotComError) replace silent0returns.
- PEP 561 Typed: Ships
py.typedwith strictmypyverification.
Installation
uv add fastdotcom-ng
Or with pip:
pip install fastdotcom-ng
Usage
Native Async (Recommended)
import asyncio
import aiohttp
from fastdotcom import async_fast_com
async def main() -> None:
async with aiohttp.ClientSession() as session:
result = await async_fast_com(session=session)
print(
f"Download: {result.download_speed} Mbps | "
f"Upload: {result.upload_speed} Mbps | "
f"Unloaded: {result.unloaded_ping} ms | "
f"Loaded: {result.loaded_ping} ms"
)
asyncio.run(main())
Reusable Client
import asyncio
from fastdotcom import FastDotComClient
async def main() -> None:
async with FastDotComClient() as client:
result = await client.run_speedtest(max_time=10.0, ping_count=5)
print(result.to_dict())
asyncio.run(main())
Synchronous Drop-In (Home Assistant Compatible)
from fastdotcom import fast_com
metrics = fast_com()
# {
# "download_speed": 612.45,
# "upload_speed": 318.92,
# "unloaded_ping": 3.41,
# "loaded_ping": 14.28,
# "success": 1,
# }
Command-Line Interface
fastdotcom
fastdotcom --json --max-time 10 --ping-count 5
fastdotcom --no-upload --ipv4
Provenance & License
fastdotcom-ng is an independent, clean-room MIT implementation written from scratch by Marco Sousa to replace the unmaintained legacy fastdotcom package (nkgilley/fast.com) while preserving its public fastdotcom import namespace and Home Assistant dictionary contract.
Licensed under the MIT License.
Metadata
Release files for fastdotcom-ng 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fastdotcom_ng-1.0.1.tar.gz | 141.8 kB | With provenance | Details for fastdotcom_ng-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastdotcom_ng-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for fastdotcom_ng-1.0.1-py3-none-any.whl |
Total release size: 157.6 kB
Release files / fastdotcom_ng-1.0.1.tar.gz
| Download URL | fastdotcom_ng-1.0.1.tar.gz |
|---|---|
| Size | 141.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f8f578cc3824b7202216b1e5f7e1e171360e6771e46a879f5fe727d6891cd23
|
|
BLAKE2b-256 checksum How to use checksums |
ef5ada9499378355fcc8b0f75815c689eace4a5aa94f598b4b7269d4534cc6cc
|
| 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 21, 2026.
Transparency logRelease files / fastdotcom_ng-1.0.1-py3-none-any.whl
| Download URL | fastdotcom_ng-1.0.1-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5bfdee2a5d8bfb654126104226164ffbd25c9884c2714090e4c6af59bd4d0c1
|
|
BLAKE2b-256 checksum How to use checksums |
2b6d7d0160d77b183c7f66019a2629f054aeb4940eec0131075eae65c0f31ecd
|
| 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 21, 2026.
Transparency logSecurity for fastdotcom-ng 1.0.1
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.
Attestation for fastdotcom_ng-1.0.1.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 21, 2026.
Transparency logA 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.