trame-common is a core component within the Trame ecosystem, providing dependency-less classes and functions for various trame packages like trame-client and trame-server. It offers a centralized collection of utilities for assets handling, decorators, asynchronous/throttled execution, and common Trame object patterns (Component, App, Widget, Singleton). While it is installable, it's primarily designed to be consumed as a dependency by other `trame` libraries rather than used standalone, enabling robust and efficient development across the Trame framework. Trame itself is an active, Python-based framework for creating interactive web applications with visual analytics, with a rapid release cadence for its main packages.
pip install trame-commonVerified import paths — ran on the pinned version, not inferred.
This example demonstrates a direct use of a utility from `trame_common.exec`, specifically the `throttle` decorator. It showcases how `trame-common` provides useful functions that can be integrated into Python code, often within a larger Trame application, to control execution frequency. The function `log_message` will be called at most once every second, despite being invoked more frequently.
When building Trame applications, usually `pip install trame` will bring in `trame-common` and its necessary components. If you need specific functionalities, explicitly import from `trame_common.*` within your Trame project.
Always refer to the specific `trame` package documentation that uses `trame-common` for its full dependency list. If directly using a `trame-common` module, monitor for `ImportError` and install missing packages as needed.
For existing Trame applications, explicitly set `server.client_type = "vue2"` during server initialization if you wish to retain Vue 2 compatibility. For new or updated applications, ensure your widgets and components are compatible with Vue 3.