Skip to main content

Build powerful command-line applications in Python

Project description

PowerCLI

Build powerful command-line applications in Python 🐍⚡

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


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.1.1.tar.gz (32.0 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.1.1-py3-none-any.whl (38.9 kB view details)

Uploaded Python 3

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

Hashes for powercli_python-0.1.1.tar.gz
Algorithm Hash digest
SHA256 993c3b2cbe4a8fce6217607341398f3fd98f53d18cfadb5aeba53dae2f4d95bd
MD5 c4e66b1fcb7be5667c1cb0a6a5764cc6
BLAKE2b-256 9e3f6dfca693f2ec682383cb05f32771f728db74619996e64690c9a085fb3923

See more details on using hashes here.

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

Hashes for powercli_python-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b8bc1436735d6a3f0659df4c2c2f70478b181afff37560a800953251c6cf1add
MD5 2ff7212b61588c5a0282b2309aab6ceb
BLAKE2b-256 90b500f5b38e9e75f4a9893a4ac4b3fad4b91f32469adc4c4dd48caeede561d0

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 Pingdom Monitoring Sentry Error logging StatusPage Status page