A Library to Convert Curl to Python Requests File
Project description
curl2pyreqs
A library to convert curl to python requests file.
Install
$ pip install curl2pyreqs
Usage
Use as binary to export curl request to python script.
$ curl2pyreqs -F example.curl
Convertion Finished.
Please open multi_test.py to check the code.
Convert a curl string to python-requests, copyed from Chrome or Firefox:
>>> from curl2pyreqs import parseCurlString
>>> output = parseCurlString("""curl -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8' -H 'accept-language: en-US,en;q=0.5' --compressed -H 'upgrade-insecure-requests: 1' -H 'te: trailers' https://pypi.org/""")
>>> print(output)
Convert curl file stream to python-requests, copyed from Chrome or Firefox:
>>> from curl2pyreqs import parseCurlFile
>>> output = parseCurlFile('./example.curl')
>>> print(output)
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
Close
Hashes for curl2pyreqs-0.0.1.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 000f50209652be000838fa2ec8e1f1c06efcebc93078189fda4006f8da188c22 |
|
MD5 | b58d2614c3a30c456b2281d84ea179cb |
|
BLAKE2b-256 | 6973e36af9564fa5db844c559d3299b68f9b752ea13fd2c6315b3efac8322680 |