{"id":3207,"library":"param","title":"Param","description":"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.","status":"active","version":"2.3.3","language":"python","source_language":"en","source_url":"https://github.com/holoviz/param","tags":["declarative","parameters","reactive programming","holoviz","validation"],"install":[{"cmd":"pip install param","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"Commonly used for accessing parameter types and decorators directly.","symbol":"param","correct":"import param"},{"note":"The base class for creating classes with declarative parameters.","symbol":"Parameterized","correct":"from param import Parameterized"}],"quickstart":{"code":"import param\n\nclass UserForm(param.Parameterized):\n    age = param.Integer(bounds=(0, None), doc='User age')\n    name = param.String(doc='User name')\n    submit = param.Event()\n\n    @param.depends('submit', watch=True)\n    def save_user_to_db(self):\n        print(f'Saving user to db: name={self.name}, age={self.age}')\n\nuser = UserForm(name='Alice', age=30)\nprint(f'Initial user name: {user.name}, age: {user.age}')\nuser.submit = True # Triggers save_user_to_db\n\nuser.name = 'Bob'\nuser.age = 25\nuser.submit = True # Triggers save_user_to_db with new values","lang":"python","description":"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."},"warnings":[{"fix":"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)","message":"Version 2.3.0 raised the minimum supported Python version to 3.10 and removed several previously deprecated APIs. Code running on older Python versions or relying on removed APIs will break.","severity":"breaking","affected_versions":">=2.3.0"},{"fix":"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)","message":"Version 2.2.0 removed deprecated APIs and changed warnings for unsafe operations into errors. Code that previously received warnings but continued to function might now raise exceptions.","severity":"breaking","affected_versions":">=2.2.0"},{"fix":"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`.","message":"In version 2.3.2, the `Parameterized.__init__` docstring was removed because it shadowed user-defined class docstrings in IDEs like VSCode. While not breaking, developers relying on IDEs to show the `__init__` docstring might notice its absence.","severity":"gotcha","affected_versions":">=2.3.2"},{"fix":"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.","message":"Version 2.3.1 fixed a regression in the `param.parameterized.edit_constant` context manager, which previously allowed class value mutation even when not constant. Users relying on this unintended behavior might see a change in mutation prevention.","severity":"gotcha","affected_versions":">=2.3.1"}],"env_vars":null,"search_vec":"'2.3.3':59 'allow':41 'also':29 'api':37 'attribut':19,45 'automat':42 'cadenc':65 'chang':46 'class':15 'complex':51 'compos':36 'creation':13 'current':56 'declar':18,49,71 'depend':7,53 'document':25 'enabl':11 'express':34 'frequent':63 'holoviz':75 'librari':9 'maintain':61 'minor':67 'object':21 'param':1,2,54 'paramet':20,72 'patch':69 'program':40,74 'provid':30 'python':8 'reactiv':39,52,73 'releas':64 'rich':17 'runtim':23 'serial':27 'suit':32 'updat':43,70 'valid':24,76 'version':58 'zero':6 'zero-depend':5","created_at":"2026-04-11T09:25:36.081704+00:00","updated_at":"2026-04-16T17:52:56.989345+00:00","problems":[{"fix":"Ensure that all items in the list you are assigning conform to the `item_type` defined for the `param.List` parameter.","cause":"This error occurs when you attempt to assign a list containing items of an incorrect type to a `param.List` parameter that has a specified `item_type`.","error":"TypeError: List parameter 'L.ls' items must be instances of <class 'str'>, not <class 'int'>."},{"fix":"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`.","cause":"This error typically arises when attempting to access the `.param` attribute on a standard Pandas DataFrame object, which is not a `param.Parameterized` object. The `.param` attribute is specific to classes that inherit from `param.Parameterized`.","error":"AttributeError: 'DataFrame' object has no attribute 'param'"},{"fix":"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.","cause":"When using the `@param.depends` decorator with `on_init=True` to trigger a method on initialization, the method will not execute unless `watch=True` is also explicitly set. `on_init=True` merely marks it for potential initialization execution, while `watch=True` enables the active monitoring and execution.","error":"param.depends(on_init=True) does not execute without watch=True"},{"fix":"Install the 'param' library using pip: `pip install param`.","cause":"This error means that the Python interpreter cannot find the 'param' library. This usually happens if the library is not installed in the active Python environment or if there's a typo in the import statement.","error":"ModuleNotFoundError: No module named 'param'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.4.1","cli_name":"","cli_version":null,"type":"library","homepage":"https://param.holoviz.org/","github":"https://github.com/holoviz/param","docs":null,"changelog":"https://github.com/holoviz/param/releases","pypi":"https://pypi.org/project/param/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","data","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-28","next_check":"2026-07-28","install_tag":null}}