Skip to content

smjt2000/argman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
  • Positional arguments
  • Automatic --no-flag for booleans
  • --arg=value and -- terminator support
  • Clean help and error messages
  • Config file support (JSON) via load_config()
  • Export parsed args via dump_args()

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)
  • custom argv support(e.g., ArgMan(argv=['prog', '--num', '5']))

v0.3 — Docs & Publish

  • Docs ready
  • Publish to PyPI

v0.4 — Validation & Customization

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

License

LGPL-3.0 © 2025

About

A lightweight and minimal Python library for managing command-line arguments.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages