jarg
jarg is an encoding shorthand for your shell. It is a command-line utility that makes generating data in formats like JSON, YAML, and form encoding easier in the shell.
Installation
Install from PyPI:
$ pip install jarg
Usage
Each argument to jarg should be in the format of name=value. Values are interpreted as their closest native encoding value, and the default dialect is JSON. The most common case is probably string names and values:
$ jarg foo=bar baz=quux
{"foo": "bar", "baz": "quux"}
Floats and integers will work too:
$ jarg foo=10 bar=4.2
{"foo": 10, "bar": 4.2}
The value is optional. If you leave it out, it is interpreted as null:
$ jarg foo
{"foo": null}
The name portions have the same syntax and semantics as HTML JSON names:
$ jarg foo[]=bar foo[]=baz bar[baz]=quux
{"foo": ["bar", "baz"], "bar": {"baz": "quux"}}
You can also write literal values directly, using the name:=value syntax. That lets you write things like booleans, lists, and explicit strings:
$ jarg foo:=true bar:=\"123\"
{"foo": true, "bar": "123"}
$ jarg foo:=[1,2,3]
{"foo": [1, 2, 3]}
Dialects
The default dialect is JSON, and includes support for YAML and form encoding.
To use the YAML dialect, use the -y/--yaml switch:
$ jarg -y name=jarg type="cli tool" traits[]=dope traits[]=rad --- name: jarg traits: [dope, rad] type: cli tool
You can switch to the form encoding dialect with the -f/--form switch:
$ jarg -f foo=bar baz="jarg is dope" foo=bar&baz=jarg+is+dope
Metadata
Release files for jarg 0.4.1
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 |
|---|---|---|---|---|
| jarg-0.4.1.tar.gz | 4.8 kB | Without provenance | Details for jarg-0.4.1.tar.gz |
Release files / jarg-0.4.1.tar.gz
| Download URL | jarg-0.4.1.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
053c9999897b0e2c22d89b65d7c670294b4125f1f1750de376bb13e9e856dcf1
|
|
BLAKE2b-256 checksum How to use checksums |
5e479fc5a51cb7fd48fa0fd34b853368560b427bfe1e7985e29df067cf459940
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for jarg 0.4.1
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.