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.1.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.1-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: simpleargparser-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 537564c700c9a501abad7b33ec79175590115c3ff15381dc2413ea33cfaa19f4
MD5 0298c574ed37952bcc1b1170e8a2da73
BLAKE2b-256 9429f032d373fd04755060d0211e581c6d1ded31d0fda500ff6b5ebf9d5c6408

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simpleargparser-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 539d3c2281fc588c5118da3771feade559ac77f2900c464d22276618d5f94df5
MD5 8158a27841f7aafd2721da4f003cd353
BLAKE2b-256 93a0acbcc866344b82cc2ad37831af2451b5122c6f9407d3b14caabaee8f8df3

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