{"id":13736904,"url":"https://github.com/posit-dev/py-shinylive","last_synced_at":"2025-04-06T06:07:02.233Z","repository":{"id":62210159,"uuid":"530417994","full_name":"posit-dev/py-shinylive","owner":"posit-dev","description":"Python package for deploying Shinylive applications","archived":false,"fork":false,"pushed_at":"2024-10-29T22:12:09.000Z","size":121,"stargazers_count":44,"open_issues_count":6,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-30T00:39:02.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://shiny.posit.co/py/docs/shinylive.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/posit-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-29T22:44:07.000Z","updated_at":"2024-10-29T22:12:13.000Z","dependencies_parsed_at":"2023-10-02T21:32:38.744Z","dependency_job_id":"ed5fde5c-e59d-463d-969a-f471d4ad503d","html_url":"https://github.com/posit-dev/py-shinylive","commit_stats":null,"previous_names":["posit-dev/py-shinylive","rstudio/py-shinylive"],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fpy-shinylive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fpy-shinylive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fpy-shinylive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fpy-shinylive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posit-dev","download_url":"https://codeload.github.com/posit-dev/py-shinylive/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441045,"owners_count":20939239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T03:01:31.030Z","updated_at":"2025-04-06T06:07:02.217Z","avatar_url":"https://github.com/posit-dev.png","language":"Python","readme":"Shinylive Python package\n========================\n\n[![Build and test](https://github.com/posit-dev/py-shinylive/actions/workflows/build.yml/badge.svg)](https://github.com/posit-dev/py-shinylive/actions/)\n[![PyPI Latest Release](https://img.shields.io/pypi/v/shinylive.svg)](https://pypi.org/project/shinylive/)\n\n[Documentation site](https://github.com/posit-dev/py-shinylive)\n\nThe goal of the shinylive Python package is to help you create Shinylive applications from your [Shiny for Python](https://shiny.posit.co/py) applications.\nShinylive runs Shiny entirely in the browser, without any need for a hosted server, using WebAssembly via [pyodide](https://pyodide.org/en/stable/).\n\n## About Shinylive\n\nThe Shinylive project consists of four interdependent components that work together in several different contexts.\n\n1. Shinylive ([posit-dev/shinylive](https://github.com/posit-dev/shinylive)) is a web assets library that runs Shiny applications in the browser. You can try it out online at [shinylive.io/r](https://shinylive.io/r) or [shinylive.io/py](https://shinylive.io/py).\n\n2. The [shinylive Python package](https://shiny.posit.co/py/docs/shinylive.html) ([posit-dev/py-shinylive](https://github.com/posit-dev/py-shinylive)) helps you export your Shiny applications from local files to a directory that can be hosted on a static web server.\n\n   The Python package also downloads the Shinylive web assets mentioned above and manages them in a local cache. These assets are included in the exported Shinylive applications and are used to run your Shiny app in the browser.\n\n3. The shinylive R package ([posit-dev/r-shinylive](https://github.com/posit-dev/r-shinylive)) serves the same role as the shinylive Python package but for Shiny for R apps.\n\n4. The [shinylive Quarto extension](https://quarto-ext.github.io/shinylive/) ([quarto-ext/shinylive](https://github.com/quarto-ext/shinylive)) lets you write Shiny applications in [Quarto web documents and slides](https://quarto.org) and uses the Python or R package (or both) to translate `shinylive-py` or `shinylive-r` code blocks into Shinylive applications.\n\n## Installation\n\n```\npip install shinylive\n```\n\n\n## Usage\n\n(Optional) Create a basic shiny application in a new directory `myapp/`:\n\n```\nshiny create myapp\n```\n\nOnce you have a Shiny application in `myapp/` and would like turn it into a Shinylive app in `site/`:\n\n```\nshinylive export myapp site\n```\n\nThen you can preview the application by running a web server and visiting it in a browser:\n\n```\npython3 -m http.server --directory site --bind localhost 8008\n```\n\nAt this point, you can deploy the `site/` directory to any static web hosting service.\n\n\n### Multiple applications\n\nIf you have multiple applications that you want to put on the same site, you can export them to subdirectories of the site, so that they can all share the same Shinylive assets. You can do this with the `--subdir` option:\n\n```bash\nshinylive export myapp1 site --subdir app1\nshinylive export myapp2 site --subdir app2\n```\n\n\n## Shinylive asset management\n\nEach version of the Shinylive Python package is associated with a particular version of the Shinylive web assets. ([See the releases here](https://github.com/posit-dev/shinylive/releases).)\n\nTo see which version of this Python package you have, and which version of the web assets it is associated with, simply run `shinylive` at the command prompt:\n\n```\n$ shinylive\nUsage: shinylive [OPTIONS] COMMAND [ARGS]...\n\n  shinylive Python package version: 0.1.0\n  shinylive web assets version:     0.2.1\n...\n```\n\nThe web assets will be downloaded and cached the first time you run `shinylive export`. Or, you can run `shinylive assets download` to fetch them.\n\n```\n$ shinylive assets download\nDownloading https://github.com/posit-dev/shinylive/releases/download/v0.2.1/shinylive-0.2.1.tar.gz...\nUnzipping to /Users/username/Library/Caches/shinylive/\n```\n\nTo see what versions you have installed, run `shinylive assets info`:\n\n```\n$ shinylive assets info\n    Local cached shinylive asset dir:\n    /Users/username/Library/Caches/shinylive\n\n    Installed versions:\n    /Users/username/Library/Caches/shinylive/shinylive-0.2.1\n    /Users/username/Library/Caches/shinylive/shinylive-0.0.6\n```\n\nYou can remove old versions with `shinylive assets cleanup`. This will remove all versions except the one that the Python package wants to use:\n\n```\n$ shinylive assets cleanup\nKeeping version 0.2.1\nRemoving /Users/username/Library/Caches/shinylive/shinylive-0.0.6\n```\n\nIf you want to force it to remove a specific version, use the `shinylive assets remove xxx`:\n\n```\n$ shinylive assets remove 0.2.1\nRemoving /Users/username/Library/Caches/shinylive/shinylive-0.2.1\n```\n","funding_links":[],"categories":["Shiny for Python"],"sub_categories":["Python - Deploy"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fpy-shinylive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposit-dev%2Fpy-shinylive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fpy-shinylive/lists"}