{"id":13586324,"url":"https://github.com/custom-components/pyscript","last_synced_at":"2026-05-03T00:08:51.744Z","repository":{"id":39964259,"uuid":"283847957","full_name":"custom-components/pyscript","owner":"custom-components","description":"Pyscript adds rich Python scripting to HASS","archived":false,"fork":false,"pushed_at":"2025-04-13T17:52:48.000Z","size":1696,"stargazers_count":984,"open_issues_count":104,"forks_count":54,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-13T18:44:36.698Z","etag":null,"topics":["custom-component","custom-components","hacs","home-assistant","homeassistant","integration","jupyter"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/custom-components.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.rst","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}},"created_at":"2020-07-30T18:23:38.000Z","updated_at":"2025-04-13T17:52:51.000Z","dependencies_parsed_at":"2023-10-21T00:43:16.998Z","dependency_job_id":"3bf43540-f9bd-46d4-8e3f-3778a54d61cd","html_url":"https://github.com/custom-components/pyscript","commit_stats":{"total_commits":569,"total_committers":23,"mean_commits":24.73913043478261,"dds":"0.30755711775043937","last_synced_commit":"59b20116bfac0d7ec33948ba860ff9129f4b8727"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custom-components%2Fpyscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custom-components%2Fpyscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custom-components%2Fpyscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/custom-components%2Fpyscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/custom-components","download_url":"https://codeload.github.com/custom-components/pyscript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235696,"owners_count":22036963,"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":["custom-component","custom-components","hacs","home-assistant","homeassistant","integration","jupyter"],"created_at":"2024-08-01T15:05:28.596Z","updated_at":"2026-05-03T00:08:51.739Z","avatar_url":"https://github.com/custom-components.png","language":"Python","funding_links":[],"categories":["Python","Custom Integrations"],"sub_categories":["🛠️ Automation tooling"],"readme":"# Pyscript: Python Scripting for Home Assistant\n\n[![GitHub Release](https://img.shields.io/github/release/custom-components/pyscript.svg?style=for-the-badge)](https://github.com/custom-components/pyscript/releases)\n[![License](https://img.shields.io/github/license/custom-components/pyscript.svg?style=for-the-badge)](LICENSE)\n[![hacs](https://img.shields.io/badge/HACS-Default-orange.svg?style=for-the-badge)](https://github.com/hacs/integration)\n[![Project Maintenance](https://img.shields.io/badge/maintainer-%40craigbarratt-blue.svg?style=for-the-badge)](https://github.com/craigbarratt)\n\nThis HACS custom integration allows you to write Python functions and scripts that can implement a\nwide range of automation, logic and triggers. State variables are bound to Python variables and\nservices are callable as Python functions, so it's easy and concise to implement logic.\n\nFunctions you write can be configured to be called as a service or run upon time, state-change or\nevent triggers. Functions can also call any service, fire events and set state variables.  Functions\ncan sleep or wait for additional changes in state variables or events, without slowing or affecting\nother operations. You can think of these functions as small programs that run in parallel,\nindependently of each other, and they could be active for extended periods of time.\n\nPyscript also provides a kernel that interfaces with the Jupyter front-ends (eg, notebook, console,\nlab and VSCode). That allows you to develop and test pyscript code interactively. Plus you can interact\nwith much of HASS by looking at state variables, calling services etc.\n\nPyscript can also generate IDE stub modules by calling the `pyscript.generate_stubs` service.\nSee the “IDE Helpers” section of the docs for setup details.\n\n## Documentation\n\nHere is the [pyscript documentation](https://hacs-pyscript.readthedocs.io/en/stable).\n\nFor more information about the Jupyter kernel, see the [README](https://github.com/craigbarratt/hass-pyscript-jupyter/blob/master/README.md).\nThere is also a [Jupyter notebook tutorial](https://nbviewer.jupyter.org/github/craigbarratt/hass-pyscript-jupyter/blob/master/pyscript_tutorial.ipynb),\nwhich can be downloaded and run interactively in Jupyter notebook connected to your live HASS with pyscript.\n\n## Installation\n\n### Option 1: HACS\n\nUnder HACS -\u003e Integrations, select \"+\", search for `pyscript` and install it.\n\n### Option 2: Manual\n\nFrom the [latest release](https://github.com/custom-components/pyscript/releases) download the zip file `hass-custom-pyscript.zip`\n```bash\ncd YOUR_HASS_CONFIG_DIRECTORY    # same place as configuration.yaml\nmkdir -p custom_components/pyscript\ncd custom_components/pyscript\nunzip hass-custom-pyscript.zip\n```\n\nAlternatively, you can install the current GitHub master version by cloning and copying:\n```bash\nmkdir SOME_LOCAL_WORKSPACE\ncd SOME_LOCAL_WORKSPACE\ngit clone https://github.com/custom-components/pyscript.git\nmkdir -p YOUR_HASS_CONFIG_DIRECTORY/custom_components\ncp -pr pyscript/custom_components/pyscript YOUR_HASS_CONFIG_DIRECTORY/custom_components\n```\n\n### Install Jupyter Kernel\n\nInstalling the Pyscript Jupyter kernel is optional.  The steps to install and use it are in\nthis [README](https://github.com/craigbarratt/hass-pyscript-jupyter/blob/master/README.md).\n\n## Configuration\n\n* Go to the Integrations menu in the Home Assistant Configuration UI and add `Pyscript Python scripting` from there. Alternatively, add `pyscript:` to `\u003cconfig\u003e/configuration.yaml`; pyscript has three optional configuration parameters that allow any python package to be imported if set, expose `hass` as a variable, and temporarily switch back to the legacy decorator subsystem; all three default to `false`:\n    ```yaml\n    pyscript:\n      allow_all_imports: true\n      hass_is_global: true\n      legacy_decorators: true\n    ```\n   Starting with version `2.0.0`, pyscript uses the new decorator subsystem by default. If you find a problem in the new implementation, you can temporarily set `legacy_decorators: true` to switch back to the legacy one. If you do, please also file a bug report in [GitHub Issues](https://github.com/custom-components/pyscript/issues) so the new subsystem can be fixed.\n* Add files with a suffix of `.py` in the folder `\u003cconfig\u003e/pyscript`.\n* Restart HASS.\n* Whenever you change a script file, make a `reload` service call to `pyscript`.\n* Watch the HASS log for `pyscript` errors and logger output from your scripts.\n\n## Contributing\n\nContributions are welcome! You are encouraged to submit PRs, bug reports, feature requests or add to\nthe Wiki with examples and tutorials. It would be fun to hear about unique and clever applications\nyou develop. Please see this [README](https://github.com/custom-components/pyscript/tree/master/tests)\nfor setting up a development environment and running tests.\n\nEven if you aren't a developer, please participate in our\n[discussions community](https://github.com/custom-components/pyscript/discussions).\nHelping other users is another great way to contribute to pyscript!\n\n## Useful Links\n\n* [Documentation stable](https://hacs-pyscript.readthedocs.io/en/stable): latest release\n* [Documentation latest](https://hacs-pyscript.readthedocs.io/en/latest): current master in Github\n* [Discussion and help](https://github.com/custom-components/pyscript/discussions)\n* [Issues](https://github.com/custom-components/pyscript/issues)\n* [Wiki](https://github.com/custom-components/pyscript/wiki)\n* [GitHub repository](https://github.com/custom-components/pyscript) (please add a star if you like pyscript!)\n* [Release notes](https://github.com/custom-components/pyscript/releases)\n* [Jupyter notebook tutorial](https://nbviewer.jupyter.org/github/craigbarratt/hass-pyscript-jupyter/blob/master/pyscript_tutorial.ipynb)\n\n## Copyright\n\nCopyright (c) 2020-2026 Craig Barratt.  May be freely used and copied according to the terms of the\n[Apache 2.0 License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustom-components%2Fpyscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcustom-components%2Fpyscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcustom-components%2Fpyscript/lists"}