Skip to main content

Dispatch from command-line arguments to functions

Project description

Experimental.

Example

"""Run something in development or production mode.

Usage: run-something.py (--development | --production) <host> <port>

"""
from docopt_dispatch import dispatch


@dispatch.on('--development'):
def development(host, port, **kwargs):
    print('in *development* mode')


@dispatch.on('--production'):
def development(host, port, **kwargs):
    print('in *production* mode')


if __name__ == '__main__':
    dispatch(__doc__)

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

docopt-dispatch-0.0.0.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file docopt-dispatch-0.0.0.tar.gz.

File metadata

File hashes

Hashes for docopt-dispatch-0.0.0.tar.gz
Algorithm Hash digest
SHA256 0cbe69826b868a9adb13458d37f2d0aca82ed7271ddaec9e9ed3b95ece14c92f
MD5 27de9a3e5888ce99169f2a59d9fa4971
BLAKE2b-256 3cb78ad27b40f0d944bbdd527dbb1eb53e9a5a9f1357cc1dcc2f9394bc616302

See more details on using hashes here.

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