How can i use mopidy API to play a json or xml playlist?

Hi everyone, I’m trying to do a radio using echo nest.
Can anyone explain how to use Mopidy API to play a given dynamic echo nest playlist? I will have it stored in json or xml and will be changing based on ban or loved songs. I cannot use web or phone front end for my project. Thank you
p.s. I’m using python

You would need to have something loads the URIs for the tracks from the playlist into the mopidy tracklist. A lot of this also depends on the type of radio you want. Is this just pre-generating a playlist then things are simple, but for a dynamic playlists like the spotify radio things are a bit more complicated.

See https://github.com/mopidy/mopidy/issues/620 for a lot of background on this. And on a side note there is also https://github.com/adamcik/mopidy-echonest which I started with the idea of creating a echonest “collection” out of my local media so I could create radios from it, but sadly I never found the time to make this usable.

Thank you very much, by now I managed to generate one track URI everytime i use next echonest command.
I’m trying to write some pyspotify code to automatically add this track in a playlist and just give the playlist URI to mopidy. I want to understand if mopidy is able too see playlist changes while is playing it, I think it could solve my problem.
For now I just get strange requirements troubles from mopidy-spotify (it’s asking me an old version of pyspotify)

Yes, Mopidy will immediately see updates to the Spotify playlist. Though, Mopidy doesn’t play “that Spotify playlist”, but it adds all tracks from the playlist to its play queue when you start playing the Spotify playlist. Thus, new tracks in the Spotify playlist added after you started playing the playlist will not end up in Mopidy’s play queue.

Thanks Jodal. Then should I manually add them to the tracklist with the TracklistController class? Would it work?
p.s. You should be the creator and the main contributor of mopidy, am I wrong? May I suggest one little improvement to documentation? I am a newbee in python (and object oriented programming) and I’m googling pretty much everything i need. The faster and more efficient way to learn for me (and i think for many people) is through examples. I think you are doing an excellent work and i feel like some examples in API documentation would increase greatly the pool of people that can exploit them. By the way I’m relying on pyspotify and not completely on mopidy just because of the available elementary examples in documentation, I’m pretty sure that mopidy would be enough for my purpose. I hope it’s clear what I mean, english is not my language.

Yes, you can add any Spotify track URI to the tracklist through the TracklistController.

Thanks for the feedback! I can clearly see the need for way more examples in the Mopidy docs and focus in the docs on Mopidy as a platform for development and not just as a music server.

pyspotify is way ahead here because it as a library has been targeted towards developers from the start, while Mopidy started as a music server and grew public APIs bit by bit. The pyspotify 2 rewrite is also much newer and implemented in one go, while Mopidy has grown more organically.

If you do want more Mopidy API examples then looking outside the documentation and to the numerous extensions already on github is a good bet.