Metadata-Version: 2.5
Name: curlify3
Version: 0.15
Summary: Convert request objects from popular Python HTTP libraries into ready-to-run curl commands
Project-URL: Repository, https://github.com/shpaker/curlify3
Project-URL: Documentation, https://shpaker.github.io/curlify3/
Project-URL: Changelog, https://github.com/shpaker/curlify3/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/shpaker/curlify3/issues
Author-email: "A.Shpak" <shpaker@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: aiohttp,curl,debugging,django,fastapi,flask,http,httpx,logging,pytest,requests,robotframework
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Pytest
Classifier: Framework :: Robot Framework :: Library
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Debuggers
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: robot
Requires-Dist: robotframework>=6.1; extra == 'robot'
Description-Content-Type: text/markdown

# curlify3

[![PyPI](https://img.shields.io/pypi/v/curlify3.svg)](https://pypi.python.org/pypi/curlify3)
[![Downloads](https://img.shields.io/pypi/dm/curlify3.svg)](https://pypi.python.org/pypi/curlify3)
[![Python](https://img.shields.io/pypi/pyversions/curlify3.svg)](https://pypi.python.org/pypi/curlify3)
[![Tests](https://github.com/shpaker/curlify3/actions/workflows/tests.yml/badge.svg)](https://github.com/shpaker/curlify3/actions/workflows/tests.yml)
[![Docs](https://img.shields.io/badge/docs-shpaker.github.io%2Fcurlify3-blue)](https://shpaker.github.io/curlify3/)

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

```sh
pip install curlify3
```

```python
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:

```python
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](https://shpaker.github.io/curlify3/)** — guides, supported request objects, payload handling, API reference.

[Changelog](https://github.com/shpaker/curlify3/blob/main/CHANGELOG.md) · [Contributing](https://github.com/shpaker/curlify3/blob/main/CONTRIBUTING.md) · [Security](https://github.com/shpaker/curlify3/blob/main/SECURITY.md) · [MIT License](https://github.com/shpaker/curlify3/blob/main/LICENSE)
