Version 1.0.0
A simple wrapper for argparse that allows commands and arguments to be defined declaratively using decorators. Note that this does not support all the features of argparse yet.
Commando also bundles a few utilities that are useful when building command line applications.
Example
Without commando:
def main():
parser = argparse.ArgumentParser(description='hyde - a python static website generator',
epilog='Use %(prog)s {command} -h to get help on individual commands')
parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + __version__)
parser.add_argument('-s', '--sitepath', action='store', default='.', help="Location of the hyde site")
subcommands = parser.add_subparsers(title="Hyde commands",
description="Entry points for hyde")
init_command = subcommands.add_parser('init', help='Create a new hyde site')
init_command.set_defaults(run=init)
init_command.add_argument('-t', '--template', action='store', default='basic', dest='template',
help='Overwrite the current site if it exists')
init_command.add_argument('-f', '--force', action='store_true', default=False, dest='force',
help='Overwrite the current site if it exists')
args = parser.parse_args()
args.run(args)
def init(self, params):
print params.sitepath
print params.template
print params.overwrite
With commando:
class Engine(Application):
@command(description='hyde - a python static website generator',
epilog='Use %(prog)s {command} -h to get help on individual commands')
@param('-v', '--version', action='version', version='%(prog)s ' + __version__)
@param('-s', '--sitepath', action='store', default='.', help="Location of the hyde site")
def main(self, params): pass
@subcommand('init', help='Create a new hyde site')
@param('-t', '--template', action='store', default='basic', dest='template',
help='Overwrite the current site if it exists')
@param('-f', '--force', action='store_true', default=False, dest='overwrite',
help='Overwrite the current site if it exists')
def init(self, params):
print params.sitepath
print params.template
print params.overwrite
Resources
Metadata
Release files for commando 1.0.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 | Provenance | Actions |
|---|---|---|---|---|
| commando-1.0.0.tar.gz | 13.5 kB | Without provenance | Details for commando-1.0.0.tar.gz |
Release files / commando-1.0.0.tar.gz
| Download URL | commando-1.0.0.tar.gz |
|---|---|
| Size | 13.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3cc802fc8c13d562d9de3ad9246da3f5931cc99c07cc9cc8a70cd0a816f75682
|
|
BLAKE2b-256 checksum How to use checksums |
db7e494f4a185245cd5a57b9e1f911bf4c2258d799b4f3c41aef9b5f983b61d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for commando 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.