skillfed

PyChromecast

Python module to talk to Google Chromecast.

pychromecast v14.0.10 225.1K downloads/30d#9,227 on PyPI2,677
Permissive license MIT Active released

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 pychromecast

uv

uv add pychromecast

poetry

poetry add pychromecast

Installing 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

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

chromecast control pythoncast device discoverygoogle chromecast apimedia playback controlchromecast automationcast-enabled device controlnetwork device communication
device-controlhome-automationnetwork-discovery

More Python Modules packages