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 details)

Uploaded Source

File details

Details for the file argumentsprocessor-1.1.6.tar.gz.

File metadata

File hashes

Hashes for argumentsprocessor-1.1.6.tar.gz
Algorithm Hash digest
SHA256 ad90a7ea68dd20b2372796ea3161ae97135e7639851e1f554798de542b20529f
MD5 6b1c483d3ca605bbc4cbe621042cb2f9
BLAKE2b-256 f86fc08ac358ba927ff59aa905d776a1a21c8e8e4043c7f2edf3499e29875c34

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