{"id":18352036,"url":"https://github.com/posit-dev/py-shiny-workshop","last_synced_at":"2025-04-06T11:32:47.936Z","repository":{"id":181028638,"uuid":"656327629","full_name":"posit-dev/py-shiny-workshop","owner":"posit-dev","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-10T15:30:32.000Z","size":152814,"stargazers_count":18,"open_issues_count":13,"forks_count":33,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-21T22:22:17.569Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://posit-dev.github.io/py-shiny-workshop","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":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":"2023-06-20T18:11:58.000Z","updated_at":"2024-08-26T10:00:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"b84ff758-9c78-4658-832e-2e98d4575a46","html_url":"https://github.com/posit-dev/py-shiny-workshop","commit_stats":null,"previous_names":["rstudio/shiny-python-workshop-2023","posit-dev/shiny-python-workshop-2023","posit-dev/py-shiny-workshop"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fpy-shiny-workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fpy-shiny-workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fpy-shiny-workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/posit-dev%2Fpy-shiny-workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/posit-dev","download_url":"https://codeload.github.com/posit-dev/py-shiny-workshop/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.632Z","updated_at":"2025-04-06T11:32:42.928Z","avatar_url":"https://github.com/posit-dev.png","language":"Python","readme":"# shiny-python-workshop-2023\n\nThis is the repository for the 2023 Shiny for Python workshop.\n\n# Installation\n\nYou will need to install a few things to render the website locally:\n\n1) [Install quarto](https://quarto.org/docs/get-started/)\n2) Install the shinylive python package `pip install shinylive --upgrade`\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`.\nTo do a live preview run `quarto preview --render html`, note that while `--render html` is a bit slower, it's the best way to see changes with the included applications. \n\n## Creating an 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. \nTo include an application insert an asis quarto chuck which looks like this:\n\n```{python}\n#| echo: false\n#| output: asis\n\ninclude_shiny_folder(\"apps/basic-app\")\n```\n\nYou can also pass optins 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. \nYou can then use the `problem_tabs` function to include the tabs.\n\n```{python}\n#| echo: false\n#| output: asis\n\nproblem_tabs(\"apps/basic-app\")\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. \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# | 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 reacitve 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```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fpy-shiny-workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposit-dev%2Fpy-shiny-workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposit-dev%2Fpy-shiny-workshop/lists"}