INTERACT FORUM

More => Old Versions => JRiver Media Center 25 for Windows => Topic started by: DrKNo on March 28, 2019, 07:38:36 pm

Title: pyMCWS: A python wrapper for MCWS
Post by: DrKNo 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:
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.
Title: Re: pyMCWS: A python wrapper for MCWS
Post by: biblio on March 28, 2019, 09:51:33 pm
Starred! Can't wait to try it out
Title: Re: pyMCWS: A python wrapper for MCWS
Post by: 8139david 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.
Title: Re: pyMCWS: A python wrapper for MCWS
Post by: Castius on March 28, 2019, 10:56:36 pm
Nice Thanks!
Title: Re: pyMCWS: A python wrapper for MCWS
Post by: DrKNo 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.
Title: Re: pyMCWS: A python wrapper for MCWS
Post by: DrKNo 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 (https://yabb.jriver.com/interact/index.php/topic,123397.0.html)
Title: Re: pyMCWS: A python wrapper for MCWS
Post by: Moe 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.
Title: Re: pyMCWS: A python wrapper for MCWS
Post by: DrKNo 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.