1
2
Fork
You've already forked python-argumentor
2
argumentor is a simple and lightweight library to build complex command-line tools. https://pyargumentor.camelia.dev
Python 98.7%
Just 0.7%
Shell 0.4%
HTML 0.2%
Camelia Lavender 88f659b9a0
All checks were successful
Testing / test (push) Successful in 19s
Testing / test-build (push) Successful in 9s
Testing / lint (push) Successful in 23s
add issue templates
2025年11月30日 22:30:39 +01:00
.forgejo add issue templates 2025年11月30日 22:30:39 +01:00
docs finish writing documentation 2025年11月30日 17:13:59 +01:00
src/argumentor finish writing documentation 2025年11月30日 17:13:59 +01:00
templates ci: deploy docs to codeberg pages on release 2025年11月24日 21:43:57 +01:00
tests add support for '--' arg to disable parsing 2025年11月25日 14:08:43 +01:00
.gitignore ci: deploy docs to codeberg pages on release 2025年11月24日 21:43:57 +01:00
.mailmap add git mailmap 2025年10月16日 00:28:24 +02:00
.pylintrc add docstrings everywhere 2025年11月25日 14:38:06 +01:00
CHANGELOG.md fix CHANGELOG 2025年11月30日 19:33:23 +01:00
checkver.sh add CI workflow to automatically publish releases on pypi 2025年11月25日 15:30:43 +01:00
justfile ci: deploy docs to codeberg pages on release 2025年11月24日 21:43:57 +01:00
LICENSE modified README 2021年11月13日 22:02:56 +01:00
mkdocs.yml add site_url to mkdocs config 2025年11月30日 19:14:03 +01:00
pyproject.toml fix linting errors 2025年11月22日 19:46:22 +01:00
README.md fix documentation link in README 2025年11月30日 19:44:05 +01:00
setup.cfg fix linting errors 2025年11月22日 19:46:22 +01:00

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.add_command(
 "cmd1",
 description="command 1",
)
argm.add_command(
 "cmd2",
 description="command 2",
)
argm.add_option(
 "--opt",
 description="global option 1",
)
argm.add_option_alias("-o", "--opt")
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.

LGPLv3 badge