Skip to main content

No project description provided

Project description

fastcommand

build

Python module for defining multi-command cli programs

Description

The fastcommand module is a lightweight wrapper over argparse which aims to make it easier to write multi-command cli programs and utilities. It does so by providing convenience decorators that allow for quickly defining sub-commands.

Usage

import fastcommand


@fastcommand.command("hello", help="say hello")
def command_hello(options):
    print("Hello, World!")


@fastcommand.command("goodbye", help="say goodbye", arguments=[
    fastcommand.Argument("name"),
    fastcommand.Argument("--wave", "-w", action="store_true", default=False)
])
def command_goodbye(options):
    print(f"Goodbye, {options.name}!")
    if options.wave:
        print("👋")


def main():
    cli = fastcommand.CommandParser(description="Simple fastcommand example.")
    cli.use_logging(format="[%(levelname)s] %(message)s")
    cli.run()


if __name__ == "__main__":
    main()

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

fastcommand-0.1.8.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

fastcommand-0.1.8-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file fastcommand-0.1.8.tar.gz.

File metadata

  • Download URL: fastcommand-0.1.8.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fastcommand-0.1.8.tar.gz
Algorithm Hash digest
SHA256 1022c41063e17525a60cec55180790afdf545c436a61eb389507054a78b5f6eb
MD5 d6549ba4e7f9fbbf7358c0970b7b16ad
BLAKE2b-256 2f01b98f4bab077dd023deafe9cebeb902d904a830123db8c6c2b97917c43680

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastcommand-0.1.8.tar.gz:

Publisher: build.yaml on jbmorley/fastcommand

Attestations:

File details

Details for the file fastcommand-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: fastcommand-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for fastcommand-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8c1e9c149c23ee18f6e439e2bdce3a0b08a678a5e113dee6a2372e21519bfbbd
MD5 8bfdf910e1d8751c2ad9e592f3c983e6
BLAKE2b-256 b7f03e42a5a96a2890a7a10dbab8603f7fe3cf34925a8c8dc589ace1f44af67d

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastcommand-0.1.8-py3-none-any.whl:

Publisher: build.yaml on jbmorley/fastcommand

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page