Skip to content

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 →

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.