Registry / web-framework / trame-router

trame-router

JSON →
library2.3.0pypypi✓ verified 81d ago

Vue Router integration for trame, providing navigation and route management for trame applications. Current version 2.3.0, actively maintained as part of the trame ecosystem.

pip install trame-router
INSTALL
IMPORT
SIG · TRAME-ROUTER
T
trame-router
web-frameworkpythonv2.3.0
Install
1.7s avg
Import
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.3.0 · 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.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 20MB
18MB installed
● package 18MB
Code
Verified usage

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

get_version
from trame_router import get_version
from trame_router.widgets import RouterView

Basic setup for a trame app with Vue Router.

from trame.app import get_server from trame_router.widgets import RouterView, RouterLink server = get_server() server.state['routes'] = [ {'path': '/', 'component': 'Home'}, {'path': '/about', 'component': 'About'} ] @server.expose def navigate(): server.state.trame__router = '/about' with server.layout as layout: layout.add_child(RouterLink(to="/about", label="About")) layout.add_child(RouterView()) server.start()
Debug
Known issues
breakingIn version 2.0.0, the import path changed from 'trame_router' to 'trame_router.widgets'. Old imports will break.
fix
Update imports: from trame_router.widgets import RouterView, RouterLink
affects: <2.0.0
gotchaRoutes must be defined in server.state['routes'] and components must be registered as strings (names of Vue components). Defining components inline in Python does not work.
fix
Create Vue components in separate .js files or use trame's component registration.
affects: all
Upgrade
Version history
2.3.0latest on PyPI · released Aug 5, 2024
Audit
Dependencies
tramerequiredCore framework required
trame-vuetifyoptionalCommon UI components for navigation
Agent activity
4 hits · last 30 days
node
4
Resources
trame-router — pip install trame-router · libregistry