A simple typed argument parser using dataclasses and type hints. This project is largely generated by ChatGPT.
Project description
SimpleArgParser
version log
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
644bd89dc4c39f37735ae2d9d49361d58129472a2fbb0436a80483c34694450f
|
|
| MD5 |
cedd95aec2f5bd07166603ddecc7720f
|
|
| BLAKE2b-256 |
5a8a6d698d1ca9ef63bcd39b9df231751b3fca177a15eb2aa5ef097222c4811e
|
File details
Details for the file simpleargparser-0.2.0-py3-none-any.whl.
File metadata
- Download URL: simpleargparser-0.2.0-py3-none-any.whl
- Upload date:
- Size: 26.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
282b4794fbb0314881161fda48c253dbf2fd933aa6947faafc7b1b22a165d372
|
|
| MD5 |
939a71c4fa80ef6b2e7726704516899d
|
|
| BLAKE2b-256 |
fc0ff633a065f5ff67bf6d214a021101c05999b17399f4c2e7202d31c58af0a7
|