snaparg – Smarter argparse for easy living
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.
You can even replace it in any script just by editing your import statement!
✨ 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
📦 Quick Start
-
then replace:
-
from argparse import ArgumentParser->from snaparg import SnapArgumentParser as ArgumentParser
🔧 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]
📄 License
This project is licensed under the Mozilla Public License 2.0 (MPL-2.0). See the LICENSE file for details.
Metadata
Release files for snaparg 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| snaparg-0.2.0.tar.gz | 9.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| snaparg-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.3 kB
Release files / snaparg-0.2.0.tar.gz
| Download URL | snaparg-0.2.0.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4be6aea9464dd6ecab3f98dd080b2889f53b75a1d6c44f3d46991c8a295c207
|
|
BLAKE2b-256 checksum How to use checksums |
006443ea28df5ba169ee71b013e3c06f59be382a9744b6a5894afa7cf86cb532
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 24, 2025.
Transparency logRelease files / snaparg-0.2.0-py3-none-any.whl
| Download URL | snaparg-0.2.0-py3-none-any.whl |
|---|---|
| Size | 9.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54770761410d852d0f64760c956404e04b790619330b243cd33d932eaa606daa
|
|
BLAKE2b-256 checksum How to use checksums |
369a5aee554ac04352291837bca455ccc52a397e44eb4ff0309b22a5d7e5d53f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 24, 2025.
Transparency logSecurity for snaparg 0.2.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for snaparg-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 24, 2025.
Transparency logA 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.