# custom-components/pyscript

Pyscript adds rich Python scripting to HASS

Repository: https://github.com/custom-components/pyscript
Canonical: https://ross.abutalabs.com/products/custom-components-pyscript
Language: Python
License: Apache-2.0
License Family: permissive
Topics: home-assistant, homeassistant, custom-component, custom-components, hacs, integration, jupyter
Last push: 2026-08-31T14:59:09+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 100, release rhythm 85, longevity 100
- inputs: {"age_days": 2225, "days_push": 2, "days_rel": 22, "gap_med": 57.5, "n_releases_24m": 7}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1181, forks 67 (observed 2026-09-01T02:14:00.617864+00:00)

## What it is
Pyscript is a Home Assistant custom integration (installable via HACS) that lets you write automations and logic as Python functions, with state variables bound to Python variables and services callable as functions. It also ships a Jupyter kernel for interactively developing and testing pyscript code against a live Home Assistant instance.

## Use cases
- write home assistant automations in python
- replace yaml automations with python scripts
- trigger functions on state changes or events in home assistant
- test home assistant logic interactively in jupyter
- call home assistant services from python code
- build complex smart home logic with python

## When to choose
- you want to write Home Assistant automations in Python instead of YAML
- you need rich logic like loops, conditionals, and long-running tasks in automations
- you want to develop and debug automations interactively with Jupyter
- you prefer Python variable bindings to state variables and service calls

## When to avoid
- you only need simple automations that YAML or the UI editor already handle well
- you don't use Home Assistant
- you want a fully supported, core-integration solution rather than a community custom component
- you need automations editable by non-programmers through the UI

## Facets
- artifact type: plugin
- maturity: active
- function: workflow-automation, interpreter, sdk
- domain: iot, developer-tools
- platform: python, self-hosted, iot
- tags: home-assistant, hacs, custom-component, jupyter-kernel, python-scripting, smart-home, automation

## Member repositories
- custom-components/pyscript (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-09-01T02:14:00.617864+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:25:01.457858+00:00, confidence not recorded.
  - readme: https://github.com/custom-components/pyscript (fetched 2026-09-01T02:14:00.617864+00:00, sha 22bec9190d45)
- Data as of 2026-08-30T08:39:29.467469+00:00.
