soco-cli


Namesoco-cli JSON
Version 0.4.75 PyPI version JSON
download
home_page
SummarySonos command line control utility, based on SoCo
upload_time2024-01-03 09:25:15
maintainer
docs_urlNone
author
requires_python>=3.5
license
keywords
VCS
bugtrack_url
requirements soco soco ifaddr ifaddr tabulate rangehttpserver xmltodict fastapi uvicorn
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# SoCo-CLI: Control Sonos from the Command Line

## Overview

SoCo-CLI is a powerful command line wrapper for the popular Python SoCo library [1], for controlling Sonos systems. SoCo-CLI is written entirely in Python and is portable across platforms.

A simple `sonos` command provides easy control over a huge range of speaker functions, including playback, volume, groups, EQ settings, sleep timers, alarms, speaker settings, the playback queue, etc. Multiple commands can be run in sequence, including the ability to insert delays between commands, to wait for speakers to stop or start playing, and to create repeated action sequences using loops. Audio files from the local filesystem can be played directly on Sonos.

SoCo-CLI has an orderly command structure and consistent return values, making it suitable for use in automated scripts, `cron` jobs, etc.

For interactive command line use, SoCo-CLI provides a powerful **Interactive Shell Mode** that improves speed of operation and reduces typing.

SoCo-CLI can be imported as a streamlined, high-level **API** library by other Python programs, and acts as an intermediate abstraction layer between the client program and the underlying SoCo library, simplifying the use of SoCo.

SoCo-CLI can also run as a simple **HTTP API server**, providing access to a huge range of actions via simple HTTP requests. (Requires Python 3.6 or above.)

## Supported Environments

- Requires Python 3.5+. (The HTTP API Server functionality requires Python 3.6 or above.)
- Runs on all platforms supported by Python. Tested on various versions of Linux, macOS and Windows.
- Works with Sonos 'S1' and 'S2' systems, as well as split S1/S2 systems.

## Installation

Install from PyPI using **`pip install soco-cli`**.

## User Guide

The installer adds the `sonos` command to the PATH. All commands have the form:

```
sonos SPEAKER ACTION <parameters>
```

- `SPEAKER` identifies the speaker, and can be the speaker's Sonos Room name or its IPv4 address in dotted decimal format. Note that the speaker name is case sensitive (unless using alternative discovery, discussed in the full documentation).
- `ACTION` is the operation to perform on the speaker. It can take zero or more parameters depending on the operation.

Actions that make changes to speakers do not generally provide return values. Instead, the program exit code can be inspected to test for successful operation (exit code 0). If an error is encountered, an error message will be printed to `stderr`, and the program will return a non-zero exit code.

### Simple Usage Examples:

- **`sonos "Living Room" volume`** Returns the current volume setting of the *Living Room* speaker.
- **`sonos Study volume 25`** Sets the volume of the *Study* speaker to 25.
- **`sonos Study group Kitchen`** Groups the *Study* speaker with the *Kitchen* speaker.
- **`sonos 192.168.0.10 mute`** Returns the mute state ('on' or 'off') of the speaker at the given IP address.
- **`sonos 192.168.0.10 mute on`** Mutes the speaker at the given IP address.
- **`sonos Kitchen play_favourite Jazz24 : wait 30m : Kitchen stop`** Plays 'Jazz24' for 30 minutes, then stops playback.

Please see [https://github.com/avantrec/soco-cli](https://github.com/avantrec/soco-cli) for full documentation.

## Links

[1] https://github.com/SoCo/SoCo

## Acknowledgments

All trademarks acknowledged. Avantrec Ltd has no connection with Sonos Inc.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "soco-cli",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Avantrec Ltd <soco_cli@avantrec.com>",
    "download_url": "https://files.pythonhosted.org/packages/6e/5b/a9cb26004e5e6802291543a3e5fc586b4d847396b28b5a476e05e3085646/soco-cli-0.4.75.tar.gz",
    "platform": null,
    "description": "\n# SoCo-CLI: Control Sonos from the Command Line\n\n## Overview\n\nSoCo-CLI is a powerful command line wrapper for the popular Python SoCo library [1], for controlling Sonos systems. SoCo-CLI is written entirely in Python and is portable across platforms.\n\nA simple `sonos` command provides easy control over a huge range of speaker functions, including playback, volume, groups, EQ settings, sleep timers, alarms, speaker settings, the playback queue, etc. Multiple commands can be run in sequence, including the ability to insert delays between commands, to wait for speakers to stop or start playing, and to create repeated action sequences using loops. Audio files from the local filesystem can be played directly on Sonos.\n\nSoCo-CLI has an orderly command structure and consistent return values, making it suitable for use in automated scripts, `cron` jobs, etc.\n\nFor interactive command line use, SoCo-CLI provides a powerful **Interactive Shell Mode** that improves speed of operation and reduces typing.\n\nSoCo-CLI can be imported as a streamlined, high-level **API** library by other Python programs, and acts as an intermediate abstraction layer between the client program and the underlying SoCo library, simplifying the use of SoCo.\n\nSoCo-CLI can also run as a simple **HTTP API server**, providing access to a huge range of actions via simple HTTP requests. (Requires Python 3.6 or above.)\n\n## Supported Environments\n\n- Requires Python 3.5+. (The HTTP API Server functionality requires Python 3.6 or above.)\n- Runs on all platforms supported by Python. Tested on various versions of Linux, macOS and Windows.\n- Works with Sonos 'S1' and 'S2' systems, as well as split S1/S2 systems.\n\n## Installation\n\nInstall from PyPI using **`pip install soco-cli`**.\n\n## User Guide\n\nThe installer adds the `sonos` command to the PATH. All commands have the form:\n\n```\nsonos SPEAKER ACTION <parameters>\n```\n\n- `SPEAKER` identifies the speaker, and can be the speaker's Sonos Room name or its IPv4 address in dotted decimal format. Note that the speaker name is case sensitive (unless using alternative discovery, discussed in the full documentation).\n- `ACTION` is the operation to perform on the speaker. It can take zero or more parameters depending on the operation.\n\nActions that make changes to speakers do not generally provide return values. Instead, the program exit code can be inspected to test for successful operation (exit code 0). If an error is encountered, an error message will be printed to `stderr`, and the program will return a non-zero exit code.\n\n### Simple Usage Examples:\n\n- **`sonos \"Living Room\" volume`** Returns the current volume setting of the *Living Room* speaker.\n- **`sonos Study volume 25`** Sets the volume of the *Study* speaker to 25.\n- **`sonos Study group Kitchen`** Groups the *Study* speaker with the *Kitchen* speaker.\n- **`sonos 192.168.0.10 mute`** Returns the mute state ('on' or 'off') of the speaker at the given IP address.\n- **`sonos 192.168.0.10 mute on`** Mutes the speaker at the given IP address.\n- **`sonos Kitchen play_favourite Jazz24 : wait 30m : Kitchen stop`** Plays 'Jazz24' for 30 minutes, then stops playback.\n\nPlease see [https://github.com/avantrec/soco-cli](https://github.com/avantrec/soco-cli) for full documentation.\n\n## Links\n\n[1] https://github.com/SoCo/SoCo\n\n## Acknowledgments\n\nAll trademarks acknowledged. Avantrec Ltd has no connection with Sonos Inc.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Sonos command line control utility, based on SoCo",
    "version": "0.4.75",
    "project_urls": {
        "Homepage": "https://github.com/avantrec/soco-cli"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "314c45108978868e22b7082c7c55ae7dcd7f3581738d557dd7cee982caa53750",
                "md5": "88feef4b996641c90e853bfd98f5d74a",
                "sha256": "b456255053f5b401802dc20cf50dd6bd34e87076558168a05aaa315fe70c490e"
            },
            "downloads": -1,
            "filename": "soco_cli-0.4.75-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "88feef4b996641c90e853bfd98f5d74a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 75958,
            "upload_time": "2024-01-03T09:25:13",
            "upload_time_iso_8601": "2024-01-03T09:25:13.007065Z",
            "url": "https://files.pythonhosted.org/packages/31/4c/45108978868e22b7082c7c55ae7dcd7f3581738d557dd7cee982caa53750/soco_cli-0.4.75-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6e5ba9cb26004e5e6802291543a3e5fc586b4d847396b28b5a476e05e3085646",
                "md5": "7b01653040b478bbffaf33ef2f6eebb6",
                "sha256": "6e6a6bf67a4111a739949691b4ac0b5fce299fb1b825ce641bca8665dabe442d"
            },
            "downloads": -1,
            "filename": "soco-cli-0.4.75.tar.gz",
            "has_sig": false,
            "md5_digest": "7b01653040b478bbffaf33ef2f6eebb6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 97671,
            "upload_time": "2024-01-03T09:25:15",
            "upload_time_iso_8601": "2024-01-03T09:25:15.907805Z",
            "url": "https://files.pythonhosted.org/packages/6e/5b/a9cb26004e5e6802291543a3e5fc586b4d847396b28b5a476e05e3085646/soco-cli-0.4.75.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-03 09:25:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "avantrec",
    "github_project": "soco-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "soco",
            "specs": [
                [
                    "==",
                    "0.27.1"
                ]
            ]
        },
        {
            "name": "soco",
            "specs": [
                [
                    ">=",
                    "0.29.0"
                ]
            ]
        },
        {
            "name": "ifaddr",
            "specs": [
                [
                    "==",
                    "0.1.7"
                ]
            ]
        },
        {
            "name": "ifaddr",
            "specs": [
                [
                    ">=",
                    "0.2.0"
                ]
            ]
        },
        {
            "name": "tabulate",
            "specs": []
        },
        {
            "name": "rangehttpserver",
            "specs": []
        },
        {
            "name": "xmltodict",
            "specs": []
        },
        {
            "name": "fastapi",
            "specs": []
        },
        {
            "name": "uvicorn",
            "specs": []
        }
    ],
    "lcname": "soco-cli"
}
        
Elapsed time: 0.15712s