Skip to main content

curlify3

PyPI Downloads Python Tests Docs

Convert request objects from popular Python HTTP libraries into ready-to-run curl commands.

pip install curlify3
import requests
from curlify3 import to_curl

req = requests.Request("POST", "https://httpbin.org/post", json={"date": "2026-08-10"}).prepare()
print(to_curl(req))
# curl -X POST -H 'content-type: application/json' -d '{"date": "2026-08-10"}' https://httpbin.org/post

Incoming requests work the same way — log every request as a command you can replay:

from curlify3 import SENSITIVE_HEADERS, to_curl_async

@app.middleware("http")
async def log_request_as_curl(request, call_next):
    logger.info(await to_curl_async(request, mask_headers=SENSITIVE_HEADERS))
    return await call_next(request)

Features

  • to_curl() and to_curl_async() for requests, niquests, httpx, httpx2, aiohttp, tornado, urllib.request, and server-side starlette / fastapi, aiohttp.web, django, flask / werkzeug, tornado
  • Every value quoted for the shell, so commands rendered from untrusted requests are safe to paste
  • POSIX shell or Windows PowerShell output, one-line or pretty
  • Per-call header filtering and secret masking
  • A pytest plugin that attaches the commands of a failing test to its report, and a Robot Framework library
  • Zero runtime dependencies, fully typed

Documentation

shpaker.github.io/curlify3 — guides, supported request objects, payload handling, API reference.

Changelog · Contributing · Security · MIT License

Metadata

Release files for curlify3 0.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for curlify3 0.15
File Size Uploaded
curlify3-0.15.tar.gz 25.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for curlify3 0.15
File Interpreter ABI Platform
curlify3-0.15-py3-none-any.whl Python 3 none any Details

Total release size: 57.5 kB

Release files / curlify3-0.15.tar.gz

Download URL curlify3-0.15.tar.gz
Size 25.8 kB
Tags Source
SHA-256 checksum
How to use checksums
310605c8aad746411b797fb22b0bdaa9ae14e4ea6144dd00588e253675abb4a7
BLAKE2b-256 checksum
How to use checksums
3c72d4b78a7fed0fe351399dfa8b7a9c0b1e9ccc74edf8ac4a1a560066ba7d7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / curlify3-0.15-py3-none-any.whl

Download URL curlify3-0.15-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9efc10a6dbc7698a9f07e50b37e0e88f51a6508fe265153dee9db7ebd5e7a3f
BLAKE2b-256 checksum
How to use checksums
71fa6d8a4f0f35ae5a52c7dc7876efc3c50e6bd326959531f9fbcc8ba909ae62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.15 This release

2 release files

0.14

2 release files

0.13

2 release files

0.12

2 release files

0.11

2 release files

0.10

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page