ShellArgParser
A simple python tool to parse any arg / kwarg arguments in a manner that is easy to parse for the linux shell.
I don't understand
For example:
uvx ShellArgParser@latest a_file --test=something -a -b -no-c another_file
Will print this text:
ARGS_1="a_file"
ARGS_2="another_file"
ARGS_TEST="something"
ARGS_A=1
ARGS_B=1
ARGS_C=0
So running this:
eval $(uvx ShellArgParser@latest --test=something -a -b -no-c)
Will parse the args and kwargs as shell environment variables, handy for use in the shell:
echo $ARGS_TEST # outputs 'something'
But why would you make this?
Handling user arguments are a major annoyance for me in shell, and in python using fire makes it a breeze, so it's is a great way to avoid reinventing the wheel.
Hence, when writing a small shell script, using a python cli tool oneliner makes is a real time saver for me.
Notes:
-somethingis parsed asARGS_SOMETHING=1-no-somethingis parsed asARGS_SOMETHING=0-no_somethingis parsed asARGS_SOMETHING=0- Any
Nonepython value is parsed as0 - A prototype 'pure shell' version of this script can be found in
./ShellArgParser.sh
Getting started
- From pypi:
- As a uv tool:
uvx ShellArgParser@latest --help - Via uv:
uv pip install ShellArgParser - Via pip:
pip install ShellArgParser
- As a uv tool:
- From github:
- Clone this repo then
pip install .
- Clone this repo then
Metadata
Release files for ShellArgParser 0.2.4
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 |
|---|---|---|---|---|
| shellargparser-0.2.4.tar.gz | 14.9 kB | Without provenance | Details for shellargparser-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shellargparser-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for shellargparser-0.2.4-py3-none-any.whl |
Total release size: 30.5 kB
Release files / shellargparser-0.2.4.tar.gz
| Download URL | shellargparser-0.2.4.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
004ef111da6ab68f8ea133d7751571f1cc70109bbc8e7c3c4670b9ba880ddfa3
|
|
BLAKE2b-256 checksum How to use checksums |
2e508a591cef17ebd1e41553a58c18284730b9f50c90324b53a8ef051688105d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.14
|
Release files / shellargparser-0.2.4-py3-none-any.whl
| Download URL | shellargparser-0.2.4-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8cc19bbeff0cb558a4a41f715155956f620de1e5815434a9c64f1cd80b17e37e
|
|
BLAKE2b-256 checksum How to use checksums |
948b34158fab6dc158cc3b75be96bdc32d55276f1935ea4b58c2ec159f8a779f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.14
|
Security for ShellArgParser 0.2.4
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.