requests-toolbelt

A collection of utilities extending Python's Requests library for HTTP

Library
PyPI
v1.0.0
1,037stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
41/100Fair
Development Activity0
Maintenance0
Community76
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
70/100Good
Architecture72
Code Quality74
Innovation55
Learning Curve80

requests-toolbelt is a companion package to the Requests HTTP library, collecting utilities that are useful in real-world HTTP client code but don’t belong in Requests’ core: streaming multipart/form-data encoding (so you don’t buffer entire file uploads into memory), transport adapters for pinning SSL/TLS behavior or binding to a specific source address/interface, session helpers, and cookie utilities.

It’s maintained by the same requests GitHub organization as Requests itself, and exists specifically as a place for functionality that’s broadly useful but too specialized or opinionated for the core library’s minimalist API surface. Many Requests-based clients pull in requests-toolbelt for exactly one or two utilities — most commonly the streaming multipart encoder for large file uploads.

What You Get

  • A streaming multipart/form-data encoder (MultipartEncoder) that avoids loading entire file uploads into memory before sending
  • Custom HTTPAdapter subclasses for SSL fingerprint pinning, host-header SSL verification, and binding requests to a specific source IP/interface
  • requests_toolbelt.sessions helpers for building sessions with a fixed base URL
  • Threaded utilities for running multiple Requests-based operations concurrently
  • Download utilities like streaming-to-file helpers for large response bodies
  • Auth helpers (e.g. Guess auth) beyond what Requests ships by default

Common Use Cases

  • Uploading large files via multipart/form-data without buffering the entire payload in memory
  • Pinning TLS certificate fingerprints for clients talking to a known, fixed server (certificate pinning)
  • Binding outbound HTTP requests to a specific network interface or source IP on a multi-homed host
  • Building a Requests session pre-configured with a fixed base URL for a specific API client
  • Streaming large HTTP responses directly to disk instead of buffering them in memory

Under The Hood

Architecture - The package is organized as a set of independent utility modules under requests_toolbelt/: multipart/encoder.py implements a streaming, file-like MultipartEncoder that Requests can send incrementally rather than buffering; adapters/ contains several HTTPAdapter subclasses (ssl.py, fingerprint.py, host_header_ssl.py, source.py, x509.py) that customize the underlying urllib3 connection pool behavior for specific TLS/networking needs; sessions.py, threaded/, and downloadutils/ provide session, concurrency, and download helpers respectively — each module is largely independent and can be imported without pulling in the rest. Tech Stack - Built directly on top of Requests and its underlying urllib3 connection machinery, using standard Python ssl/socket primitives for the adapter-level customizations; packaged with classic setuptools/setup.py. Code Quality - The tests/ directory contains 26 test modules covering the multipart encoder, adapters, and session helpers individually, giving reasonable per-module coverage; however, the project shows low recent commit activity, meaning some edge cases (e.g. against newer urllib3/OpenSSL versions) may lag behind upstream changes. API Design - Each utility is designed as a drop-in complement to Requests’ existing API — the MultipartEncoder implements the file-like interface Requests’ data= parameter expects, and the custom adapters plug into Session.mount() exactly like Requests’ own default adapter — so adopting any single utility requires minimal changes to existing Requests-based code.

Used by 5 apps in this directory

Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,530

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
66
Dependency
Built with
Python90%
Updated today
Python
63%
Apache 2.0

GPT Researcher

Productivity · AI Assistants

29,039

The pioneering open-source autonomous AI agent that conducts deep, multi-source research and produces citation-backed reports exceeding 2,000 words — faster and more reliably than any human researcher.

View details
88
Repo Health
91
Technical
64
Dependency
Built with
Python63%
TypeScript23%
Updated 1 months ago
Go
56%
Apache 2.0

OSV.dev

Security

2,888

Google's open-source vulnerability database that maps CVEs to exact package versions across 50+ ecosystems with a public API and data dumps.

View details
90
Repo Health
82
Technical
70
Dependency
Built with
Go56%
Python32%
Updated today
Python
55%
Other

PostHog

Analytics · Monitoring · Developer Tools

37,777

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
67
Dependency
Built with
Python55%
TypeScript36%
Updated today
Python
76%
AGPL 3.0

Skyvern

AI Agents · Automation

22,785

Skyvern (YC S2023) automates browser-based workflows by pairing LLMs with computer vision, letting agents click, fill, and extract data on sites they've never seen, without brittle XPath selectors that break on every layout change.

View details
89
Repo Health
82
Technical
71
Dependency
Built with
Python76%
TypeScript22%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search