The library convert python 'requests' and 'httpx' object in curl command. Curlify2 is a enhancement of curlify.
Installation
To install the library use pip or poetry command, see:
$ pip install curlify2
or poetry:
$ poetry add curlify2
Usage
using requests module:
from curlify2 import Curlify
import requests
URL = "https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f"
request = requests.get(URL)
response = Curlify(request.request)
print(response.to_curl()) # curl -X GET -H "User-Agent: python-requests/2.24.0" -H "Accept-Encoding: gzip, deflate" -H "Accept: */*" -H "Connection: keep-alive" -d 'None' https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f
using httpx module:
import curlify2
import httpx
URL = "https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f"
request = httpx.get(URL)
response = Curlify(request.request)
print(response.to_curl()) # curl -X GET -H "User-Agent: python-requests/2.24.0" -H "Accept-Encoding: gzip, deflate" -H "Accept: */*" -H "Connection: keep-alive" -d 'None' https://run.mocky.io/v3/b0f4ffd8-6696-4f90-8bab-4a3bcad9ef3f
Metadata
Release files for curlify2 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| curlify2-2.0.0.tar.gz | 2.5 kB | Without provenance | Details for curlify2-2.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| curlify2-2.0.0-py3-none-any.whl | Python 3 | none | any | Details for curlify2-2.0.0-py3-none-any.whl |
Total release size: 5.6 kB
Release files / curlify2-2.0.0.tar.gz
| Download URL | curlify2-2.0.0.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c3a98dc8603b76da990f58754b18ec4e9bfe5b881fc52d33ddf9d9096568809
|
|
BLAKE2b-256 checksum How to use checksums |
91243803baab3519ee855b6f6f6a81dca7af1ff8640bccb177765a227df9f835
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.2 Darwin/22.5.0
|
Release files / curlify2-2.0.0-py3-none-any.whl
| Download URL | curlify2-2.0.0-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
23878b13fa33ed92ae5dff0476e5b881b39fc79a5fcb37e6726f96239a136474
|
|
BLAKE2b-256 checksum How to use checksums |
43db8428ec3fa111a69db05de651ac7378b3b3eb8b558dd1cd7d262f4904c200
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.2 Darwin/22.5.0
|
Security for curlify2 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.