jarguments
simplifying args jargon
Summary
Provides a straightforward way to create command line arguments.
- 🐍 Supports Python 3.8 and above. Tested on Windows 10.
- 🚧 This project is still in development. Contributions are welcome!
- ⭐ Show your support by leaving a star!
Contents
Installation
python -m pip install --upgrade jarguments
Usage
There are three steps to using the jarguments library:
-
Import the jarguments library.
from jarguments import create, parse
-
Provide your arguments with jarguments' classes.
# argument parser args = parse.JParser( # boolean argument create.JBool('show-text', helpstring='determines whether "text" is shown'), # integer argument create.JInt('number', default=1), # string argument create.JStr('text'), )
-
Use the outputs; they're parsed automatically!
if args.show_text: for _ in range(args.number): print(args.text)
Now it works just like any other command line application.
$ python example.py --show-text --text "hello" "world"
["hello", "world"]
-
Arguments without a default value are required. If you don't provide them, the script will raise an error:
$ python example.py --show-text error: the following arguments are required: --text
-
The
--help/-hflag displays help messages:$ python example.py -h usage: example.py [-h] [--show-text [SHOW_TEXT]] [--number NUMBER] --text [TEXT ...] options: -h, --help show this help message and exit --show-text [SHOW_TEXT] determines whether "text" is shown --number NUMBER --text [TEXT ...]
Metadata
Release files for jarguments 0.3.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 |
|---|---|---|---|---|
| jarguments-0.3.0.tar.gz | 5.4 kB | Without provenance | Details for jarguments-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jarguments-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for jarguments-0.3.0-py3-none-any.whl |
Total release size: 12.0 kB
Release files / jarguments-0.3.0.tar.gz
| Download URL | jarguments-0.3.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b7c104703906d1ecc2e0cb92ad820cf96b68fd852f4fc528acaf9bcbd605ca35
|
|
BLAKE2b-256 checksum How to use checksums |
dc5834242393f55128168f613f216232b321bf0bfb592e6a7d57850ef353ac0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / jarguments-0.3.0-py3-none-any.whl
| Download URL | jarguments-0.3.0-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a085b40de43dd4b356943e8caa28d6c484aecf0ee498c1ecc6e1cc8f8cf25b3c
|
|
BLAKE2b-256 checksum How to use checksums |
8f00c0119a433390d8c6ac1bb7db976961580b3868455d91672ba4352a5c92a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Security for jarguments 0.3.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.