Build powerful command-line applications in Python
Project description
Build powerful command-line applications in Python 🐍⚡
- 📖 Documentation
- 💡 Examples
- 🖥️ Source Code
Features
- ✅ Simple & Advanced API
- ✅ Type Hints
- ✅ Easy to test
- ✅ Well documented
Installation
Poetry
poetry add powercli-python
uv
uv add powercli-python
Manual Installation
Add powercli
dependencies = [
"powercli-python"
]
Overview
Highly Configurable
Commands and arguments are highly configurable yet provide good defaults to work well out of the box.
import sys
from powercli import Command
cmd = Command(
# Windows-style flag prefixes
prefix_short=None,
prefix_long="/",
# use other stream
file=sys.stderr,
)
Object Oriented
Arguments are classes which can be instantiated dynamically and are not directly bound to a parser class.
from pathlib import Path
from powercli import Flag
cmd = Command()
flag = Flag(
short="f",
values=[("PATH", Path)],
)
cmd.add_arg(flag)
# ... or use the shorthand ...
cmd.flag(
short="f",
values=[("PATH", Path)]
)
Generate man pages
$ python3 -m powerdoc path/to/file.py --man
$ python3 -m powerdoc path/to/file.py --man | groff -T utf8 -man
Colored output
The built-in provided flags and commands make use of colored output respecting the user's preference.
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 powercli_python-0.1.1.tar.gz.
File metadata
- Download URL: powercli_python-0.1.1.tar.gz
- Upload date:
- Size: 32.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.11.13 Linux/6.15.2-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
993c3b2cbe4a8fce6217607341398f3fd98f53d18cfadb5aeba53dae2f4d95bd
|
|
| MD5 |
c4e66b1fcb7be5667c1cb0a6a5764cc6
|
|
| BLAKE2b-256 |
9e3f6dfca693f2ec682383cb05f32771f728db74619996e64690c9a085fb3923
|
File details
Details for the file powercli_python-0.1.1-py3-none-any.whl.
File metadata
- Download URL: powercli_python-0.1.1-py3-none-any.whl
- Upload date:
- Size: 38.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.2 CPython/3.11.13 Linux/6.15.2-arch1-1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8bc1436735d6a3f0659df4c2c2f70478b181afff37560a800953251c6cf1add
|
|
| MD5 |
2ff7212b61588c5a0282b2309aab6ceb
|
|
| BLAKE2b-256 |
90b500f5b38e9e75f4a9893a4ac4b3fad4b91f32469adc4c4dd48caeede561d0
|