--- id: treq version: "26.7.0" license: MIT license_treatment: permissive maintenance: active --- # treq — High-level Twisted HTTP Client API License: permissive · Maintenance: active · Downloads: 299.5K/mo ## What it is and what it does treq bridges the gap between Twisted's low-level HTTP machinery and the simple, intuitive API style of the requests library. It wraps Twisted's Agent with a higher-level interface that lets you make HTTP calls using familiar method names like get(), post(), and put() while staying within Twisted's asynchronous event loop. This makes it easier to write HTTP-heavy Twisted applications without wrestling with Agent's lower-level abstractions. The library is built on six runtime dependencies: attrs, hyperlink, incremental, multipart, twisted, and typing-extensions. It's designed for developers already committed to Twisted who want a more ergonomic way to handle HTTP requests in their async code. The package is actively maintained, supports modern Python versions (3.9 through 3.14), and runs on both CPython and PyPy. Use it for: - Making HTTP requests from within a Twisted application without dropping to low-level Agent APIs - Building web scrapers or API clients that need to integrate with existing Twisted services - Handling multipart form uploads in async Twisted code using the multipart dependency - Writing integration tests for Twisted services that need to make outbound HTTP calls ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. treq is a high-level HTTP client library for Twisted that provides a requests-like API for making asynchronous HTTP calls within Twisted applications. Yes, if you are already using Twisted and need to make HTTP requests. treq significantly reduces boilerplate compared to raw Agent usage and has no known vulnerabilities. The MIT license is unrestrictive. If you are not already committed to Twisted, consider whether a non-Twisted async HTTP library (like httpx or aiohttp) might be simpler for your use case. ## Install pip install treq uv add treq poetry add treq ## Installing treq Before you install: Low install friction with six runtime dependencies. Actively maintained with a recent release 43 days ago and last commit on 2026-08-08. Supports Python 3.9 through 3.14 and runs on both CPython and PyPy. License in practice: MIT license (permissive) means you can use, modify, and distribute treq freely in commercial and private projects with minimal restrictions. Quickstart: import treq from twisted.internet.task import react async def main(reactor): response = await treq.get("https://github.com") print(response.code) body = await response.text() return body react(main) Requires Twisted to be installed and running; treq is designed for use within Twisted's reactor-based event loop, not standalone synchronous code. Verify before relying: - Whether treq's API surface and feature parity with requests are sufficient for your specific HTTP use case - Performance characteristics compared to other async HTTP libraries in the Twisted ecosystem ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 299.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags twisted http client, async http requests, twisted web client, asynchronous http library, twisted http api, requests-like twisted, twisted http agent wrapper, twisted, async-http, event-loop [View on SkillFed](https://skillfed.io/packages/treq) · [View on PyPI](https://pypi.org/project/treq/)