--- id: simple-parsing version: "0.1.9" license: MIT License Copyright (c) 2019 Fabrice Normandin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) license_treatment: permissive maintenance: active --- # simple-parsing — A small utility to simplify and clean up argument parsing scripts. License: permissive · Maintenance: active · Downloads: 4.3M/mo ## What it is and what it does simple-parsing wraps Python's argparse to let you define command-line arguments as dataclasses instead of repeated add_argument() calls. It generates help text from docstrings and field comments, handles nested and inherited dataclasses, and supports serialization to json/yaml. The core idea is reducing boilerplate: instead of copy-pasting argument definitions, you define an Options dataclass once and reuse it with automatic prefixing for multiple argument groups. You use it by creating a dataclass with typed fields, then passing it to ArgumentParser.add_arguments() or calling simple_parsing.parse() directly. It depends on docstring-parser to extract help text from comments and typing-extensions for type annotation support. The package requires Python 3.9 or later. Use it for: - Machine learning projects where you need to parse training, validation, and test configurations with identical structure but different prefixes. - Reusing argument definitions across multiple CLI tools in the same codebase without copy-pasting argparse boilerplate. - Generating clean, auto-documented --help output from dataclass field comments and docstrings. - Saving and loading command-line configurations to/from json or yaml files for reproducibility. - Building nested argument hierarchies where subcommands or modules each have their own configuration dataclass. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Transforms argparse scripts into structured, typed command-line interfaces using dataclasses, with support for nesting, inheritance, and automatic help generation from docstrings. Yes. Low install friction, no known vulnerabilities, MIT license, and active maintenance make it a safe choice. It genuinely reduces argparse boilerplate for projects using dataclasses, especially those with reusable or nested argument groups. Suitable for both small scripts and larger CLI applications. ## Install pip install simple-parsing uv add simple-parsing poetry add simple-parsing ## Installing simple-parsing Before you install: Low friction: pure Python wheel with only two runtime dependencies (docstring-parser and typing-extensions). Actively maintained with recent release. License in practice: MIT License permits unrestricted use, modification, and distribution with minimal obligations—suitable for any project type. Quickstart: from dataclasses import dataclass from simple_parsing import ArgumentParser @dataclass class Options: log_dir: str learning_rate: float = 1e-4 parser = ArgumentParser() parser.add_arguments(Options, dest="options") args = parser.parse_args() print(args.options) Requires Python 3.9 or later. Verify before relying: - Whether nesting depth has practical limits or performance implications at scale. - Whether serialization to json/yaml handles all dataclass field types automatically or requires custom handlers. - Performance characteristics when parsing very large numbers of arguments or deeply nested structures. ## Package facts - License: MIT License Copyright (c) 2019 Fabrice Normandin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 4.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags typed argument parsing, dataclass command line arguments, argparse wrapper, structured CLI arguments, nested command line config, automatic help from docstrings, reusable argument groups, cli-framework, dataclass-driven [View on SkillFed](https://skillfed.io/packages/simple-parsing) · [View on PyPI](https://pypi.org/project/simple-parsing/)