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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4957aca9f4ddac0b6af3739a0afcc9b717594cb1fd2ce2d6fd9e8c88c0b8399c
|
|
| MD5 |
d25e1444f0305b3d72e2a59cc4e4ccef
|
|
| BLAKE2b-256 |
50ffb4a553ca0838ef04ec761a1103dda44a8a2257e2f14761b7c222a66cbdd8
|
Provenance
The following attestation bundles were made for snaparg-0.1.1.tar.gz:
Publisher:
python-publish.yml on ArchooD2/snaparg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snaparg-0.1.1.tar.gz -
Subject digest:
4957aca9f4ddac0b6af3739a0afcc9b717594cb1fd2ce2d6fd9e8c88c0b8399c - Sigstore transparency entry: 200973093
- Sigstore integration time:
-
Permalink:
ArchooD2/snaparg@9cc350e6d2d150a4d0c7352de426d3f35f6361f8 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ArchooD2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9cc350e6d2d150a4d0c7352de426d3f35f6361f8 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bc785b74f8492dddcb3198d3ee5900cd966e9e6f038af22e9c379f8e6751ba2
|
|
| MD5 |
978999003ba0bd93bb19f86d7b304780
|
|
| BLAKE2b-256 |
b93f9e85d5d9d51a8852829a8db50afe31654c214034a744aae8d8875c3f487c
|
Provenance
The following attestation bundles were made for snaparg-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on ArchooD2/snaparg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snaparg-0.1.1-py3-none-any.whl -
Subject digest:
1bc785b74f8492dddcb3198d3ee5900cd966e9e6f038af22e9c379f8e6751ba2 - Sigstore transparency entry: 200973094
- Sigstore integration time:
-
Permalink:
ArchooD2/snaparg@9cc350e6d2d150a4d0c7352de426d3f35f6361f8 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/ArchooD2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9cc350e6d2d150a4d0c7352de426d3f35f6361f8 -
Trigger Event:
release
-
Statement type: