Improved argparse.ArgumentParser that works with dataclasses
Project description
aceparse
An argument parser that wraps python's built-in argparse, allowing it to parse command lines into
dataclasses.
Advantages over argparse:
- you get a dataclass so you can use an IDE to find out where your command line options are used
- nicer specification of default values
- can be combined with pydantic dataclasses to type check arguments
Examples
from dataclasses import dataclass
from aceparse import AceParser, AceArg
@dataclass
class Arguments:
hello: str = AceArg(help="Name of thing to say hello to")
a = AceParser(Arguments)
args = a.parse_args_into_dataclasses(["--hello=name"])
print(f"Hello {args.hello}")
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
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 aceparse-0.2.2.tar.gz.
File metadata
- Download URL: aceparse-0.2.2.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebcdb03ca2c054cc2b0ebf3e1d26c3b56cef228c3866bc79375096de0a6aa30a
|
|
| MD5 |
259a3dbefd64f5be9e481a7fb8af2a5d
|
|
| BLAKE2b-256 |
4f7332bd0f091baca94fa88b1cc9861efc0664629013e55870e941b2d47bcf05
|
Provenance
The following attestation bundles were made for aceparse-0.2.2.tar.gz:
Publisher:
publish-to-pypi.yml on jjjamie/aceparse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aceparse-0.2.2.tar.gz -
Subject digest:
ebcdb03ca2c054cc2b0ebf3e1d26c3b56cef228c3866bc79375096de0a6aa30a - Sigstore transparency entry: 267165952
- Sigstore integration time:
-
Permalink:
jjjamie/aceparse@36c8918fe2d0ffb0eac58b333dd1a310b33d2554 -
Branch / Tag:
refs/tags/0.2.2 - Owner: https://github.com/jjjamie
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@36c8918fe2d0ffb0eac58b333dd1a310b33d2554 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aceparse-0.2.2-py3-none-any.whl.
File metadata
- Download URL: aceparse-0.2.2-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4b0aa36eb425b6c64db6c01e86ae77cbe53bfa54f0a186ea161879acd075d22
|
|
| MD5 |
cc0a9f55ce3dcb051300034f66cd1240
|
|
| BLAKE2b-256 |
9f9adc6293e8eb8be99e3135f4af2543803bf5725218faa57e20bbf9efe0704a
|
Provenance
The following attestation bundles were made for aceparse-0.2.2-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on jjjamie/aceparse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aceparse-0.2.2-py3-none-any.whl -
Subject digest:
a4b0aa36eb425b6c64db6c01e86ae77cbe53bfa54f0a186ea161879acd075d22 - Sigstore transparency entry: 267165957
- Sigstore integration time:
-
Permalink:
jjjamie/aceparse@36c8918fe2d0ffb0eac58b333dd1a310b33d2554 -
Branch / Tag:
refs/tags/0.2.2 - Owner: https://github.com/jjjamie
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@36c8918fe2d0ffb0eac58b333dd1a310b33d2554 -
Trigger Event:
push
-
Statement type: