skillfed

curlify2

Library to convert python requests and httpx object to curl command.

curlify2 v2.0.0 91.0K downloads/30d#13,550 on PyPI40
Permissive license MIT AGING released

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 curlify2

uv

uv add curlify2

poetry

poetry add curlify2

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

convert requests to curlhttpx to curl commandhttp request debuggingcurl command generatorhttp client debugging toolrequest object to shell
http-debuggingcurl-export

More Utilities packages