Skip to main content

A Python module that process a dictionary of arguments against a supplied dictionary of expected arguments.

Project description

Build Status Coverage Status PyPI version Flattr this git repo

A Python module that process a dictionary of arguments against a supplied dictionary of expected arguments.

Install

pip install argumentsprocessor

Documentation

ArgumentsProcessor Module

Processes arguments according to a supplied dictionary containing expected arguments
and rules.

@includes:
    ArgumentsProcessor
    ArgumentsProcessorExceptions

@requires:
    'expected_arguments' = {   -- categories are synonymous to the arguments you pass
        'category_a' : { -- this is will be whatever you name your argument, see the example below
            'arguments: (
                'hello',
                'bye'
            ),
            'required' : True || False,
            'returns' : 'string' -- default is string but you may pass the string name of any
               python variable type or pass in a custom object
        },
        'category_b' : {
            arguments: (
                'data'
            ),
            'required' : True || False,
            'returns': 'string' -- default is string but you may pass the string name of any
               python variable type or pass in a custom object
        }
    }

@return:
    arguments = {
        'category_a':return_value, -- either the default string, any python type, or custom object passed in
        'category_b':return_value, -- either the default string, any python type, or custom object passed in
     }


@example:

import ArgumentsProcessor

class classy:

    expected_arguments = {
        'mode': {
            'arguments': (
                'encrypt',
                'decrypt'
            ),
            'required': True,
            'return': 'string'
        },
        'data': {
            'arguments': (
                'data'
            ),
            'required': True,
            'return': 'string'
        }
    }

    def __init__(self, mode, data):
        supplied_arguments = {
            'mode':mode,
            'data':data
        }
        arguments = ArgumentsProcessor(self.expected_arguments, s

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

argumentsprocessor-1.1.6.tar.gz (3.1 kB view hashes)

Uploaded Source

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