curlike
A curl that works everywhere Python does. pycurl is a
curl-compatible command in pure Python, over the standard library, with
curl's exit codes and messages, checked line for line against real curl; and
curlike is the library behind it. It never runs the real curl.
Documentation: https://jose-pr.github.io/curlike/.
Features
- Answers as curl does — the common surface (request,
auth, body, output, downloads, TLS, proxies including SOCKS and https
proxies, redirects, cookies,
-w,--retry). The exit codes and messages are measured against curl's own builds, and the version it imitates is configurable. - Fails loud — an option it does not implement is
curl: (2) Unsupported options: …, never silently ignored. - Your own TLS context — from Python,
curlike.main(argv, ssl_context=...)runs the curl command line over a context you built: mutual TLS with a keystore identity, a cipher list, a pinned protocol version. - The system's proxy — syshttp
routes it:
SYSHTTP_PROXY, the*_PROXYvariables, else the system's configuration for the URL (PAC and WPAD included), itsprefix[:/endpoint]gateways included.
Installation
pip install curlike
| Extra | Adds | Needed for |
|---|---|---|
dns |
netimps |
--dns-servers, --dns-ipv4-addr, --dns-ipv6-addr, --dns-interface, --doh-url, --interface by name |
Quick start
import curlike
rc = curlike.main(["-s", "-o", "page.html", "https://example.com/"])
Mutual TLS with a context of your own:
import ssl
import curlike
ctx = ssl.create_default_context()
ctx.load_cert_chain("client.pem", "client.key")
rc = curlike.main(["-s", "https://mtls.example/"], ssl_context=ctx)
Command line
pycurl https://example.com
pycurl -s -o out.json -H 'Accept: application/json' https://api.example.com/x
python -m curlike -X POST --json '{"k":1}' https://httpbin.org/post
API overview
| Module | Purpose |
|---|---|
curlike |
main() / run_fallback(): the command; caller_steering(), requested_url(), find_real_curl(), describe_curl() for a launcher |
The other modules hold the command's option groups and transfer machinery and are private.
Settings
Every variable has a full name, read under each prefix of SYSHTTP_PREFIX
(a :-separated list of literal prefixes; none by default, so the names as
written): SYSHTTP_PREFIX=AGENTS_ reads AGENTS_SYSHTTP_PROXY,
AGENTS_HTTPS_PROXY and AGENTS_NO_PROXY and nothing unprefixed, AGENTS_:
falls back to the plain names.
| Variable | Sets |
|---|---|
SYSHTTP_PREFIX |
the prefixes the variables below are read under (all but CURL_CA_BUNDLE) |
SYSHTTP_PROXY and the other SYSHTTP_* proxy settings, HTTP_PROXY / HTTPS_PROXY / ALL_PROXY, NO_PROXY |
the proxy and its bypass list, as syshttp reads them |
CURLIKE_PYLIB |
where to find duho when it is not installed: for a host tool that runs curlike from a zipapp (.pyz) or a vendored directory |
CURL_CA_BUNDLE |
the CA bundle, as in curl: read as written, under no prefix |
Development
dotagents pyvenv # or any Python 3.9+ virtual environment
.pyvenv/<tag>/Scripts/python -m pip install -e ../syshttp -e ".[dev]"
.pyvenv/<tag>/Scripts/python -m pytest -q
The parity tests compare curlike with the real curl on PATH, and are skipped when there is none.
Releasing
This project follows Semantic Versioning and keeps a
CHANGELOG.md.
Pushing a tag matching v* triggers the release workflow: test gate → build
(checking the tag names the version built) → a strict docs build as a gate →
GitHub release → publish. The release workflow never deploys the docs site
itself: for a final release its last job dispatches the docs workflow at the
tag, which owns every Pages deploy.
License
MIT — see LICENSE.
Metadata
Release files for curlike 0.1.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 | Provenance | |
|---|---|---|---|---|
| curlike-0.1.0.tar.gz | 174.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| curlike-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 283.8 kB
Release files / curlike-0.1.0.tar.gz
| Download URL | curlike-0.1.0.tar.gz |
|---|---|
| Size | 174.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
23ee3387f73c88721e3049f5b8ccbf6d1c57f2953311410104897dc882ee2285
|
|
BLAKE2b-256 checksum How to use checksums |
7165f90859cf2c8ea1ca2ca3aab4d596727bf6fe935dc2eeca81c5c5a338317e
|
| 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 Oct 20, 2026.
Transparency logRelease files / curlike-0.1.0-py3-none-any.whl
| Download URL | curlike-0.1.0-py3-none-any.whl |
|---|---|
| Size | 109.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
588c54ad132a431b96c3957ffa452707c6d50648e295d38473f31f96e3767672
|
|
BLAKE2b-256 checksum How to use checksums |
5aa84282b765f67118ee750a14cbb5d54dcb6d52fa09a28d5bf5ac80d1edd1b1
|
| 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 Oct 20, 2026.
Transparency logSecurity for curlike 0.1.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for curlike-0.1.0.tar.gz
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 Oct 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.