PyChromecast
Python module to talk to Google Chromecast.
What it is and what it does
PyChromecast is a Python library for communicating with Google Chromecast and Cast-enabled devices on a local network. It handles device discovery via mDNS, connection management, and playback control through the Chromecast API v2. The library abstracts the protocol details so you can discover devices by name, start media playback, pause or resume, and extend functionality by registering custom controllers for app-specific namespaces.
The package is built on protobuf for message serialization, zeroconf for mDNS discovery, and casttube for additional protocol support. It's designed for Python 3.11+ and requires network multicast capability. Common use cases include automation frameworks (notably Home Assistant), media center integrations, and multi-room audio control.
Use it for:
- Discover and list all Chromecast devices on a network, then connect to specific ones by friendly name.
- Play online media files on a Chromecast and control playback (play, pause, seek) programmatically.
- Build automation routines that cast media to different rooms based on time or events.
- Extend support for custom Chromecast apps by implementing controllers for unsupported namespaces.
- Monitor and control multi-room audio setups with multiple Cast Audio devices.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Communicate with Google Chromecast devices over the network to discover them, control playback, and send commands via custom namespaces.
Yes. Active maintenance, low install friction, permissive license, and no known vulnerabilities make this a solid choice for Chromecast integration. Requires Python 3.11+ and network multicast support; verify those constraints match your environment before installing.
Install
pychromecast on PyPI
pip
pip install pychromecastuv
uv add pychromecastpoetry
poetry add pychromecastInstalling PyChromecast
Before you install
Low friction install with three straightforward runtime dependencies (protobuf, zeroconf, casttube). Active maintenance with a recent commit on 2026-08-03 and 2677 repository stars.
License in practice
MIT license is permissive, allowing use in commercial and private projects with minimal restrictions.
Quickstart
import pychromecast
import zeroconf
zconf = zeroconf.Zeroconf()
browser = pychromecast.CastBrowser(
pychromecast.SimpleCastListener(lambda uuid, service: print(browser.devices[uuid].friendly_name)),
zconf
)
browser.start_discovery()
chromecasts, browser = pychromecast.get_listed_chromecasts(friendly_names=["Living Room"])
cast = chromecasts[0]
cast.wait()
mc = cast.media_controller
mc.play_media('http://example.com/video.mp4', 'video/mp4')
Requires Python 3.11+. Multicast UDP on port 5353 must be available on the network for device discovery to work.
Verify before relying
- Whether casttube is actively maintained and what role it plays in the dependency chain.
- Specific Chromecast models or firmware versions known to work or have compatibility issues.
- Performance characteristics when discovering or controlling many devices simultaneously.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.11.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — protobuf, zeroconf, casttube |
| Maintenance | actively maintained — 160 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 225,100/month — #9,227 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pychromecast-14.0.10-py2.py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
casttubeInteract with YouTube on Chromecast devices by…
permissive · top 15,000 on PyPI
gassist-textWraps the Google Assistant API to send text…
permissive · top 15,000 on PyPI
pynetgearpyNetgear provides a Python API to communicate…
permissive · top 15,000 on PyPI
BAC0BAC0 is an asynchronous Python scripting…
copyleft · top 15,000 on PyPI
libsoundtouchControl Bose Soundtouch devices over the…
permissive · top 15,000 on PyPI
wiimwiim provides a Python API to discover,…
permissive · top 15,000 on PyPI
pychromePychrome provides a Python interface to control…
permissive · top 15,000 on PyPI
python-ecobee-apiA Python library for communicating with Ecobee3…
permissive · top 15,000 on PyPI
sonos-websocketAsync Python library for communicating with…
permissive · top 15,000 on PyPI
choreographerChoreographer provides remote control of…
unclear · top 5,000 on PyPI