Skip to content

JohnStrunk/CommonCast

Repository files navigation

CommonCast

CommonCast is a Python library that provides a unified API for discovering and sending images to networked media renderers such as Chromecast, DIAL-capable devices, and DLNA/UPnP renderers.

Features

  • Unified API: Control different types of devices through a single interface.
  • Automatic Discovery: Find devices on your local network using mDNS and other protocols.
  • Local Content Support: Embedded HTTP server to serve local files and raw bytes to remote devices.
  • Event-Driven: Subscribe to device discovery and state changes.
  • Extensible: Easily add support for new protocols by implementing custom backends.

Documentation

Quick Start

import asyncio
import commoncast

async def main():
    await commoncast.start()
    await asyncio.sleep(5)

    devices = commoncast.list_devices()
    if devices:
        # Send a URL to the first found device
        payload = commoncast.types.MediaPayload.from_url("https://example.com/video.mp4")
        await devices[0].send_media(payload)

    await commoncast.stop()

asyncio.run(main())

Development

Release procedure

  • Update the version in pyproject.toml

    # Bump the version string
    uv version --bump {major|minor|patch|alpha|beta|stable}
    # or specify the version directly
    uv version X.Y.Z
  • Commit changes to main

  • Tag the repo with the new version: vX.Y.Z


License: LGPL-3.0-only

About

A Python library that presents a common API for sending images to network devices (e.g., Chromecast, DIAL, DLNA).

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages