CurliPie
Python library to convert cURL command to HTTPie.
It will convert
curl -d name=admin -d shoesize=12 -d color=green&food=wet http://quan.hoabinh.vn
to
http -f http://quan.hoabinh.vn name=admin shoesize=12 color=green food=wet
Motivation
This library was born when I joined a project with a team of non-Linux, non-Python developers. Because the project didn’t have proper documentation, the other team often shared API usage example to me in form of cURL command, generated from their daily-used Postman. Those cURL commands are usually ugly, like this:
curl --location --request POST 'http://app-staging.dev/api' \
--header 'Content-Type: application/json' \
--data-raw '{
"userId": "abc-xyz",
"planAmount": 50000,
"isPromotion": false,
"createdAt": "2019-12-13 10:00:00"
}'
I am more comfortable with HTTPie (shorter syntax, has highlighting and is a Python application), so I often converted it to HTTPie:
http -F app-staging.dev/api userId=abc-xyz planAmount:=50000 isPromotion:=false createdAt='2019-12-13 10:00:00'
Though Postman can generate HTTPie, it does result in even uglier command:
printf '{
"userId": "abc-xyz",
"planAmount": 50000,
"isPromotion": false,
"createdAt": "2019-12-13 10:00:00"
}'| http --follow --timeout 3600 POST app-staging.dev/api \
Content-Type:'application/json'
Initially, I had to do conversion manually and quickly got tired from it. I tried to find a conversion tool but failed. There is an online tool curl2httpie.online, but it failed with above example. So I decide to write my own tool.
I don’t bother to help fix the online tool above, because it is written in Go. The rich ecosystem of Python, with these built-in libraries, enable me to finish the job fast:
shlex: Help parse the command line in form of shell language, handle the string escaping, quoting for me.
argparse: Help parse cURL options and arguments. Note that, cURL arguments syntax follow GNU style, which is common in Linux (and Python) world but not popular in Go world (see this tutorial), so it feels more natural with Python.
Usage
Command-line
When installed, CurliPie registers a curlipie command:
# Pass the cURL command as an argument
curlipie "curl -X POST http://api.example.com -d 'name=admin'"
# Or pipe from stdin (handy with clipboard tools)
echo "curl http://example.com --user admin:secret" | curlipie
# Run with no arguments to enter interactive mode — paste your cURL command
# (including multi-line backslash-continued commands from Postman or Swagger),
# then press Enter twice or Ctrl-D to convert
curlipie
# Use long-form HTTPie options instead of short flags
curlipie --long "curl -L -X DELETE http://api.example.com/users/1"
# Show help
curlipie --help
Python library
>>> from curlipie import curl_to_httpie
>>> curl = """curl -XPUT elastic.dev/movies/_doc/1 -d '{"director": "Burton, Tim", "year": 1996, "title": "Mars Attacks!"}' -H 'Content-Type: application/json'"""
>>> curl_to_httpie(curl)
ConversionResult(httpie="http PUT elastic.dev/movies/_doc/1 director='Burton, Tim' year:=1996 title='Mars Attacks!'", errors=[])
>>> result = curl_to_httpie(curl)
>>> result.httpie
"http PUT elastic.dev/movies/_doc/1 director='Burton, Tim' year:=1996 title='Mars Attacks!'"
Online tool
CurliPie is not very usable if it stays in library form, so I made an online tool for you to use it quickly:
The site also provide HTTP API for you to develop a client for it.
Development
This repo contains three components:
Python library curlipie. This is the one published to PyPI.
An API server built with FastAPI, playing role of backend for curlipie.open-api.vn.
A minimal frontend app built with AlpineJS and EncreCSS (CSS class names following TailwindCSS convention).
Python dependencies are managed with uv.
To try running on localhost:
Run backend with:
uvicorn api.main:appThe front-end are just static files, served by backend also, so you can access it via http://localhost:8000/. The CSS is generated depending on which CSS classes are used.
./tools/generate-css.sh
Unit test:
pytest
Credit
Brought to you by Nguyễn Hồng Quân.
Metadata
Release files for curlipie 0.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| curlipie-0.0.0.tar.gz | 13.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| curlipie-0.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.5 kB
Release files / curlipie-0.0.0.tar.gz
| Download URL | curlipie-0.0.0.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60bc66f794e669fb19699eb0d676a85f876c269fde9f49d593cb05579b49c9cb
|
|
BLAKE2b-256 checksum How to use checksums |
c6c7aecb22d05258eae2dcf41c006cbddd39acb34c03cb28e7e92a7027b187f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / curlipie-0.0.0-py3-none-any.whl
| Download URL | curlipie-0.0.0-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ee8568843e114a7626e106b366c933df00fa1302ee190402f45f6cb37d41c5a
|
|
BLAKE2b-256 checksum How to use checksums |
c539121677db90c3d4231405ea5e258af022653a40c09a86e82eef047ebf035f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency log