forked from kradalby/pyGE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyGE.py
29 lines (23 loc) · 764 Bytes
/
pyGE.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
import requests
class GE:
def __init__(self, party=None, user=None, password=None):
if party is None:
raise TypeError('party is not set')
if user is None:
raise TypeError('user is not set')
if password is None:
raise TypeError('password is not set')
self.BASEURL = 'https://www.geekevents.org'
self.party = party
self.user = user
self.password = password
def get(self, endpoint):
url = '{}/{}/{}/'.format(
self.BASEURL,
self.party,
endpoint
)
resp = requests.get(url, auth=(self.user, self.password))
return resp.json()
def get_crew(self):
return self.get('crew/api/crew-list')