lightweight companion library for Typer that helps you build cleaner, more expressive CLI applications.
Project description
typer-swissknife
typer-swissknife is a lightweight companion library for Typer that helps you build cleaner, more expressive CLI applications.
It focuses on a small set of practical helpers for common CLI patterns such as alias-aware commands, nested sub-apps, and richer help output.
Why use it
- Keep command registration simple and readable.
- Organize larger CLIs into smaller, reusable Typer components.
- Improve discoverability with optional visual help text.
- Stay close to Typer's native behavior while adding a bit more structure.
Features
- Alias-aware command decorators
- Nested Typer app registration
- Optional ASCII-enhanced help sections
- Simple integration into existing Typer projects
Installation
pip install typer-swissknife
Quick example
import typer
from typer_swissknife import add_typer, command
app = typer.Typer()
admin = typer.Typer()
@command(app, name="list", aliases=("ls",))
def list_items():
print("Listing items...")
@command(admin, aliases=("rm",))
def remove(item: str):
print(f"Removing {item}")
add_typer(
app,
admin,
name="admin",
ascii_name="Admin",
aliases=("a",),
help="Administrative commands",
)
if __name__ == "__main__":
app()
Project philosophy
This package is intentionally compact and focused. As the project grows, the goal is to keep the documentation high-level and feature-oriented rather than listing every helper in detail.
License
typer-swissknife is licensed under the GNU General Public License v3 (GPLv3).
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 typer_swissknife-0.1.0.tar.gz.
File metadata
- Download URL: typer_swissknife-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36a9fffa4db6345c516edb89a45ce41e7e11e1efef2c500bf67b060e5e23265b
|
|
| MD5 |
5540ab011f7f812ac2d0dda729dde3f1
|
|
| BLAKE2b-256 |
f31b5bbdb97573ec0ec39de8c69997f3c7aac11ee99438db304b30bd94d20057
|
File details
Details for the file typer_swissknife-0.1.0-py3-none-any.whl.
File metadata
- Download URL: typer_swissknife-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1317b82f15e57efbbf8766f3fb4c22502e890f79e7383d7e92017e18efaa4f5
|
|
| MD5 |
ead0bf6dca3cb4872824594f0c9a849f
|
|
| BLAKE2b-256 |
954524864b9815c784e104045fee41cbed4cdeed672dfa7953e686449be6e6e1
|