Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

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.

from curl_to_requests import curl_to_requests

curl_cmd = '''curl '' \\
-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:' \\
-H 'Connection: keep-alive' --compressed'''

print curl_to_requests.curl_to_requests(curl_cmd)
Release History

Release History

This version
History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
curl_to_requests-1.0.1-py2-none-any.whl (11.2 kB) Copy SHA256 Checksum SHA256 py2 Wheel Jul 9, 2015
curl_to_requests-1.0.1.tar.gz (10.0 kB) Copy SHA256 Checksum SHA256 Source Jul 9, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting