No project description provided
Project description
fastcommand
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
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
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1022c41063e17525a60cec55180790afdf545c436a61eb389507054a78b5f6eb |
|
MD5 | d6549ba4e7f9fbbf7358c0970b7b16ad |
|
BLAKE2b-256 | 2f01b98f4bab077dd023deafe9cebeb902d904a830123db8c6c2b97917c43680 |
Provenance
The following attestation bundles were made for fastcommand-0.1.8.tar.gz
:
Publisher:
build.yaml
on jbmorley/fastcommand
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
fastcommand-0.1.8.tar.gz
- Subject digest:
1022c41063e17525a60cec55180790afdf545c436a61eb389507054a78b5f6eb
- Sigstore transparency entry: 145674088
- Sigstore integration time:
- Predicate type:
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c1e9c149c23ee18f6e439e2bdce3a0b08a678a5e113dee6a2372e21519bfbbd |
|
MD5 | 8bfdf910e1d8751c2ad9e592f3c983e6 |
|
BLAKE2b-256 | b7f03e42a5a96a2890a7a10dbab8603f7fe3cf34925a8c8dc589ace1f44af67d |
Provenance
The following attestation bundles were made for fastcommand-0.1.8-py3-none-any.whl
:
Publisher:
build.yaml
on jbmorley/fastcommand
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
fastcommand-0.1.8-py3-none-any.whl
- Subject digest:
8c1e9c149c23ee18f6e439e2bdce3a0b08a678a5e113dee6a2372e21519bfbbd
- Sigstore transparency entry: 145674091
- Sigstore integration time:
- Predicate type: