Build powerful command-line applications in Python 🐍⚡
- 📖 Documentation
- 💡 Examples
- 🖥️ Source Code
Features
- ✅ Simple API
- ✅ Highly configurable
- ✅ Flags, Positionals & Subcommands
- ✅ Type Hints
- ✅ Easy to test
- ✅ Well documented
Installation
Poetry
poetry add powercli-python
uv
uv add powercli-python
Manual Installation
Add powercli-python as a dependency in your pyproject.toml file.
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(
identifier="foo",
short="f",
values=[("PATH", Path)],
)
cmd.add_arg(flag)
# ... or use the shorthand ...
cmd.flag(identifier="foo", 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.
Metadata
Release files for powercli-python 0.3.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 | |
|---|---|---|---|
| powercli_python-0.3.0.tar.gz | 37.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| powercli_python-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 82.8 kB
Release files / powercli_python-0.3.0.tar.gz
| Download URL | powercli_python-0.3.0.tar.gz |
|---|---|
| Size | 37.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a280c1230ba7113dc3b7ce9e94149b90e8bafaddba852e49c11965a8d59bed93
|
|
BLAKE2b-256 checksum How to use checksums |
8eef5d204b84f78c2dd157261b33c13cb72f8db2902831c54589a7eef37543d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.11.14 Linux/7.0.14-arch1-1
|
Release files / powercli_python-0.3.0-py3-none-any.whl
| Download URL | powercli_python-0.3.0-py3-none-any.whl |
|---|---|
| Size | 45.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12a996874408410b2dc1cd2eb711234e4b172cf27fc48f481f5bdcf0e1af9bd5
|
|
BLAKE2b-256 checksum How to use checksums |
a7d9528616880d8ce8ad5024dfb05c53427e41f6ebbccfc0f6e3397cb699f1ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.11.14 Linux/7.0.14-arch1-1
|