-
Notifications
You must be signed in to change notification settings - Fork 0
/
Everhour.py
44 lines (35 loc) · 967 Bytes
/
Everhour.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
import requests
from endpoints.base import EVERHOUR_API_URL
from endpoints.users import Users
from endpoints.tasks import Tasks
from endpoints.team import Team
from endpoints.timers import Timers
from endpoints.projects import Projects
from endpoints.webhooks import Webhooks
class Everhour:
def __init__(self, token):
self.session = requests.Session()
self.session.get(EVERHOUR_API_URL)
self.session.headers.update({
'X-Api-Key': token,
'X-Accept-Version': '1.2',
'Content-Type': 'application/json'
})
@property
def users(self):
return Users(self)
@property
def task(self):
return Tasks(self)
@property
def team(self):
return Team(self)
@property
def timers(self):
return Timers(self)
@property
def projects(self):
return Projects(self)
@property
def webhooks(self):
return Webhooks(self)