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.8.tar.gz (8.3 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.8-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simpleargparser-0.1.8.tar.gz
  • Upload date:
  • Size: 8.3 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.8.tar.gz
Algorithm Hash digest
SHA256 a91168be116ac494f8a8ca062352c761debab1bf6d90e4ea974a01d2601ed0a8
MD5 81cb64a12fb4cd74db2a8dc6fe787dca
BLAKE2b-256 71591699a62997ccc9e3551fde73c59154117fd533083ce9b93102593f501b10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simpleargparser-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 67cdec0a3373a274ac7a62847241becd96c783572f1b2036d987151e58389d3f
MD5 2af992ac2b76250f8b101946f186f248
BLAKE2b-256 73e9c4821e0011a969f0e08dc5263fd3df88331698f8abbb92255bcfb0f27986

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