argumentor
argumentor is a simple and lightweight library to build complex command-line tools.
Features
- Differenciate commands from options
- Define aliases for commands and options
- Automatically generate help pages
- Set default values
- No external dependencies
Installation
Using pip
The argumentor library can be installed from the Python Package Index (PyPI):
$ pip install argumentor
Installing from source
Using pip, it is also possible to install a package directly from source.
First clone the source code repository hosted on Codeberg:
$ git clone https://codeberg.org/camelia/python-argumentor argumentor
Then, enter the local repository and install argumentor (you may want to use a virtual environment):
$ cd argumentor
$ pip install .
Usage
Below is a minimalist code snippet that aims to demonstrate some basic uses of argumentor:
import sys
from argumentor import Argumentor
from argumentor.exc import ParsingError
argm = Argumentor("program-name")
argm.register_command(
"cmd1",
description="command 1",
)
argm.register_command(
"cmd2",
description="command 2",
)
argm.register_option(
"--opt",
"-o",
description="global option 1",
)
try:
cmd, opts = argm.parse()
except ParsingError as err:
print(err)
sys.exit(1)
More information about usage can be found in the documentation.
License
argumentor is free software! You are free to use, copy, modify, share and redistribute it under the terms of the GNU Lesser General Public License, version 3 or later.
Metadata
Release files for argumentor 2.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 |
|---|---|---|---|---|
| argumentor-2.3.0.tar.gz | 22.6 kB | Without provenance | Details for argumentor-2.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| argumentor-2.3.0-py3-none-any.whl | Python 3 | none | any | Details for argumentor-2.3.0-py3-none-any.whl |
Total release size: 41.0 kB
Release files / argumentor-2.3.0.tar.gz
| Download URL | argumentor-2.3.0.tar.gz |
|---|---|
| Size | 22.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d511acecb5ca989e4621d0497632f975b627cb1a67aaa160ca7dec3508987e8
|
|
BLAKE2b-256 checksum How to use checksums |
487a150b26e02854d3b18fd48c2cbf398f63f0fbe0edfeaef09f28828b2950c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.12
|
Release files / argumentor-2.3.0-py3-none-any.whl
| Download URL | argumentor-2.3.0-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d59410c23260dfdcc64235629bd0dd6a15850538d3a4a04c962c24bf98a667e2
|
|
BLAKE2b-256 checksum How to use checksums |
aeda5cbeff2248dace05c89f195c482e337afc9b87363a7d7927c403b28a37a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.12
|
Security for argumentor 2.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.