Pythie
CategoriesTrending
An open index of Python tools.Pythie’s IndexLegal noticePrivacyData: PyPI (package metadata; download statistics under CC BY 4.0, via ClickHouse), deps.dev (CC BY 4.0), GitHub, OSV.

fasttransport

0.0.4ActivePythie’s Index: 61

Sync and async HTTP transports over httpx2, plus base classes for small REST clients

Maintained. Last release 3 months ago, commits in 5 of the last 26 weeks. Weaker on commit activity and contributor spread.

HTTP & NetworkingUtilities & Language Tools
$pip install fasttransport
AnswerDotAI/fasttransportDocsPyPI

fasttransport

Install

pip install fasttransport

Why

Every small API wrapper needs the same plumbing: headers merged into each request, responses decoded by content type, errors that carry the response body, and SSE parsing for streams. Most wrappers also repeat the same mistake. They create one httpx client at startup and keep it, which pins its pooled connections to the event loop that created them. Code that later runs under a different loop, common in tests and background tasks, then fails with confusing connection errors.

fasttransport is that plumbing written once, on httpx2. Each request gets a fresh client and nothing is tied to a loop. Pass client= to manage a persistent client yourself. fastspec builds its spec-driven clients on these transports, ghapi its GitHub client, and solveit its gateway clients.

Get started

SyncTransport.request executes a call and returns the decoded body: JSON arrives as a dict, text as text, and anything else as bytes. HTTP errors raise with the response body included in the message.

from fasttransport.core import *
SyncTransport().request('GET', 'https://jsonplaceholder.typicode.com/todos/1')

AsyncTransport is the same, awaited. It also has stream, an async generator that parses SSE events into JSON dicts. The core page streams a chat completion with it.

await AsyncTransport().request('GET', 'https://jsonplaceholder.typicode.com/users/1')

A small REST client is a base URL plus verbs. HttpCli verbs take a path relative to the base, kwargs become the payload (query params on get and delete, the JSON body otherwise), and decoded bodies come back:

cli = HttpCli('https://jsonplaceholder.typicode.com')
cli.get('todos/1')
cli.post('posts', title='hi')

AsyncHttpCli is the async twin. Its verbs return awaitables:

acli = AsyncHttpCli('https://jsonplaceholder.typicode.com')
await acli.get('todos/1')

Errors

A client fails in three ways: an HTTP error status, a transport failure such as a timeout, and an error event arriving mid-stream. fasttransport.errors turns all three into one APIError, carrying the parsed message, provider code, request id, and whether the failure is worth retrying. fastspec, ghapi, and fastllm all raise that one type, so calling code catches it once whatever the provider. The errors page shows each provider’s error shape parsed into it.

The core page documents the rest with runnable examples: SSE streaming, error enrichment, multipart uploads, and managing your own client.

Popularity

Downloads / month
3.5M
GitHub stars
0
Downloads, last 7 days
670.5K-22%
Stars, last 7 days
–
Direct dependents
8
All dependents
224

Pythie’s Index

How it works
61

Fair

Maintenance, out of 100

  • Recent release

    last release 87 days ago

  • Commit activity

    5/26 weeks with commits

  • Release cadence

    4 releases in 12 months

  • Issues & PRs handled

    75% closed in the past year

  • Contributor spread

    1 authors in last 100 commits

  • OpenSSF Scorecard

    not evaluated

Commits, last 26 weeks19

Releases

Latest
0.0.4
Released
Sep 3, 2026
Releases, 12 months
4
First release
Aug 13, 2026

Compatibility

Requires Python
>=3.10
License
Apache-2.0 (Permissive)

Keywords

nbdev

Works well with

Use together with fasttransport: extensions, drivers, servers and companion tools.

  • httpx2Pythie’s Index: 85The next generation HTTP client.477.4M downloads/mo
  • httpx-ssePythie’s Index: 24Consume Server-Sent Event (SSE) messages with HTTPX.204.3M downloads/mo
  • httpx-wsPythie’s Index: 59WebSockets support for HTTPX11.3M downloads/mo