cliguards
CLI value guards for argparse and Typer.
argparse
Use guards as native argparse type= converters:
import argparse
from cliguards import PathGuard
parser = argparse.ArgumentParser()
parser.add_argument("--input", type=PathGuard.file("tsv", "tsv.gz"))
args = parser.parse_args()
Typer
Install the optional Typer extra:
pip install "cliguards[typer]"
Use fluent adapters with Annotated:
from pathlib import Path
from typing import Annotated
import typer
from cliguards import PathGuard
app = typer.Typer()
@app.command()
def run(
input: Annotated[
Path,
PathGuard.file("tsv", "tsv.gz").as_typer_option("--input"),
],
) -> None:
typer.echo(input)
Public API
from cliguards import HexColorGuard, NumericRangeGuard, PathGuard
V1 guards are single-value guards. They do not expose public specs, public guard error classes, automatic help generation, or multi-value helpers.
Release files for cliguards 0.1.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 | |
|---|---|---|---|
| cliguards-0.1.0.tar.gz | 11.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cliguards-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.2 kB
Release files / cliguards-0.1.0.tar.gz
| Download URL | cliguards-0.1.0.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69b4e207f47149905e1a83ee6cc1ffd4ff051be24a853a2ffecd9fb0c203991d
|
|
BLAKE2b-256 checksum How to use checksums |
2380f0834ca31c685c18ac89f2d6a97662305b231eedf104689b59689735cbd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Jul 3, 2026.
Transparency logRelease files / cliguards-0.1.0-py3-none-any.whl
| Download URL | cliguards-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ea1341b5e839405f49aaebfd452f2c9b780350fc739fad0414e4c193febfcc96
|
|
BLAKE2b-256 checksum How to use checksums |
31bbcd8b5028315b0431f58d49fea05d0a2bba4b3a954724dd34a523a91286a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Jul 3, 2026.
Transparency log