Skip to content

eoda-dev/py-waiter

Repository files navigation

py-waiter

Getting started

This repository provides a py-shiny implementation of the waiter package from John Coene. The waiter package allows the usage of loading screens and spinners in shiny applications.

Installation

python -m venv venv
source venv/bin/activate

# Stable
pip install git+https://github.com/eodaGmbH/py-waiter@main

# Dev version
pip install git+https://github.com/eodaGmbH/py-waiter@dev

Usage

import time

from shiny import App, render, ui
from waiter import use_waiter, waiter_show
from waiter.spinners import spin_1

app_ui = ui.page_fluid(
    use_waiter(), # include dependencies
    ui.output_text_verbatim("txt", placeholder=True)
    # ...
)

def server(input, output, session):
    @render.text
    async def txt():
        await waiter_show("txt", html=spin_1()) # show spinner 1
        time.sleep(5)
        return "Hello Spinner!"

Examples

Development

First install Poetry, then run:

poetry install

poetry run pytest

poetry shell

Add dependencies:

poetry add shiny

Add dev dependencies:

poetry add isort@latest --group dev

Build:

poetry build

About

Loading screens for Shiny

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages