curlrc
Treat curl configuration files as curlrc subcommands.
Usage
curl can read arguments from a configuration file. You can use this mechanism to specify default arguments (as ~/.curlrc), or tell curl to read arguments from a specific file:
curl -K @/path/to/config.rc
Create a few config files and drop them in ~/.curl (or $CURL_HOME if set):
~/.curl └── example.rc
curlrc exposes configuration files as subcommands:
$ curlrc example
If the configuration file includes an output template, you can reformat the data as CSV, tab-separated columns, or JSON:
$ curlrc example -f csv https://example.org $ curlrc example -f table https://example.org $ curlrc example -f json https://example.org
Any options you pass to curlrc after -- will be passed to curl:
$ curlrc example -- -fsSL https://example.org
Example
Consider the following configuration file:
# output timing data
-s
-S
-o = /dev/null
-w = "url_effective: %{url_effective}\ntime_namelookup: %{time_namelookup}\ntime_connect: %{time_connect}\ntime_appconnect: %{time_appconnect}\ntime_pretransfer: %{time_pretransfer}\ntime_redirect: %{time_redirect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n"
If you drop this in ~/.curl/time.rc (or $CURL_HOME/time.rc), you can use it by calling curlrc time:
$ curlrc time https://example.org url_effective: https://example.org/ time_namelookup: 0.001 time_connect: 0.026 time_appconnect: 0.180 time_pretransfer: 0.180 time_redirect: 0.000 time_starttransfer: 0.210 time_total: 0.210
Don’t like the default format? Try CSV:
$ curlrc time -f csv https://example.org url_effective,time_namelookup,time_connect,time_appconnect,time_pretransfer,time_redirect,time_starttransfer,time_total https://example.org/,0.001,0.030,0.194,0.194,0.000,0.228,0.228
or tab-separated columns:
$ curlrc time -f table https://example.org url_effective https://example.org/ time_namelookup 0.002 time_connect 0.028 time_appconnect 0.177 time_pretransfer 0.177 time_redirect 0.000 time_starttransfer 0.205 time_total 0.206
or even JSON:
$ curlrc time -f json https://example.org
{
"url_effective": "https://example.org/",
"time_namelookup": "0.001",
"time_connect": "0.028",
"time_appconnect": "0.182",
"time_pretransfer": "0.182",
"time_redirect": "0.000",
"time_starttransfer": "0.213",
"time_total": "0.213"
}
Installation
curlrc requires Python 2.7 or later. It only depends on the standard library.
Download the latest release or install with pip:
pip install curlrc
Licence
MIT
Metadata
Release files for curlrc 0.2.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 | Actions |
|---|---|---|---|---|
| curlrc-0.2.0.tar.gz | 4.8 kB | Without provenance | Details for curlrc-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| curlrc-0.2.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for curlrc-0.2.0-py2.py3-none-any.whl |
Total release size: 11.7 kB
Release files / curlrc-0.2.0.tar.gz
| Download URL | curlrc-0.2.0.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fc5b202e3c1b637f9d9bc88a4047d27cda1a27f560b1afe2c465f186d1a903c7
|
|
BLAKE2b-256 checksum How to use checksums |
e726c9bf9e2feef0992ca1f9e7c13a19f2b4398039c860484ba93a81f917d189
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / curlrc-0.2.0-py2.py3-none-any.whl
| Download URL | curlrc-0.2.0-py2.py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
af2bf3424a9ecc87cdb225ad6582ce4bba30268750044b6d54cb674b33b8bc75
|
|
BLAKE2b-256 checksum How to use checksums |
7bfbce880de78402bcb38dd2f9d9600e9901c0eb8df2c949ed676f130f90f8dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for curlrc 0.2.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.