A while ago I posted here with the intent of gauging interest in a python Wrapper for MCWS. I finally got my code together and uploaded it. May I present: pyMCWS! It is written for python 3 and depends on the requests library only. The aim is to allow fast and easy development while preserving the power of the API. The easiest way to use it is using recipes, simplified versions of the API calls:
pip install pymcws
import pymcws as mcws
from pymcws import MediaServer
office = MediaServer("MyAccessKey", "username", "supersecretpassword")
# Play an album using a play recipe
mcws.play_album(office, "Ludovico Einaudi", "I Giorni")
If you need more power, the original MCWS API is wrapped for python too — looking at the API documentation provided by JRiver should be enough to use pyMCWS it in most instances:
mcws.files_search(office, query='my Query', action='play', use_play_doctor=True, shuffle=False)
Find the code here:
https://github.com/kenomaerz/pymcws — see example.py for usage examples.
The current version on PyPi is listed as 0.0.1, an early proof of concept. What works right now is:
- Resolution of Access Keys, on the local network
- Playback commands (Stop, pause, etc)
- Playing Files via queries
- Retrieving zones from server
- Specifying target zones for commands[\li]
Have fun poking around with it, and let me know if you need a specific functionality, I'll see to implementing it. Help is also wildly appreciated, so feel free to create a pull request. Please also post the inevitable bugs that you encounter. I'm sure there's a lot to improve.