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

Uploaded Python 3

File details

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

File metadata

  • Download URL: simpleargparser-0.1.9.tar.gz
  • Upload date:
  • Size: 8.4 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.9.tar.gz
Algorithm Hash digest
SHA256 3752415f969c1a838c8b6ee9911618d3d5bd0bcc08913c6b702611341d9fab50
MD5 ad8f41e9ef6aa777f8f1c0cb8b163e9a
BLAKE2b-256 35ee625ad6a25eb9a23cb483cacb56eccc28c2841370cddb54c02ef6848f8be0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simpleargparser-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 13b2c316a4db5d8b2910755dda99de153d4b2a37b8fea4486685b88bad4054fb
MD5 17f19d4bace11621cb128812d453a73a
BLAKE2b-256 42a8464027373a30d965eabc36e24392b75407ef8af7e5a8a2d43b5692ecc3e4

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