{"id":18352034,"url":"https://github.com/posit-dev/intro-to-shiny-for-python","last_synced_at":"2025-04-06T11:32:47.699Z","repository":{"id":254749887,"uuid":"847418461","full_name":"posit-dev/intro-to-shiny-for-python","owner":"posit-dev","description":"Workshop materials for \"Intro to Shiny for Python\" using Shiny Express","archived":false,"fork":false,"pushed_at":"2024-09-03T17:16:02.000Z","size":115046,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T22:22:16.880Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://posit-dev.github.io/intro-to-shiny-for-python/","language":"CSS","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":null,"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":"2024-08-25T19:06:29.000Z","updated_at":"2024-11-27T13:03:38.000Z","dependencies_parsed_at":"2024-11-05T21:39:25.429Z","dependency_job_id":"81c0f656-76f0-44de-a9c1-290342ca415b","html_url":"https://github.com/posit-dev/intro-to-shiny-for-python","commit_stats":null,"previous_names":["posit-dev/intro-to-shiny-for-python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fintro-to-shiny-for-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fintro-to-shiny-for-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fintro-to-shiny-for-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fintro-to-shiny-for-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posit-dev","download_url":"https://codeload.github.com/posit-dev/intro-to-shiny-for-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478152,"owners_count":20945258,"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-11-05T21:34:30.419Z","updated_at":"2025-04-06T11:32:42.687Z","avatar_url":"https://github.com/posit-dev.png","language":"CSS","readme":"# Intro to Shiny for Python / Posit Conf::20204\n\nThis is the repository for the \"Intro to Shiny for Python\" workshop.\n\n\n## For students\n\nIf you're a student, please visit the course pages at https://posit-dev.github.io/intro-to-shiny-for-python/\n\n## Installation - for instructors only\n\nNote: These instructions are to build the website locally, and is should only be necessary if you want to teach this class.\n\nYou will need to install a few things to render the website locally:\n\n1) [Install quarto](https://quarto.org/docs/get-started/)\n\n2) Install the shinylive python package `pip install shinylive --upgrade`\n\n3) Install the shinylive quarto materials `quarto add quarto-ext/shinylive`\n\n### How to edit the materials\n\nThis is a quarto website, so to make changes to the course text modify the `.qmd` files, or the `_quarto.yml`.\n\nFor a quick preview, use:\n\n```sh\nquarto preview\n```\n\nBut for a more accurate preview, use:\n\n```sh\nquarto preview --render html\n```\n\nNote that while `--render html` is rather slow, it's the best way to see changes with the included applications. \n\n### Creating and including Shiny Apps\n\nAll of the apps live in the `apps` folder, which means that you can use VS Code to edit and test them out. \n\nTo include an application insert an `asis` quarto chunk which looks like this:\n\n`````` python\n```{python}\n##| echo: false\n##| output: asis\n\ninclude_shiny_folder(\"apps/basic-app\")\n```\n``````\n\nYou can also pass options to this function to modify the behaviour of the included app. \n\nTo include a set of problem tabs, your app should have two application files. `app.py` which shows the starting point for the problem and `app-solution.py` which shows the target application. \n\nYou can then use the `problem_tabs_express` function to include the tabs.\n\n`````` python\n```{python}\n##| echo: false\n##| output: asis\n\nproblem_tabs_express(\"apps/basic-app\")\n```\n```````\n\n### Inserting multiple choice questions\n\nYou can insert a shinylive app which displays sets of multiple choice questions by supplying a dictionary. \n\nIt is a good idea to always wrap this dictionary with the `Quiz` class which validates that it is the right format for the application.\n\n````` python\n```{python}\n## | echo: false\n## | output: asis\n\nfrom helpers import multiple_choice_app, Quiz\n\nquestions = Quiz(\n    {\n        \"What ui input is used for plots?\": {\n            \"choices\": [\"ui.input_plot\", \"ui.plot_input\", \"ui.plotInput\"],\n            \"answer\": \"ui.Input_plot\",\n        },\n        \"How do you remove a reactive link??\": {\n            \"choices\": [\"reactive.isolate\", \"req\", \"reactive.Effect\"],\n            \"answer\": \"reactive.isolate\",\n        },\n        \"What should you use to save an image of a plot to disk?\": {\n            \"choices\": [\"reactive.Calc\", \"@ui.output_plot\", \"reactive.Effect\"],\n            \"answer\": \"reactive.Effect\",\n        },\n    }\n)\n\nmultiple_choice_app(questions)\n```\n``````\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fintro-to-shiny-for-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposit-dev%2Fintro-to-shiny-for-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fintro-to-shiny-for-python/lists"}