Skip to main content

A lightweight argument manager for Python CLI tools

Project description

ArgMan

A lightweight, zero-dependency argument parser for Python CLI tools — simple, testable, and intuitive.

ArgMan example code

Features

  • Short (-v) and long (--verbose) flags
  • Type-safe parsing: int, float, str, bool, list
  • Default values and boolean toggles
  • Repeated arguments with arg_list
  • Automatic --no-flag for booleans
  • Positional arguments
  • --arg=value and -- terminator support
  • Clean help and error messages
  • Config file support (JSON) via load_config()
  • Export parsed args via dump_args()
  • Choices validation(choices=[...])
  • Custom validation(validator=...)
  • Relation between arguments: requires, conflicts

Documentation

Usage examples and API reference: docs/


Installation

You can install ArgMan directly from PyPi:

pip install argman

Running Tests

python -m unittest discover tests

Roadmap

v0.1 — Core Functionality

  • Complete

v0.2 — Extended Features

  • arg_list, --no-flag, --arg=value, -- support
  • Custom error messages
  • config files(load_config, dump_args)
  • subcommands(one level, must be first argument can be nested now)
  • custom argv support(e.g., ArgMan(argv=['prog', '--num', '5']))

v0.3 — Docs & Publish

  • Docs ready
  • Publish to PyPI

v0.4 — Validation & Customization

  • Choices: Limit argument values to a predefined set of allowed options.
  • Validators: Define custom checks for argument values (e.g., range, format).
  • Dependencies: Specify relationships between arguments (requires, conflicts).
  • Formatters: Apply custom transformations to parsed argument values (e.g., str.lower).

v0.5 — Argument Organization

  • Argument Groups: Show arguments in group in help message(group_args)
  • Color Output: Add color to help message
  • Hidden Arguments: Hidden in help message
  • Deprecated Arguments

v0.6 — Advanced Parsing Features

  • Count Arguments with arg_count: Track how many times flag appears(-vvv)
  • arg_dict method: Support for --env KEY=VALUE syntax
  • Range Values: Parse --pages 1-10 as range object
  • Argument Abbrevation: --verb matches --verbose

License

LGPL-3.0 © 2025

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

argman-0.4.1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

argman-0.4.1-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file argman-0.4.1.tar.gz.

File metadata

  • Download URL: argman-0.4.1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for argman-0.4.1.tar.gz
Algorithm Hash digest
SHA256 ecd23a91e578dbbf76807c5a44e408bd75035b57dc284772115903d293aaf404
MD5 2505bda6f710d2b0eeb0411394688a45
BLAKE2b-256 9ad034a59cddcd1ac23b87a4d18571b4d543745d17c120fa764271434e5b37ae

See more details on using hashes here.

File details

Details for the file argman-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: argman-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for argman-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 239d616d27af26ddbc55c9d4c987c7ee9573dce1a5771d6dcf19363975278628
MD5 be533cf81d0943c5b61e2a606d47199c
BLAKE2b-256 355fa85f4232e5eb9842d8ebafa90c236d14685b8c59fa5f80e961d7a4a4b153

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page