libargs — Python bindings
Unix/GNU-style argument parsing as a Python C extension.
import sys, args
opts = [
args.opt_bool ('v', 'verbose', 'enable verbose output'),
args.opt_string('o', 'output', 'FILE', 'output file', default='a.out'),
args.opt_int ('n', 'count', 'N', 'repeat N times'),
args.opt_float ('r', 'ratio', 'F', 'scaling ratio', default='1.0'),
]
r = args.Parser().parse(sys.argv, opts)
print(r.flag('verbose')) # bool
print(r.string('output')) # str | None
print(r.int('count')) # int | None
print(r.positionals()) # list[str]
Supports: -v, -xvz, -fFILE, --flag, --opt=VAL, --opt VAL,
--no-FLAG, -- end-of-args, - stdin, POSIXLY_CORRECT.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
libargs-1.0.1.tar.gz
(15.1 kB
view details)
File details
Details for the file libargs-1.0.1.tar.gz.
File metadata
- Download URL: libargs-1.0.1.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc5de4716ef8bede694f863d6f661328c926bdb1b786bb675c7401d80e09dccf
|
|
| MD5 |
82de8205f2ee1ca5b9b7ca02bc675433
|
|
| BLAKE2b-256 |
169b7033bbe63d92e26faa9bad9af82f997ae04add6d23f9841f58e7d6ba95ea
|
Provenance
The following attestation bundles were made for libargs-1.0.1.tar.gz:
Publisher:
ci.yml on quantung-libraries/libargs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
libargs-1.0.1.tar.gz -
Subject digest:
fc5de4716ef8bede694f863d6f661328c926bdb1b786bb675c7401d80e09dccf - Sigstore transparency entry: 2405989817
- Sigstore integration time:
-
Permalink:
quantung-libraries/libargs@ba8e7bbb5b19113d9a68075b96672214b49349d4 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/quantung-libraries
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@ba8e7bbb5b19113d9a68075b96672214b49349d4 -
Trigger Event:
push
-
Statement type: