The documentation has not been created yet - sorry - you will have to make do with the following example code for now:
def exampleFct(aaa, bbb, **kwargs):
"""
:param aaa: just a dummy.
:param bbb: just a dummy.
:return: 'None'.
An example function for using 'ParamBundle' to automatically select,
check (for completeness and correct types) and bundle keyword arguments
into an instance of an enhanced dictionary class, which also and in
particular mirrors items to attributes and attributes to items
automatically.
"""
try:
### determine the mandatory as well as the optional parameters and belonging parameter types ###
### and extract, check and bundle the belonging parts of 'kwargs' into 'args'.
args = ParamBundle()
args.registerMandatories(ccc=int, ddd=float)
args.registerOptionals(eee=(int,float,type(None)), fff=None)
args.update( kwargs )
if args.isComplete() == False:
print (">>>>>>>>>> MANDATORY PARAMETERS INCOMPLETE <<<<<<<<<<")
except Exception as ee:
print ("Error in exampleFct: function called with wrong arguments (%s)!" % ee)
Furthermore you should try out:
python paramBundle.py --test
and have a look at the output! Last but not least the code of the belonging selftest() function and the functions called from there can provide some insights.
Further infomations and links can be found on my homepage
Have Fun!
Release files for paramBundle 0.50
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| paramBundle-0.50-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Release files / paramBundle-0.50-py2.py3-none-any.whl
| Download URL | paramBundle-0.50-py2.py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
5849fe3ea1f6204e5eefb3afd47644384d683bcd8c612582ef74b3337499fd21
|
|
BLAKE2b-256 checksum How to use checksums |
1ec1ed7778021c3c6ef2b5abfdc1f3bfc4536cce7c8beb45e016412535c82201
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.13
|