Add GET, POST, PUT and DELETE to "mscore" CLI

• Jul 6, 2016 - 01:20

It would be really helpful to have the capabilities to manage our uploaded scores through the mscore command line interface, specifically being able to place GET, POST, PUT and DELETE requests.

This would be especially helpful in situations were users upload scores in order to access the MuseScore embedding capabilities. By enabling the mscore interface to process GET, POST, PUT, and DELETE requests a user could then build scripts to update the uploaded score when they are altered locally, as well as posting new scores. This becomes almost a necessity when managing large numbers of scores, especially if they are being generated by an external program and converted to mscz files.


Comments

In reply to by Marc Sabatella

I am actually in the middle of trying to build some scripts to allow me to use the developers API. However, the API is still semi private, lacking in detailed documentation, and requires additional credentials outside of the standard username/password. While I will likely end up using the API calls, I would not assume the average MuseScore user could write a program to tap into that functionality (though many very well be able to). By having GET, POST, PUT, and DELETE functionality added to mscore (which comes with the standard MuseScore installation) more people could use this functionality. Further, it would insulate users from changes to the API as presumable MuseScore's CLI would be updated to reflect any API changes.

The type of workflow I am envisioning is an interaction similar to the following:

I type
mscore --login
into my terminal at which point mscore requests my login credentials. I then post a score I just finished called myFile by entering the following (where --id would be optional, just like during upload via the browser)
mscore --post --id=myFile myFile.mscz
at this point the score myFile is now available online at
http://musescore.com/user/myUserID/scores/myFile
At some later point I have edited myFile and would like to update the version held by MuseScore. I would then again login to mscore and proceed to update the file by running
mscore --put --id=myFile myFile.mscz

Now, imagine if you have edited a hundred scores through some batch editor. I for one would dread having to open up my browser and one-by-one update each score.

In reply to by Jahrme

mscore is the full MuseScore UI, score engine, etc... I'm not sure it's a good idea to augment it with a dedicated command line for score management on MuseScore.com. However, it would indeed be great to have a command line tool to manage your scores.

I started a python wrapper for the MuseScore.com API some time ago. https://github.com/musescore-com/python-api-wrapper
It does not have a clean interface as you specified above but you can do something like

Equivalent to your mscore --login
python connect.py

Equivalent to your mscore --post --id=myFile myFile.mscz

api = MuseScoreAPI("credentials.json")
files = {'score_data': ('test.mscz', open('test.mscz', 'rb'), 'application/octet-stream'),
"title": ('',' test'),
"description": ('', 'description'),
"private" : ('', '1')
}
r = api.request('score', method="POST", files=files)

I would be happy to help you to make a cleaner CLI. We can use this forum post or you can ping me on IRC #musescore on freenode.net

Do you still have an unanswered question? Please log in first to post your question.