Skip to main content

ordered_argparse

Version of Python's standard library's argparse which also remembers the order of command line arguments.

Installation

Install with pip install ordered_argparse.

Usage

Create an instance of ArgumentParser as usual. Use namespace=ordered_argparse.OrderedNamespace(). Access arguments in declaration order by calling parser's .ordered() method.

import ordered_argparse

parser = ordered_argparse.ArgumentParser()
parser.add_argument("--foo", action="store_true", help="foo")
parser.add_argument("--bar", action="store_true", help="bar")

# Use OrderedNamespace when parsing CLI arguments
args = parser.parse_args(["--foo", "--bar"], namespace=ordered_argparse.OrderedNamespace())

# Access ordered arguments by calling .ordered()
for arg in args.ordered():
    print(f"{arg}")

Compatibility with argcomplete

ordered_argparse only works with argcomplete as long as you don't use subparsers. If you use subparsers, you need ordered_argcomplete.

Metadata

Release files for ordered-argparse 1.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ordered-argparse 1.0.10
File Size Uploaded Provenance Actions
ordered_argparse-1.0.10.tar.gz 26.0 kB Without provenance Details for ordered_argparse-1.0.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ordered-argparse 1.0.10
File Interpreter ABI Platform Actions
ordered_argparse-1.0.10-py3-none-any.whl Python 3 none any Details for ordered_argparse-1.0.10-py3-none-any.whl

Total release size: 51.3 kB

Release files / ordered_argparse-1.0.10.tar.gz

Download URL ordered_argparse-1.0.10.tar.gz
Size 26.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a930c290552e221b53cdfe2c832fce2e83031e403ceb1084b4a00b3e00155a73
BLAKE2b-256 checksum
How to use checksums
1e2a0b8b6e33385a4a2da6621cf03d6113818b97dde0a25c38f83db5ac06f577
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / ordered_argparse-1.0.10-py3-none-any.whl

Download URL ordered_argparse-1.0.10-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c960dc733b1ee8a5fe1d7134596fbb98cf7a99b4648b78aa4f2179153d4c58b
BLAKE2b-256 checksum
How to use checksums
054e4963f928549cc8aab500196884296633ae9a6b7d9f7cd7a1cf55b6c83a36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Security for ordered-argparse 1.0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page