Skip to main content

PowerCLI

Build powerful command-line applications in Python 🐍⚡

Preview

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

powercli_python-0.3.0.tar.gz (37.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

powercli_python-0.3.0-py3-none-any.whl (45.3 kB view details)

Uploaded Python 3

File details

Details for the file powercli_python-0.3.0.tar.gz.

File metadata

  • Download URL: powercli_python-0.3.0.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.14 Linux/7.0.14-arch1-1

File hashes

Hashes for powercli_python-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a280c1230ba7113dc3b7ce9e94149b90e8bafaddba852e49c11965a8d59bed93
MD5 2bef208e4f184ba962b8ea7ddda2cc30
BLAKE2b-256 8eef5d204b84f78c2dd157261b33c13cb72f8db2902831c54589a7eef37543d8

See more details on using hashes here.

File details

Details for the file powercli_python-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: powercli_python-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 45.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.14 Linux/7.0.14-arch1-1

File hashes

Hashes for powercli_python-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12a996874408410b2dc1cd2eb711234e4b172cf27fc48f481f5bdcf0e1af9bd5
MD5 504594a3bb675e07580a3c408f515208
BLAKE2b-256 a7d9528616880d8ce8ad5024dfb05c53427e41f6ebbccfc0f6e3397cb699f1ad

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page