yet another library to convert request object to curl command
Project description
yet another library to convert request object to curl command
Support request's objects from:
- requests
- httpx
- httpx2 (adds
--http2to the curl) - aiohttp server
- starlette/fastapi
Requires Python 3.10+.
Installation
pip install curlify3
Example
from curlify3 import to_curl
import requests
response = requests.get("http://google.ru")
print(to_curl(response.request))
# curl -H 'user-agent: python-requests/2.32.3' -H 'accept-encoding: gzip, deflate' -H 'accept: */*' -H 'connection: keep-alive' http://www.google.ru/
httpx2 (HTTP/2)
import httpx2
from curlify3 import to_curl
req = httpx2.Request("GET", "https://httpbin.org/get")
print(to_curl(req))
# curl --http2 -H 'host: httpbin.org' https://httpbin.org/get
async
import asyncio, httpx
from curlify3 import to_curl_async
req = httpx.Request("POST", "https://httpbin.org/post", json={"a": 1})
print(asyncio.run(to_curl_async(req)))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
curlify3-0.6.tar.gz
(4.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file curlify3-0.6.tar.gz.
File metadata
- Download URL: curlify3-0.6.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99ac4c1c404a6cb40ab9f2b0f5217d4289126a0c387ba937ee35762079b7c91c
|
|
| MD5 |
98cc117872165a5e439341f573904120
|
|
| BLAKE2b-256 |
d966b2fc23943010b1a797c6ad1ad309006863414acf72b6e3081cf72382aa54
|
File details
Details for the file curlify3-0.6-py3-none-any.whl.
File metadata
- Download URL: curlify3-0.6-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e54917ea0bde52b366029ad825a9894d1c477c08c9f14db5c0ffd6e7d571c88c
|
|
| MD5 |
315de173a58beac79d90b7b5f1bb7fd2
|
|
| BLAKE2b-256 |
c8f77dca086c86daa9d6066d1d1bc8667c6564419a45d7dc02d6f6eb77148da5
|