Skip to main content

About

A python package for parsing parameters

Usage

>>> from param_info import *
>>> params = ParamList()
>>> params.add( ParamInfoInt("a1",7,min=5) )
>>> params.add( ParamInfoVal("a2",['aa','bb','cc']) )
>>> params.add( ParamInfoStr("a3",' hallo ') )
>>> def doSomething(param,values):
...    if params.validate(values):
...        # Do something with values
...        for name,param in params.params.items():
...            print( '{0} ==> {1}'.format(name,param.value))
...    else:
...        # Handle errors
...        for name,param in params.errors.items():
...            print( 'Error. {0} ==> {1}'.format(name,param.errorText))
>>> doSomething(params,{'a1':3})
Error. a1 ==> a1=3 should be integer >= 5
Error. a2 ==> a2 is required
>>> doSomething(params,{'a1':8,'a2':'bb'})
a1 ==> 8
a2 ==> bb
a3 ==> hallo
>>> doSomething(params,{'a2':'zz'})
Error. a2 ==> a2=zz should be one of ['aa', 'bb', 'cc']
>>> doSomething(params,{'a2':'aa','a3':'hola'})
a1 ==> 7
a2 ==> aa
a3 ==> hola

Metadata

Release files for param-info 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for param-info 0.2.1
File Size Uploaded Provenance Actions
param-info-0.2.1.zip 7.0 kB Without provenance Details for param-info-0.2.1.zip

Release files / param-info-0.2.1.zip

Download URL param-info-0.2.1.zip
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3f0850e259a05fd7ef5b3e66df0fbe126bea72fe8b0c40180fa2680fb6e46812
BLAKE2b-256 checksum
How to use checksums
8cc3d2609072292eac530e00b2b7895bb86bc35c2515888305028513e4ea2396
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for param-info 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page