urllib3

A powerful, user-friendly HTTP client for Python with thread-safe connection pooling, TLS verification, and retry handling.

Library
PyPI
v2.8.0
4,079 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
93 /100 Excellent
Development Activity 96
Maintenance 84
Community 92
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
85 /100 Excellent
Architecture 90
Code Quality 95
Innovation 75
Learning Curve 80

urllib3 is the HTTP library that underpins a huge share of the Python ecosystem — it’s the transport layer inside Requests, pip, and countless other tools. It fills the gaps left by Python’s standard library HTTP support: thread-safe connection pooling, client-side TLS/SSL verification, automatic retries with configurable backoff, redirect handling, and multipart file uploads.

Maintained continuously since 2008 with a strong security track record (SLSA level 3, OpenSSF Scorecard, CII Best Practices), urllib3 is built for production use at scale. It exposes both a low-level HTTPConnectionPool/PoolManager API for fine-grained control and a simple urllib3.request() helper for quick one-off calls, supporting HTTP/1.1 and experimental HTTP/2, gzip/deflate/brotli/zstd encoding, and SOCKS proxying.

What You Get

  • Thread-safe connection pooling via PoolManager and HTTPConnectionPool that reuses TCP connections across requests for lower latency
  • Client-side TLS/SSL certificate verification enabled by default, with support for custom CA bundles and client certificates
  • A configurable Retry class for automatic retries on connection errors, read timeouts, and specific HTTP status codes, with exponential backoff
  • Multipart file upload and form-encoding helpers via encode_multipart_formdata and fields.py
  • Proxy support for both HTTP and SOCKS proxies via ProxyManager and the socks extra
  • Built-in support for gzip, deflate, brotli, and zstd response decoding, plus experimental HTTP/2

Common Use Cases

  • Building an HTTP client library or SDK - projects like Requests wrap urllib3’s connection pooling and retry logic rather than reimplementing it
  • High-throughput API clients - services that make many outbound HTTP calls reuse pooled connections to avoid TCP/TLS handshake overhead per request
  • Package managers and CLI tools - pip and similar tools use urllib3 directly for reliable, retryable downloads over HTTP(S)
  • Uploading files or form data - multipart encoding helpers make it straightforward to POST files without pulling in a heavier client
  • Working behind corporate proxies - ProxyManager and SOCKS support handle HTTP(S) traffic through HTTP or SOCKS4/5 proxies

Under The Hood

Architecture

urllib3 is organized as a layered connection-management stack: connection.py wraps a single socket-level HTTP(S) connection, connectionpool.py’s HTTPConnectionPool/HTTPSConnectionPool manage a thread-safe queue of reusable connections to one host, and poolmanager.py’s PoolManager sits on top routing requests to the correct per-host pool by parsing the target URL (with ProxyManager as a PoolManager subclass adding proxy-aware routing). Shared request-building logic lives in _request_methods.py’s RequestMethods base class, and util/retry.py’s Retry object is threaded through every layer, re-evaluated and reconstructed on each attempt so retry state stays immutable and safely shareable. This separation means the core abstraction that would break the most if changed is the pool key normalization in poolmanager.py, since it determines which requests can share a connection.

Tech Stack

urllib3 is pure Python (3.10+) with zero required runtime dependencies, using the standard library’s ssl and socket modules directly rather than a C extension. Optional extras pull in brotli/brotlicffi for Brotli decoding, backports.zstd for Zstandard, PySocks for SOCKS proxying, and h2 for experimental HTTP/2 support via the http2/ submodule. The build uses hatchling with hatch-vcs for version management, and the project is fully managed with uv (uv.lock present) for dependency locking across its extensive dev/test dependency groups.

Code Quality

The project reports 100% test coverage (badge-verified) with a large test/ suite covering collections, connection pooling, retries, SSL, proxies, and a with_dummyserver/ integration layer that spins up real HTTP servers for end-to-end checks. Tests run against pytest with anyio/trio for async server scenarios and hypercorn/quart as test HTTP/2 servers. The codebase is fully typed with py.typed marker and enforced mypy configuration, uses from __future__ import annotations throughout, and ships CI-verified builds (GitHub Actions badge in the README) plus supply-chain attestations (SLSA level 3, OpenSSF Scorecard).

What Makes It Unique

Rather than being a convenience wrapper, urllib3 solves the specific hard problems the Python standard library leaves unsolved: safe connection reuse under concurrent access, correct TLS verification by default (a deliberate v2 design choice), and a retry model expressive enough for production services to tune per-error-type backoff. Its role as the transport layer beneath Requests and pip — rather than a competing high-level client — is itself the differentiator: it optimizes for correctness and stability at the layer just above raw sockets, which is why higher-level HTTP libraries build on it instead of around it.

Used by 48 apps in this directory

Python
79%
AGPL 3.0

Skyvern

AI Agents · Automation

23,257

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
70
Dependency
Built with
Python 79%
TypeScript 19%
Updated 6 days ago
TypeScript
47%
Other

Stirling PDF

Digital Signiture · Productivity

94,824

The open-source PDF platform you can run anywhere — edit, convert, sign, and automate PDFs without sending files to external servers.

View details
92
Repo Health
86
Technical
68
Dependency
Built with
TypeScript 47%
Java 44%
Updated 6 days ago
Python
94%
Apache 2.0

SWIRL

Data Engineering · Databases · Search

3,046

Federated AI search and RAG across 100+ enterprise sources—no data extraction, no vector database required.

View details
61
Repo Health
83
Technical
65
Dependency
Built with
Python 94%
Updated 1 weeks ago
Python
97%
MPL 2.0

Taiga Back

Developer Tools · Project Management

859

Self-hosted agile project management backend with Scrum, Kanban, issue tracking, and a full REST API — built on Django and PostgreSQL.

View details
72
Repo Health
74
Technical
64
Dependency
Built with
Python 97%
Updated 1 months ago
C
74%
AGPL 3.0

TDengine

Databases

25,168

A high-performance, open-source time-series database built in C for IoT, connected vehicles, and industrial monitoring workloads, with built-in stream processing, caching, and data subscription.

View details
97
Repo Health
71
Technical
65
Dependency
Built with
C 74%
C++ 19%
Updated 1 weeks ago
C++
75%
Apache 2.0

Timeplus Proton

Analytics · Data Engineering

2,273

Single C++ binary SQL engine for real-time stream processing, ETL, and analytics on Kafka, Redpanda, and ClickHouse with sub-millisecond latency.

View details
87
Repo Health
82
Technical
68
Dependency
Built with
C++ 75%
Python 11%
Updated 2 weeks ago
Rust
71%
MIT

Trieve

AI Development · Developer Tools · Search

2,721

All-in-one self-hostable platform for hybrid search, RAG, recommendations, and analytics built on Rust and Qdrant.

View details
42
Repo Health
74
Technical
65
Dependency
Built with
Rust 71%
Updated 9 months ago
TypeScript
90%
AGPL 3.0

useSend

Developer Tools · Marketing

4,753

Self-hostable open source email platform built on Amazon SES with a full dashboard, SMTP relay, REST API, and multi-language SDKs.

View details
76
Repo Health
72
Technical
68
Dependency
Built with
TypeScript 90%
Updated 1 weeks ago
Python
73%
Apache 2.0

Unsloth

AI Assistants · AI Development

78,493

Run and fine-tune LLMs, diffusion, audio and embedding models on your own hardware, from a native desktop app, a browser UI, or a Python library.

View details
89
Repo Health
83
Technical
70
Dependency
Built with
Python 73%
TypeScript 22%
Updated 6 days ago

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