Skip to main content

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)

Source distribution for curlify2 2.0.0
File Size Uploaded
curlify2-2.0.0.tar.gz 2.5 kB Details

Built distribution (wheel)

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

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

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

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