Skip to main content

A typo-tolerant CLI parser wrapper for argparse

Project description

snaparg

snaparg is a lightweight Python library that wraps around the built-in argparse module, making command-line interfaces more user-friendly by detecting typos in argument names and suggesting the closest valid alternatives.

Perfect for scripts and tools that aim to be a little more forgiving to users without sacrificing the power and flexibility of argparse.


✨ Features

  • Drop-in replacement for argparse.ArgumentParser
  • Detects mistyped CLI flags and suggests corrections
  • Compatible with existing argparse-based code
  • Zero dependencies — works out of the box

🔧 Example

$ python demo.py --iput file.txt
Error: Unknown or invalid argument(s).
  Did you mean: '--iput' -> '--input'?

Full message:
usage: demo.py [-h] [--input INPUT] [--output OUTPUT] [--force]

📦 Installation

pip install snaparg


📄 License

This project is licensed under the Mozilla Public License 2.0 (MPL-2.0). See the LICENSE file for details.

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

snaparg-0.1.0b0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snaparg-0.1.0b0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file snaparg-0.1.0b0.tar.gz.

File metadata

  • Download URL: snaparg-0.1.0b0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for snaparg-0.1.0b0.tar.gz
Algorithm Hash digest
SHA256 fa7fe8472b8e40c966870f6a1624893dc5a5747fded22390b6a9dbc854e24ca8
MD5 95176971b00e377c4f606183e8e9b932
BLAKE2b-256 2d5e9189d9934deb52971cff5e5551fac86966ea96475cce1abb27bc12dbc79e

See more details on using hashes here.

Provenance

The following attestation bundles were made for snaparg-0.1.0b0.tar.gz:

Publisher: python-publish.yml on ArchooD2/snaparg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snaparg-0.1.0b0-py3-none-any.whl.

File metadata

  • Download URL: snaparg-0.1.0b0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for snaparg-0.1.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1ec0d66d71eb86ca0d4f99b0cf48d401f8a412f409d5974af04b857ffe86334
MD5 b51d9b6336480deee01633d318822a78
BLAKE2b-256 97e5c23bd31b9efd3b2aa47a0da3e464eb64dc7b95f4209ae8f0654c607391b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for snaparg-0.1.0b0-py3-none-any.whl:

Publisher: python-publish.yml on ArchooD2/snaparg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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