INTERACT FORUM

Please login or register.

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

Author Topic: Ist there interest in a general python API for MCWS?  (Read 1390 times)

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Ist there interest in a general python API for MCWS?
« on: March 01, 2019, 05:57:56 am »

I am currently working on a project in python (A physical jukebox using JRiver) for which I'm writing a python wrapper for the MCWS API. The current efforts I saw were dead, so I wondered whether the community is interested in such a wrapper. In that case, I could simply extract it and put it on github. If that's not really the case, I'd rather leave it as an artifact in the jukebox project which will become open source at some point too.

Currently it handles:
- Getting of client information via access keys from jriver services
- play commands
- getting and playing songs using the query mechanisms
- optionally using playdoctor
All with a focus on the media network

I plan to add:
- automatic resolution of remote vs local connection strategies (In home WiFi network vs on an Internet connection
- Structured querying of metadata for batch/bulk operations on media files

That's obviously only a fraction of the MCWS functionality, so if a few motivated users join that would be excellent. So I'll use this thread to gauge interest and see where to go from there.
Logged

biblio

  • Junior Woodchuck
  • **
  • Posts: 83
Re: Ist there interest in a general python API for MCWS?
« Reply #1 on: March 06, 2019, 05:32:57 pm »

YES!!!!!!!!!!!!!!!!!!!!!!

I would always use python over any other language.
Logged

biblio

  • Junior Woodchuck
  • **
  • Posts: 83
Re: Ist there interest in a general python API for MCWS?
« Reply #2 on: March 06, 2019, 05:35:01 pm »

I plan to add:
- Structured querying of metadata for batch/bulk operations on media files

If you put it on github this is probably where i would be able to help.
I currently manage my other players/metadata through python/mysql.
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4276
Re: Ist there interest in a general python API for MCWS?
« Reply #3 on: March 07, 2019, 02:26:48 am »

Does it provide a cleaner interface on top of MCWS or just pass parameters through?

I wrote a bit of a js one at one point - https://github.com/3ll3d00d/ezmote/blob/master/src/services/jriver/index.js - but only implemented as much as I  needed for that particular app.

a python wrapper would be useful though
Logged

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: Ist there interest in a general python API for MCWS?
« Reply #4 on: March 07, 2019, 05:55:28 am »

If you put it on github this is probably where i would be able to help.

Excellent. I'll do just that. Give me a week or so to clean the code and document the general use-cases and I'll let you know when it's online here.

Does it provide a cleaner interface on top of MCWS or just pass parameters through?

I suppose that's up to debate? I actually find the MCWS API pretty usable and well-documented. My ideal vision would be to have two components:
1) a straight 1:1 python wrapper of the MCWS API that also manages authentication and address resoution via access keys. This would basically "pass parameters trough" with some sugar on top like sanity checks etc...
2) Additional classes that cover common use-cases like playback, filtering, updating etc that use the backend to provide the API in a more object-oriented and developer friendly manner.

I'm pretty open to suggestions though. Nothing set in stone.
Logged

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: Ist there interest in a general python API for MCWS?
« Reply #5 on: March 07, 2019, 02:58:22 pm »

I wrote a bit of a js one at one point

Thanks for linking the code, I'll have to try and compile the app sometime. JRAVER is an awesome name, I love it  ;D
Looking through the code, the required functionality seems comparable to what I currently need minus the visualisation stuff. Do you still use the app?
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4276
Re: Ist there interest in a general python API for MCWS?
« Reply #6 on: March 07, 2019, 03:37:32 pm »

Looking through the code, the required functionality seems comparable to what I currently need minus the visualisation stuff. Do you still use the app?
yes I do still use it, it's the main remote control we use here for quick navigation. I still use the main MC view as well though.

I haven't really touched it since writing it though and there are some things I keep meaning to improve (mainly around how the quick search works and whether you can switch into navigation mode easily). I have been put off by the need to pick up a year or so's worth of js dependency upgrades (which I'm quite sure will mean literally everything breaks!).
Logged

Castius

  • Citizen of the Universe
  • *****
  • Posts: 562
Re: Ist there interest in a general python API for MCWS?
« Reply #7 on: March 08, 2019, 12:54:11 am »

Thanks for sharing!
I will certainly be looking forward to using it.
Logged

DrKNo

  • World Citizen
  • ***
  • Posts: 201
Re: Ist there interest in a general python API for MCWS?
« Reply #8 on: March 28, 2019, 07:42:16 pm »

Took me longer than expected (I suddenly became a father a little earlier than expected - all is well!), but here's the link to the release thread:

https://yabb.jriver.com/interact/index.php/topic,120101.0.html

 
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72548
  • Where did I put my teeth?
Re: Ist there interest in a general python API for MCWS?
« Reply #9 on: March 28, 2019, 08:42:35 pm »

Congratulations!
Logged
Pages: [1]   Go Up