Param is a zero-dependency Python library that enables the creation of classes with rich, declarative attributes (Parameter objects) for runtime validation, documentation, and serialization. It also provides a suite of expressive and composable APIs for reactive programming, allowing automatic updates on attribute changes and the declaration of complex reactive dependencies. Param is currently at version 2.3.3 and maintains a frequent release cadence with minor and patch updates.
pip install paramVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates defining a `Parameterized` class with `Integer`, `String`, and `Event` parameters. It shows how to bind a method (`save_user_to_db`) to react to changes in the `submit` parameter using the `@param.depends` decorator. Changing parameter values and triggering the event causes the dependent method to execute.
Upgrade to Python 3.10+ and consult the changelog for specific API removals, updating your code accordingly. (e.g., https://github.com/holoviz/param/compare/v2.2.1...v2.3.0)
Review code for operations that previously emitted warnings from `param` and address them to avoid new errors. Consult the changelog for details on specific API removals and behavior changes. (e.g., https://github.com/holoviz/param/compare/v2.1.1...v2.2.0)
No code fix is required, but be aware that IDEs will now display your class's own docstring for the `__init__` method, rather than a generic one from `param`.
Ensure that `edit_constant` is used as intended to prevent mutation of constant parameters. If you were implicitly relying on the old, incorrect behavior, adjust your logic to respect the constant nature of parameters.
Ensure that all items in the list you are assigning conform to the `item_type` defined for the `param.List` parameter.
Ensure that the object you are interacting with is an instance of a `param.Parameterized` class or a Param-aware DataFrame (e.g., from Panel or other HoloViz libraries that integrate with Param), or use standard Pandas DataFrame methods if not intending to use Param's features. If using with Panel, ensure you are using `pn.pane.DataFrame` or `param.DataFrame` if available and applicable, rather than raw `pd.DataFrame`.
To ensure a method decorated with `@param.depends` runs on initialization, you must include both `on_init=True` and `watch=True` in the decorator arguments.
Install the 'param' library using pip: `pip install param`.
No dependency data recorded yet.