Skip to main content

SimpleParam: simplified parameters with optional type and range checking

Project description


Build Status CircleCI Build status codecov Codacy Badge CodeFactor


SimpleParam was inspired by the param library which offers lots of neat features in a small package, however param has a tricky codebase. In SimpleParam you can either create Parameter or ParameterStore using simple synthax.

SimpleParam is certainly not complete and is missing a lot of awesome features of param and of course, has not been battle-tested yet. Missing features (such as Array, List, etc) will be added as my other projects that use SimpleParam will require them.


You can intilize Parameter like this:

import simpleparam as param

number = param.Number(42)

>>> Parameter(name=param, value=42, doc=')

However, it is probably better to use parameters inside of a ParameterStore, where you can store multiple parameters together and take advantage of additional functionality (e.g. locking of parameters with constant or exporting parameters as JSON object using export_as_dict):

import simpleparam as param

class Config(param.ParameterStore):
    def __init__(self):

        # # you can add parameter docstrings by setting `doc`
        self.integer = param.Integer(42,
                                     doc="A not very important value")
        # `auto_bound` forces hard bounds on values that are outside the specification
        self.number = param.Number(42.,
                                   softbounds=[0, 100],
                                   hardbounds=[1, 100],
        # setting `allow_any` to False, will force values to be of `str` instance
        self.string = param.String("string",
        # you can set internal parameter name by setting the value of `name`
        self.choice = param.Choice("foo",
                                   choices=["foo", "bar"],
        # parameters can be prevented from being changed by setting value of `constant
        self.color = param.Color("#FFFFFF",
        self.bool = param.Boolean(True)
        self.range = param.Range(value=[0, 100], hardbounds=[0, 100])

config = Config()

>>> ParameterStore(count=7)

For complete documentation, please visit the docs website.


Install from PyPI

pip install simpleparam

or directly from GitHub

pip install git+

or in development mode

git clone git+

cd SimpleParam

python develop


SimpleParam has no external requirements and works in py2 and py3.

Planned features

  • add 'List', 'Dict' classes
  • rename 'Color' to 'ColorHEX' or add 'modes': RGB or HEX
  • add Array class

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

simpleparam-0.0.4.tar.gz (9.7 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