Skip to main content
Test and Release

Trame-router extend trame widgets and ui with Vue Router components and helper to streamline its usage with trame. Vue Router is the official router for Vue.js on which trame is based.

Installing

trame-router can be installed with pip:

pip install trame-router

Development

# Create venv and install all dependencies
uv sync --all-extras --dev

# Activate environment
source .venv/bin/activate

# Install commit analysis
pre-commit install
pre-commit install --hook-type commit-msg

# Run pre-commit
pre-commit run --all-files

Usage

The Trame Tutorial is the place to go to learn how to use the library and start building your own application.

The API Reference documentation provides API-level documentation.

The original Vue Router documentation provide a great introduction resource.

The router elements can be used as follow in trame:

# [...]
from trame.ui.router import RouterViewLayout
from trame.widgets import router

with RouterViewLayout(server, "/"):
    with vuetify.VCard():
        vuetify.VCardTitle("This is home")

with RouterViewLayout(server, "/foo"):
    with vuetify.VCard():
        vuetify.VCardTitle("This is foo")

with RouterViewLayout(server, "/bar/:id"):
    with vuetify.VList():
        vuetify.VListItem("Bar {{ $route.params.id }} item 1")
        vuetify.VListItem("Bar {{ $route.params.id }} item 2")
        vuetify.VListItem("Bar {{ $route.params.id }} item 3")

with SinglePageWithDrawerLayout(server) as layout:
    with layout.toolbar:
        vuetify.VBtn("Home", to="/")
        vuetify.VBtn("Foo", to="/foo")
        vuetify.VBtn("Bar 1", to="/bar/1")
        vuetify.VBtn("Bar 2", to="/bar/2")
        vuetify.VBtn("Bar 3", to="/bar/3")

    with layout.content:
        router.RouterView()

Environment variables

With vue3 and docker, trame-router can leverage the html5 history mode but by default we use the “hash” mode. To enable it, you need to define a TRAME_ROUTER_HISTORY_MODE environment variable that should either be set to “html5” or “hash”. This can only work if using our docker bundle or with a proper web server configuration when delivering the static HTML/JS/CSS content yourself.

License

trame-router is made available under the MIT License. For more details, see LICENSE This license has been chosen to match the one use by Vue Router which is used under the cover.

Community

Trame | Discussions | Issues | Contact Us

https://zenodo.org/badge/410108340.svg

Enjoying trame?

Share your experience with a testimonial or with a brand approval.

JavaScript dependency

This Python package bundle the following vue-router libraries. For client_type="vue2", it exposes vue-router@3.5.1 and for client_type="vue3", it exposes vue-router@5.3.1. If you would like us to upgrade any of those dependencies, please reach out.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trame_router-2.4.0.tar.gz (324.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trame_router-2.4.0-py3-none-any.whl (331.7 kB view details)

Uploaded Python 3

File details

Details for the file trame_router-2.4.0.tar.gz.

File metadata

  • Download URL: trame_router-2.4.0.tar.gz
  • Upload date:
  • Size: 324.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for trame_router-2.4.0.tar.gz
Algorithm Hash digest
SHA256 6bc1405cffcdd45b7b20d6ec4764d85b3ed7bd11b41975506a6121895a9829a0
MD5 4573744a5f92d4eb66a2858fa8ef6cd9
BLAKE2b-256 711c23799cb6052649184fa1f72358ea084413d2175ca2ea873014c75d63eac6

See more details on using hashes here.

Provenance

The following attestation bundles were made for trame_router-2.4.0.tar.gz:

Publisher: test_and_release.yml on Kitware/trame-router

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trame_router-2.4.0-py3-none-any.whl.

File metadata

  • Download URL: trame_router-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 331.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for trame_router-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90dc35f786fc3427b058c72ebc0a38c2b0354506324749a5a338bc434cabeef7
MD5 3e0a4e9c1683e0ca1e228ffe73bda04e
BLAKE2b-256 a682330a664be9dcb043b20f2676add357bb83fad223f8f66d1640dea1408014

See more details on using hashes here.

Provenance

The following attestation bundles were made for trame_router-2.4.0-py3-none-any.whl:

Publisher: test_and_release.yml on Kitware/trame-router

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

2.4.1

2 files

This release

2.4.0 This release

2 files

2.3.3

2 files

2.3.0

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.2

2 files

2.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page