cURL converter · Python
cURL to Python
Paste a curl command and get idiomatic Python. We pick json= over data= when Content-Type says JSON, emit auth=(user, pass) tuples for -u, and translate -F uploads into files={...}.
- Language
- Python
- Default library
- requests
- Code targets
- 3 (requests, httpx, aiohttp)
- Guides
- 19
- Native feature handling
- requests (default target) handles 9 of 12 curl features
- Runs
- Entirely in your browser
Top guides for Python
All guides →POST in Python
/how-to/curl-post-in-python
GET in Python
/how-to/curl-get-in-python
JSON in Python
/how-to/send-json-with-curl-in-python
multipart form-data in Python
/how-to/send-multipart-with-curl-in-python
Bearer token in Python
/how-to/curl-bearer-auth-in-python
Basic auth in Python
/how-to/curl-basic-auth-in-python
Common questions
- Which library should I use?
- requests is the default for scripts. httpx if you also need async or HTTP/2. aiohttp if you're already inside asyncio and want session pooling.
- Does it handle JSON correctly?
- Yes. When Content-Type: application/json is set and the body parses, we emit json={...} so requests serializes and sets the header for you.
- What about basic auth and cookies?
- -u alice:s3cret becomes auth=('alice', 's3cret'); -b or --cookie is folded into the Cookie header.
- Is my curl sent anywhere?
- No. Parsing and code generation happen entirely in your browser.
Also convert cURL to
All guides →Same parser, same idiomatic output — swap the target language whenever your stack changes. Every hub carries its own reference guides for methods, payloads, and auth.