-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME
46 lines (30 loc) · 1.34 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
-----------
BMAT - ELLA
-----------
== Intro ==
ELLA API is based on REST (REpresentational State Transfer), where users, artists, tracks, tags, concerts, venues, etc. are abstracted into resources. Each resource is identified using a unique URI (Uniform Resource Identifiers), and they all share a uniform interface to define and modify its state, using HTTP GET, POST and PUT.
== Authentication ==
Authentication is via user/passwd HTTP params: http://user:passwd@server
Example:
http://musichackday:mhdbcn2010_@ella.bmat.ws/collections/bmat/tracks/search?q=white+stripes+my+fault+being+famous
== API Documentation ==
https://musichackday:mhdbcn2010_@secure.bmat.com/ella-doc/musichackday/
== EXAMPLES ==
import pyella
# 1) search one by u2
results = pyella.search_tracks('u2 one')
for track in results.get_next_page():
print track.get_mbid(), track.get_title(), track.get_artist_name()
# 2) search for blues, slow sad songs
COLLECTION = 'bmat'
filter = []
filter.append('mood:blue')
filter.append('speed:slow')
filter.append('track_genre:Blues')
searcher = pyella.search_tracks(None, COLLECTION, filter=filter)
print searcher.get_total_result_count()
for track in searcher.get_page(0):
print track.get_mbid(), track
# 3) get similar tracks by u2 one
track = pyella.search_tracks('u2 one').get_page(0)[0]
print track, track.get_similar()