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.1.tar.gz (8.4 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.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file snaparg-0.1.1.tar.gz.

File metadata

  • Download URL: snaparg-0.1.1.tar.gz
  • Upload date:
  • Size: 8.4 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.1.tar.gz
Algorithm Hash digest
SHA256 4957aca9f4ddac0b6af3739a0afcc9b717594cb1fd2ce2d6fd9e8c88c0b8399c
MD5 d25e1444f0305b3d72e2a59cc4e4ccef
BLAKE2b-256 50ffb4a553ca0838ef04ec761a1103dda44a8a2257e2f14761b7c222a66cbdd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for snaparg-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: snaparg-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1bc785b74f8492dddcb3198d3ee5900cd966e9e6f038af22e9c379f8e6751ba2
MD5 978999003ba0bd93bb19f86d7b304780
BLAKE2b-256 b93f9e85d5d9d51a8852829a8db50afe31654c214034a744aae8d8875c3f487c

See more details on using hashes here.

Provenance

The following attestation bundles were made for snaparg-0.1.1-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