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.2.tar.gz (9.1 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.2-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: snaparg-0.1.2.tar.gz
  • Upload date:
  • Size: 9.1 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.2.tar.gz
Algorithm Hash digest
SHA256 7edf0be5354ef3147665b7f908ad0e61a6c4798c2cf53cf75f4d3b1a83b07dd4
MD5 19ce383e9dd879021924986d0ce3bd3a
BLAKE2b-256 0c709ea215016b4f982c53827661fe00cd16ec45d756c1a0a6740393d9105cf1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: snaparg-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 166e63171b0e00f94e1a757355a0c515f48ce8fa3c1325b485a32311a1fa35db
MD5 958727be30e5e2dd736aea53871dccf8
BLAKE2b-256 6f493333e959f51bfd02a94a23188e73f14cae7290a8b75042959874077f2bb1

See more details on using hashes here.

Provenance

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