argumentor is a simple and lightweight library to build complex command-line tools. https://pyargumentor.camelia.dev
  • Python 99%
  • Just 0.6%
  • Shell 0.3%
  • HTML 0.1%
Find a file
Image Camelia Lavender e49ba1b55f
Image
All checks were successful
Testing / test (pull_request) Successful in 10s
Testing / lint (pull_request) Successful in 20s
Testing / test-build (pull_request) Successful in 9s
Testing / test (push) Successful in 10s
Testing / lint (push) Successful in 20s
Testing / test-build (push) Successful in 9s
Publish / check-version (release) Successful in 8s
Deploy / deploy (release) Successful in 41s
Publish / build (release) Successful in 12s
Publish / publish (release) Successful in 10s
update CHANGELOG
2026-03-08 14:57:52 +01:00
.forgejo update CI config 2025-12-13 14:11:51 +01:00
docs add program description in Builder.__init__ 2026-03-08 14:54:05 +01:00
src/argumentor bump version number 2026-03-08 14:56:52 +01:00
templates ci: deploy docs to codeberg pages on release 2025-11-24 21:43:57 +01:00
tests add program description in Builder.__init__ 2026-03-08 14:54:05 +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 update CHANGELOG 2026-03-08 14:57:52 +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 fixup! argumentor 2.1.0 2026-01-19 03:21:32 +01:00
pyproject.toml argumentor 2.1.0 2026-01-19 03:14:38 +01:00
README.md argumentor 2.1.0 2026-01-19 03:14:38 +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.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.

LGPLv3 badge