Registry / web-framework / trame
library3.13.2pypypi✓ verified 86d ago

Trame is an easy-to-use, Python-based framework that lets you create web applications with interactive scientific visualization. It simplifies web development by managing UI layout, state, events, and widgets entirely in Python, abstracting away the need for HTML, CSS, or JavaScript. Trame applications can run locally, remotely, in the cloud, in Jupyter, or on HPC. The library maintains an active release cadence, with version 3.12.0 being the latest stable release.

pip install trame
INSTALL
IMPORT
SIG · TRAME
T
trame
web-frameworkpythonv3.13.2
Install
4.7s avg
Import
693ms
Disk
34MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.13.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.729s · 33.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 4.7s · import 0.657s · 37MB
34MB installed
● package 34MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get_server
from trame.app import get_server
SinglePageLayout
from trame.ui.vuetify3 import SinglePageLayout
from trame.ui.vuetify import SinglePageLayout
For Trame v3+, the default client is Vue3, so import from `vuetify3`. Older Vue2-based layouts or widgets will cause issues.
v3
from trame.widgets import vuetify3 as v3
from trame.widgets import vuetify as v2
Trame v3 defaults to Vue3 widgets. Use `vuetify3` for new projects. Older `vuetify` (Vue2) widgets may still be used if `server.client_type` is explicitly set to 'vue2'.

This quickstart code initializes a Trame server, sets a reactive state variable, and defines a simple single-page layout using Vuetify3 widgets. It creates a card with a title that updates when a button is clicked, demonstrating basic interactivity. The application runs locally and opens in a web browser upon execution.

from trame.app import get_server from trame.ui.vuetify3 import SinglePageLayout from trame.widgets import vuetify3 as v3 server = get_server(client_type="vue3") # Explicitly set for clarity in v3+ apps server.state.name = "Trame" with SinglePageLayout(server) as layout: layout.title.set_text("Hello Trame") with layout.content: with v3.VContainer(classes="fill-height", fluid=True): with v3.VRow(classes="fill-height", align="center", justify="center"): with v3.VCol(cols=12, sm=6, md=4): v3.VCard( v3.VCardTitle(classes="headline", children=["Welcome to ", ('name', 'Trame App')]), v3.VCardText("This is a simple Trame application running in Vue3!"), v3.VCardActions( v3.VSpacer(), v3.VBtn('Click me!', click='server.state.name = "Updated Trame"'), v3.VSpacer(), ) ) if __name__ == '__main__': server.start()
trame --version
Debug
Known issues
breakingTrame v3 changed the default client type from Vue2 to Vue3 in January 2024. Existing applications built with Trame v2 that relied on Vue2 components will need to explicitly set `server.client_type = "vue2"` or migrate to Vue3 components.
fix
For existing v2 apps, add `server.client_type = "vue2"` after `get_server()`. For new v3 apps, use `vuetify3` imports (e.g., `from trame.ui.vuetify3 import SinglePageLayout`, `from trame.widgets import vuetify3 as v3`).
affects: 3.0.0+
breakingIn Trame v3, 'trame-vuetify' and 'trame-vtk' are no longer bundled by default with the core `trame` package. They must be installed separately if you intend to use Vuetify UI components or VTK visualizations.
fix
Install optional dependencies explicitly: `pip install trame-vuetify trame-vtk`.
affects: 3.0.0+
deprecatedThe `trame.app.jupyter` package has been removed in Trame v3 as Jupyter integration is now directly part of the layouts. The `trame.app.dev` package is also considered deprecated and generally not needed for 99.99% of users.
fix
Avoid using `trame.app.jupyter` and `trame.app.dev`. Rely on direct Jupyter integration provided by current layouts.
affects: 3.0.0+
gotchaWhen combining Trame with custom command-line argument parsers (e.g., `argparse`), ensure that your arguments do not overlap with Trame's built-in server arguments.
fix
If arguments overlap, use the `--trame-args` flag to pass specific arguments to the Trame server, e.g., `python your_app.py --my-custom-arg 123 --trame-args --port 8081`.
affects: All versions
gotchaAPI changes in underlying front-end libraries (like Vuetify from v2 to v3) can affect Trame widgets, even if Trame itself aims for API compatibility.
fix
Consult the documentation for `trame-vuetify3` and other specific widget libraries to understand any API differences when migrating or developing for Vue3.
affects: 3.0.0+
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'trame'
The 'trame' library has not been installed in your Python environment, or the environment where you are running the script is not the one where Trame was installed.
fix
pip install trame
ModuleNotFoundError: No module named 'trame.widgets.vuetify'
The specific Trame widget package (e.g., 'trame-vuetify') has not been installed; the base 'trame' package does not include all widget sets, which are distributed as separate packages.
fix
pip install trame-vuetify
AttributeError: 'App' object has no attribute 'start'
The 'start()' method to run the Trame server is invoked on the 'App' instance directly, rather than on the 'Server' object obtained from 'get_server()'.
fix
from trame.app import get_server
server = get_server()
server.start()
RuntimeError: Server could not be started
The specified port for the Trame server is already in use by another application or process, or there's a network configuration issue preventing the server from binding to the port.
fix
Try running the Trame application on a different port using 'server.start(port=8081)' or by setting the TRAME_APP_PORT environment variable before starting the application.
Upgrade
Version history
3.13.2latest on PyPI · released May 15, 2026
Audit
Dependencies
trame-vuetifyoptionalProvides Vuetify UI components for building rich user interfaces.
trame-vtkoptionalEnables 3D visualization capabilities using VTK (Visualization Toolkit).
pywebviewoptionalRequired for packaging Trame applications as desktop apps with the '--app' flag.
jupyterlaboptionalNeeded to run Trame applications directly within JupyterLab environments.
notebookoptionalNeeded to run Trame applications directly within classic Jupyter Notebook environments.
requestsoptionalRequired when Trame applications need to interact with remote assets, such as GDrive files.
Agent activity
23 hits · last 30 days
node
20
OpenAI (training)
1
Resources
trame — pip install trame · libregistry