curlify2
Library to convert python requests and httpx object to curl command.
What it is and what it does
Curlify2 takes an HTTP request object and generates the equivalent curl command as a string. This is useful when you need to reproduce an HTTP interaction outside Python—for instance, to share a request with a colleague, test it in a shell, or debug network behavior. The library accepts a request object, processes its method, headers, and body, and outputs a properly formatted curl invocation.
The package has no runtime dependencies beyond Python itself, making it lightweight to add to any project. It supports Python 3.7, 3.8, 3.9, 3.10, and 3.11. The library is described as an enhancement of an earlier curlify project, indicating it addresses limitations in that earlier work.
Use it for:
- Debug HTTP requests by converting them to curl commands for manual testing in a terminal
- Log HTTP interactions in a format that can be replayed or shared with other developers
- Export requests made by your application for documentation or troubleshooting purposes
- Inspect request details in curl format before sending or after receiving responses
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts Python requests and httpx HTTP request objects into equivalent curl command-line strings for debugging, logging, or manual execution.
Yes, if you regularly need to inspect or replay HTTP requests from Python. The zero-dependency install and permissive MIT license make it low-risk. However, the last release was 2023-06-09; verify that it handles the request and httpx versions in your environment before relying on it for production logging.
Install
curlify2 on PyPI
pip
pip install curlify2uv
uv add curlify2poetry
poetry add curlify2Installing curlify2
Before you install
Low friction install with no runtime dependencies. Last release was 2023-06-09, over two years old; repository remains active but maintenance is infrequent.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal obligations.
Quickstart
pip install curlify2
from curlify2 import Curlify
curl_str = Curlify(request_object).to_curl()
print(curl_str)
Verify before relying
- Whether generated curl commands are always executable as-is or require manual adjustment for certain request types
- Support status for requests and httpx versions released after 2023-06-09
- Whether the library works correctly with Python 3.10 and 3.11 in current environments
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7,<4.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 1,162 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 91,010/month — #13,550 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: curlify2-2.0.0-py3-none-any.whl
Keywords: python, curl, requests, curlify, httpx, convert to curl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
curlifyConverts a Python requests request object into…
permissive · top 5,000 on PyPI
httpieHTTPie is a command-line HTTP client that makes…
permissive · top 5,000 on PyPI
uncurlConverts curl command-line requests into…
unclear · top 15,000 on PyPI
httplib2httplib2 is an HTTP client library that handles…
permissive · top 1,000 on PyPI
respxRESPX mocks HTTPX and HTTP Core libraries for…
permissive · top 1,000 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpx-ntlmAdds NTLM authentication support to HTTPX,…
permissive · top 15,000 on PyPI
requests-toolbeltProvides utilities for the requests library,…
permissive · top 1,000 on PyPI
httpx2HTTPX2 is a fully featured HTTP client library…
permissive · top 1,000 on PyPI
netapp-ontapA Python REST API client library for NetApp…
permissive · top 15,000 on PyPI