-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnbs_api.py
73 lines (48 loc) · 1.58 KB
/
nbs_api.py
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from lib.factory import ResourceFactory
class API:
def __init__(self, key, secret="", ext=".json"):
self.factory = ResourceFactory(key, secret, ext)
def setKey(self, key):
self.factory.setKey(key)
def getKey(self):
return self.factory.getKey( )
def setSecret(self, secret):
self.factory.setSecret( )
def getSecret(self):
return self.factory.getSecret( )
def setExt(self, ext):
self.factory.setExt(ext)
def getExt(self):
return self.factory.getExt( )
def artist(self):
return self.factory.getArtists( )
def artistView(self,id):
return self.artist().view(id)
def artistSearch(self,name):
return self.artist( ).search(name)
def artistRanking(self,type,ids):
return self.artist().rank(type,ids)
def artistAdd(self,name, profiles):
return self.artist().add(name, profiles)
def genres(self):
return self.factory.getGenres()
def genresArtist(self,id):
return self.genres().artist(id)
def metrics(self):
return self.factory.getMetrics()
def metricsProfile(self, id, opt=[]):
return self.metrics().profile(id, opt)
def metricsArtist(self, id, opt=[]):
return self.metrics().artist(id, opt)
def profiles(self):
return self.factory.getProfiles()
def profilesArtist(self, id):
return self.profiles().artist(id)
def profilesSearch(self, url):
return self.profiles().search(url)
def profilesAdd(self, id, profiles):
return self.profiles().add(id, profiles)
def services(self):
return self.factory.getServices()
def servicesList(self):
return self.services().list()