Skip to main content

Dispatch from command-line arguments to functions

Project description



"""Run something in development or production mode.

Usage: --development <host> <port> --production <host> <port> remote add <item> remote delete <item>

from docopt_dispatch import dispatch

def development(host, port, **kwargs):
    print('in *development* mode')

def development(host, port, **kwargs):
    print('in *production* mode')

@dispatch.on('items', 'add')
def items_add(item, **kwargs):
    print('adding item...')

@dispatch.on('items', 'delete')
def items_delete(item, **kwargs):
    print('deleting item...')

if __name__ == '__main__':

Project details

Release history Release notifications

This version
History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
docopt-dispatch-0.0.2.tar.gz (2.9 kB) Copy SHA256 hash SHA256 Source None Feb 10, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page