INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: pyMCWS: A python wrapper for MCWS  (Read 1698 times)

DrKNo

  • World Citizen
  • ***
  • Posts: 201
pyMCWS: A python wrapper for MCWS
« on: March 28, 2019, 07:38:36 pm »

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.
Logged

biblio

  • Junior Woodchuck
  • **
  • Posts: 83
Re: pyMCWS: A python wrapper for MCWS
« Reply #1 on: March 28, 2019, 09:51:33 pm »

Starred! Can't wait to try it out
Logged

8139david

  • Galactic Citizen
  • ****
  • Posts: 345
Re: pyMCWS: A python wrapper for MCWS
« Reply #2 on: March 28, 2019, 10:34:16 pm »

Thanks.

Have you ever heard about MCUtils? https://yabb.jriver.com/interact/index.php?topic=100449.0
It's a similar project, developped in perl, with tons of very useful functionality added year after year.
The project is ongoing and completely alive: see the attached instructions.
Logged

Castius

  • Citizen of the Universe
  • *****
  • Posts: 562
Re: pyMCWS: A python wrapper for MCWS
« Reply #3 on: March 28, 2019, 10:56:36 pm »

Nice Thanks!
Logged

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: pyMCWS: A python wrapper for MCWS
« Reply #4 on: March 29, 2019, 04:13:53 am »

Have you ever heard about MCUtils?

I have not, in fact. Thanks a lot for pointing me to the project! After a cursory glance I am sure that there are lot of concepts and reference points that will be useful to me.
Logged

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: pyMCWS: A python wrapper for MCWS
« Reply #5 on: December 19, 2019, 03:10:17 am »

I decided to continue maintaining pymcws. The official thread is now in the third party forum, where it will be kept up to date:
https://yabb.jriver.com/interact/index.php/topic,123397.0.html
Logged

Moe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 718
  • Hi
Re: pyMCWS: A python wrapper for MCWS
« Reply #6 on: December 19, 2019, 11:22:03 am »

I am super excited to see this.  I am going to a coding bootcamp in March that focuses on Python, I have a feeling this is going to come in very handy.
Logged

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: pyMCWS: A python wrapper for MCWS
« Reply #7 on: December 19, 2019, 04:00:28 pm »

Awesome! Let me know your thoughts and please be bold and contribute code :) It is early enough to change the API if we feel there are better ways of doing things after all.
Logged
Pages: [1]   Go Up