Skip to main content

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

Project description

SimpleArgParser

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.1.7.tar.gz (8.2 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.1.7-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simpleargparser-0.1.7.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for simpleargparser-0.1.7.tar.gz
Algorithm Hash digest
SHA256 05d0efd93e40f2fd4e66eac792113941ca66adc74770340825fcd90672fd75c7
MD5 7583a6e2de24dbb9b4c657b55d46af9a
BLAKE2b-256 6f1ebbdb2d355f45f2cbb3b0cf2bc03930bce2c8896e91437ef5eb5b809f0d20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simpleargparser-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 62c4520d30f83866608259c121ca01d0e094279d50a124dfe5ba8fa046540617
MD5 75d4fd674ff117788d7b388c4a57c922
BLAKE2b-256 5f652004b83255e29da4be8a77f0c4973a604dba84ba989a93eb530ec07086ad

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