Converts cURL commands into equivalent Python Requests code
Project description
# curl_to_requests
curl_to_requests is a Python module that converts cURL commands into equivalent Python code using the requests library. Many cURL features are unsupported (it's a very complex piece of software), but curl_to_requests is far more complete than any of the other cURL converting utilities I've found.
Example:
```Python
from curl_to_requests import curl_to_requests
curl_cmd = '''curl 'https://github.com/mosesschwartz/curl_to_requests' \\
-H 'Accept-Encoding: gzip, deflate, sdch' \\
-H 'Accept-Language: en-US,en;q=0.8' \\
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36' \\
-H 'Accept: text/html, */*; q=0.01' \\
-H 'Referer: https://github.com/mosesschwartz/curl_to_requests' \\
-H 'Connection: keep-alive' --compressed'''
print curl_to_requests.curl_to_requests(curl_cmd)
```
curl_to_requests is a Python module that converts cURL commands into equivalent Python code using the requests library. Many cURL features are unsupported (it's a very complex piece of software), but curl_to_requests is far more complete than any of the other cURL converting utilities I've found.
Example:
```Python
from curl_to_requests import curl_to_requests
curl_cmd = '''curl 'https://github.com/mosesschwartz/curl_to_requests' \\
-H 'Accept-Encoding: gzip, deflate, sdch' \\
-H 'Accept-Language: en-US,en;q=0.8' \\
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36' \\
-H 'Accept: text/html, */*; q=0.01' \\
-H 'Referer: https://github.com/mosesschwartz/curl_to_requests' \\
-H 'Connection: keep-alive' --compressed'''
print curl_to_requests.curl_to_requests(curl_cmd)
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
curl_to_requests-1.0.1.tar.gz
(10.0 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 curl_to_requests-1.0.1.tar.gz.
File metadata
- Download URL: curl_to_requests-1.0.1.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df44f61689f9d91e33ec112b16358928150ca96ba39fe3c2d4adb13cb68c9032
|
|
| MD5 |
27e4140bae92d95186edb9f630fcc014
|
|
| BLAKE2b-256 |
1bf5cd4bb6d475a94cd057c63e6000fdc0fdeebf2222d711ea4fd02da92b0fe3
|
File details
Details for the file curl_to_requests-1.0.1-py2-none-any.whl.
File metadata
- Download URL: curl_to_requests-1.0.1-py2-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9759c4a36a56ce28e69cbb75d492387ed283ffe9a6e0ca7a41e958e684e3ec57
|
|
| MD5 |
1616b7372654ec2234d040dd0de6ab8f
|
|
| BLAKE2b-256 |
5d44ebe5865ebb44c45ec0e6e986248a84d5b03bfbd028455f3e5bfc7826870a
|