{"id":24974747,"url":"https://github.com/kermanx/slidev-addon-python-runner","last_synced_at":"2025-04-11T11:16:50.218Z","repository":{"id":265498155,"uuid":"896144617","full_name":"kermanx/slidev-addon-python-runner","owner":"kermanx","description":"A Slidev addon for running Python code in your slides.","archived":false,"fork":false,"pushed_at":"2024-12-02T04:06:46.000Z","size":269,"stargazers_count":18,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T07:41:28.273Z","etag":null,"topics":["pyodide","python","slidev","slidev-addon"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/kermanx.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-11-29T16:30:03.000Z","updated_at":"2025-03-18T06:16:55.000Z","dependencies_parsed_at":"2024-11-29T16:50:02.199Z","dependency_job_id":"bf533b64-5a85-4e8c-a979-8c7948695b03","html_url":"https://github.com/kermanx/slidev-addon-python-runner","commit_stats":null,"previous_names":["kermanx/slidev-addon-python-runner"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kermanx%2Fslidev-addon-python-runner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kermanx%2Fslidev-addon-python-runner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kermanx%2Fslidev-addon-python-runner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kermanx%2Fslidev-addon-python-runner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kermanx","download_url":"https://codeload.github.com/kermanx/slidev-addon-python-runner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248381789,"owners_count":21094528,"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":["pyodide","python","slidev","slidev-addon"],"created_at":"2025-02-03T20:14:51.611Z","updated_at":"2025-04-11T11:16:50.152Z","avatar_url":"https://github.com/kermanx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slidev-addon-python-runner\n\nPython runner for the [Monaco Runner feature](https://sli.dev/features/monaco-run) in [Slidev](https://sli.dev/). Code executed in browser using [Pyodide](https://pyodide.org/).\n\n![Demo](https://cdn.jsdelivr.net/gh/KermanX/slidev-addon-python-runner/assets/demo.png)\n\n## Usage\n\nFirstly, install the package:\n\n```bash\nnpm install slidev-addon-python-runner\n```\n\nThen, add it as an addon in your headmatter in `slides.md`:\n\n```md\n---\naddons:\n  - slidev-addon-python-runner\n\n# Optional configuration for this runner\npython:\n  # Install packages from PyPI. Default: []\n  installs: [\"cowsay\"]\n\n  # Code executed to set up the environment. Default: \"\"\n  prelude: |\n    GREETING_FROM_PRELUDE = \"Hello, Slidev!\"\n\n  # Automatically load the imported builtin packages. Default: true\n  loadPackagesFromImports: true\n\n  # Disable annoying warning from `pandas`. Default: true\n  suppressDeprecationWarnings: true\n\n  # Always reload the Python environment when the code changes. Default: false\n  alwaysReload: false\n\n  # Options passed to `loadPyodide`. Default: {}\n  loadPyodideOptions: {}\n---\n```\n\nTo add an interactive Python code runner, use the `monaco-run` directive:\n\n````md\n```py {monaco-run}\nfrom termcolor import colored\n\nprint(colored(\"Hello, Slidev!\", \"blue\"))\n```\n````\n\n## Bundle `pyodide`\n\nBy default, when building slides (i.e. `slidev build`), the `pyodide` package will be replaced with the CDN version. This is because of https://github.com/pyodide/pyodide/issues/1949, which causes the imported python packages to be lost when using the bundled version.\n\nTo bundle the local version of `pyodide`, set the `PYODIDE_BUNDLE` environment variable to `true`. Note that in this way you can't import python packages in the static build.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkermanx%2Fslidev-addon-python-runner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkermanx%2Fslidev-addon-python-runner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkermanx%2Fslidev-addon-python-runner/lists"}