--- id: soco version: "0.31.2" license: MIT License license_treatment: permissive maintenance: active --- # soco — SoCo (Sonos Controller) is a simple library to control Sonos speakers. License: permissive · Maintenance: active · Downloads: 164.2K/mo ## What it is and what it does SoCo provides a Python interface to control Sonos speakers on your local network. It lets you discover speakers, adjust volume and playback, manage queues, group speakers, and retrieve track information—all programmatically rather than through the official app. The library communicates with Sonos devices via UPnP/SOAP protocols and exposes both high-level convenience methods (play, pause, volume) and lower-level access to Sonos services for advanced use cases. The package depends on requests for HTTP communication, xmltodict and lxml for parsing Sonos XML responses, ifaddr for network interface discovery, and appdirs for configuration storage. It supports Python 3.6 and newer, including recent versions through 3.14. The library is actively maintained and has been in development since 2013, with a team of contributors managing the GitHub repository. Use it for: - Automate music playback across multiple Sonos speakers from a Python script or home automation system. - Build a custom web dashboard or mobile app to control Sonos speakers without relying on the official Sonos app. - Integrate Sonos control into a larger home automation workflow (e.g., play music when motion is detected). - Programmatically manage speaker groups and queue content based on time of day or external events. - Query current playback state and track information to log listening history or trigger actions based on what's playing. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. SoCo is a Python library for programmatic control of Sonos speakers over a network, supporting playback, volume, queue management, and speaker grouping. Yes. SoCo is actively maintained, has no known vulnerabilities, installs with low friction, and is released under a permissive MIT license. It is well-suited for anyone needing programmatic control of Sonos speakers. Be aware that some music services (Spotify, Apple Music, Amazon Music, Google Play Music, Napster) have known authentication issues; local library and TuneIn radio are more reliable. If your use case centers on those services, verify the current status of issue #557 before committing. ## Install pip install soco uv add soco poetry add soco ## Installing soco Before you install: Installation is straightforward with low friction; the package is pure Python and pulls in five standard dependencies (requests, xmltodict, ifaddr, appdirs, lxml). Maintenance is active with a recent release and ongoing development. License in practice: MIT License is permissive and imposes no significant restrictions on use, modification, or distribution for commercial or private projects. Quickstart: pip install soco from soco import discover for zone in discover(): print(zone.player_name) zone.volume = 10 Requires a Sonos speaker reachable on the local network; discovery relies on network access to the Sonos device. Verify before relying: - Current status of music service authentication issues (Google Play Music, Apple Music, Amazon Music, Spotify, Napster) and whether v0.26.0+ fixes are stable. - Whether the nascent music service support mentioned in the description is production-ready or still experimental. ## Package facts - License: MIT License (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 164.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sonos speaker control python, sonos api library, control sonos speakers programmatically, sonos zone player automation, sonos music playback control, sonos home automation, sonos queue management, sonos device discovery, home-automation, sonos, upnp [View on SkillFed](https://skillfed.io/packages/soco) · [View on PyPI](https://pypi.org/project/soco/)