{"id":40584957,"url":"https://github.com/savannahostrowski/pyrepl-web","last_synced_at":"2026-02-08T01:08:05.985Z","repository":{"id":333779347,"uuid":"1138651787","full_name":"savannahostrowski/pyrepl-web","owner":"savannahostrowski","description":"An embeddable Python REPL, powered by Pyodide","archived":false,"fork":false,"pushed_at":"2026-01-27T06:20:57.000Z","size":73,"stargazers_count":27,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-27T18:48:44.826Z","etag":null,"topics":["pyodide","pyrepl","python","repl","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/pyrepl-web","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/savannahostrowski.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-21T00:16:56.000Z","updated_at":"2026-01-27T06:21:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/savannahostrowski/pyrepl-web","commit_stats":null,"previous_names":["savannahostrowski/pyrepl-web"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/savannahostrowski/pyrepl-web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannahostrowski%2Fpyrepl-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannahostrowski%2Fpyrepl-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannahostrowski%2Fpyrepl-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannahostrowski%2Fpyrepl-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/savannahostrowski","download_url":"https://codeload.github.com/savannahostrowski/pyrepl-web/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savannahostrowski%2Fpyrepl-web/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29216080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T00:10:47.190Z","status":"ssl_error","status_checked_at":"2026-02-08T00:10:43.589Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","pyrepl","python","repl","wasm","webassembly"],"created_at":"2026-01-21T03:02:21.466Z","updated_at":"2026-02-08T01:08:05.980Z","avatar_url":"https://github.com/savannahostrowski.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyrepl-web\n\nAn embeddable Python REPL, powered by Pyodide.\n\n[Live demo](https://playground.fastapicloud.dev/)\n\n## Getting started\n\nInclude the script and use the `\u003cpy-repl\u003e` web component:\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/pyrepl-web/dist/pyrepl.js\"\u003e\u003c/script\u003e\n\n\u003cpy-repl\u003e\u003c/py-repl\u003e\n```\n\nThat's it! No install needed.\n\n## Features\n\n- **Python 3.13** in the browser via WebAssembly (Pyodide)\n- **Syntax highlighting** powered by Pygments\n- **Tab completion** for modules, functions, and variables\n- **Command history** with up/down arrows\n- **Smart indentation** for multi-line code\n- **Keyboard shortcuts**: Ctrl+L (clear), Ctrl+C (cancel)\n- **PyPI packages**: preload popular libraries\n- **Startup scripts**: run Python on load to set up the environment\n- **Theming**: built-in dark/light themes or fully custom\n\n## Attributes\n\n| Attribute | Description | Default |\n|-----------|-------------|---------|\n| `theme` | Color theme name (builtin or registered via `window.pyreplThemes`) | `catppuccin-mocha` |\n| `packages` | Comma-separated list of PyPI packages to preload | none |\n| `repl-title` | Custom title in the header bar | `Python REPL` |\n| `src` | Path to a Python startup script (see below) | none |\n| `no-header` | Hide the header bar (boolean attribute) | not set |\n| `no-buttons` | Hide copy/clear buttons in header (boolean attribute) | not set |\n| `readonly` | Disable input, display only (boolean attribute) | not set |\n| `no-banner` | Hide the \"Python 3.13\" startup banner (boolean attribute) | not set |\n\n### Startup Scripts\n\nUse `src` to preload a Python script that sets up the environment:\n\n```html\n\u003cpy-repl src=\"/scripts/setup.py\" packages=\"pandas\"\u003e\u003c/py-repl\u003e\n```\n\nThe script runs silently to populate the namespace. If you define a `setup()` function, it will be called after loading and its output is visible in the terminal:\n\n```python\n# setup.py\nimport pandas as pd\n\ndf = pd.DataFrame({'name': ['Alice', 'Bob'], 'age': [30, 25]})\n\ndef setup():\n    print(\"DataFrame loaded:\")\n    print(df)\n```\n\n### Theming\n\nBuilt-in themes: `catppuccin-mocha` (dark, default) and `catppuccin-latte` (light).\n\n#### Custom Themes\n\nRegister custom themes via `window.pyreplThemes` before loading the script. Only `background` and `foreground` are required - everything else is automatically derived:\n\n```html\n\u003cscript\u003e\nwindow.pyreplThemes = {\n  'my-theme': {\n    background: '#1a1b26',\n    foreground: '#a9b1d6',\n  }\n};\n\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/pyrepl-web/dist/pyrepl.js\"\u003e\u003c/script\u003e\n\n\u003cpy-repl theme=\"my-theme\"\u003e\u003c/py-repl\u003e\n```\n\n**What gets auto-derived from your background color:**\n- Terminal colors (red for errors, green for success, etc.) - from catppuccin-mocha (dark) or catppuccin-latte (light)\n- Syntax highlighting - uses the matching catppuccin Pygments style\n- Header colors - derived from the base theme\n\n#### Theme Properties\n\n| Property | Description |\n|----------|-------------|\n| `background` | Terminal background color (required) |\n| `foreground` | Default text color (required) |\n| `headerBackground` | Header bar background (optional) |\n| `headerForeground` | Header title color (optional) |\n| `promptColor` | Prompt `\u003e\u003e\u003e` color - hex (`#7aa2f7`) or name (`green`, `cyan`) (optional) |\n| `pygmentsStyle` | Custom syntax highlighting (optional, see below) |\n\n#### Syntax Highlighting\n\nSyntax highlighting uses [Pygments](https://pygments.org/). The style is chosen automatically:\n\n1. If your theme name matches a [Pygments style](https://pygments.org/styles/) (e.g., `monokai`, `dracula`), that style is used\n2. Otherwise, uses `catppuccin-mocha` for dark backgrounds or `catppuccin-latte` for light backgrounds\n\nFor full control, provide a `pygmentsStyle` mapping [Pygments tokens](https://pygments.org/docs/tokens/) to colors:\n\n```html\n\u003cscript\u003e\nwindow.pyreplThemes = {\n  'tokyo-night': {\n    background: '#1a1b26',\n    foreground: '#a9b1d6',\n    promptColor: '#bb9af7',\n    pygmentsStyle: {\n      'Keyword': '#bb9af7',\n      'String': '#9ece6a',\n      'Number': '#ff9e64',\n      'Comment': '#565f89',\n      'Name.Function': '#7aa2f7',\n      'Name.Builtin': '#7dcfff',\n    }\n  }\n};\n\u003c/script\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavannahostrowski%2Fpyrepl-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsavannahostrowski%2Fpyrepl-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavannahostrowski%2Fpyrepl-web/lists"}