A Python module that process a dictionary of arguments against a supplied dictionary of expected arguments.
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file argumentsprocessor-1.1.6.tar.gz
.
File metadata
- Download URL: argumentsprocessor-1.1.6.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad90a7ea68dd20b2372796ea3161ae97135e7639851e1f554798de542b20529f |
|
MD5 | 6b1c483d3ca605bbc4cbe621042cb2f9 |
|
BLAKE2b-256 | f86fc08ac358ba927ff59aa905d776a1a21c8e8e4043c7f2edf3499e29875c34 |