Skip to main content

A simple typed argument parser using dataclasses and type hints. This project is largely generated by ChatGPT.

Project description

SimpleArgParser

version log

  1. v0.1.9
    • add disable_cmd option to parse_args

Installation

pip install simpleArgParser

Introduction

This is a simple command line argument parser encapsulated based on Python dataclasses and type hints, supporting:

  • Defining arguments using classes (required, optional, and arguments with default values)
  • Nested dataclasses, with argument names separated by dots
  • JSON configuration file loading (priority: command line > code input > JSON config > default value)
  • List type arguments (supports comma separation)
  • Enum types (pass in the name of the enum member, and display options in the help)
  • Custom post-processing (post_process method)

Detailed introduction is coming soon. Please also refer to examples/example.py.

args order

重新排列一下参数显示的顺序:

1、首先显示required args 2、优先短的separate显示,就是xxx比xxx.xxx优先级高,xxxx.xxxx 比xxx.xxx.xxx优先级高 3、最后按照字母序排列

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

simpleargparser-0.2.0.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

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

simpleargparser-0.2.0-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file simpleargparser-0.2.0.tar.gz.

File metadata

  • Download URL: simpleargparser-0.2.0.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for simpleargparser-0.2.0.tar.gz
Algorithm Hash digest
SHA256 644bd89dc4c39f37735ae2d9d49361d58129472a2fbb0436a80483c34694450f
MD5 cedd95aec2f5bd07166603ddecc7720f
BLAKE2b-256 5a8a6d698d1ca9ef63bcd39b9df231751b3fca177a15eb2aa5ef097222c4811e

See more details on using hashes here.

File details

Details for the file simpleargparser-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simpleargparser-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 282b4794fbb0314881161fda48c253dbf2fd933aa6947faafc7b1b22a165d372
MD5 939a71c4fa80ef6b2e7726704516899d
BLAKE2b-256 fc0ff633a065f5ff67bf6d214a021101c05999b17399f4c2e7202d31c58af0a7

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