-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTracked.py
67 lines (50 loc) · 1.5 KB
/
Tracked.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
import requests
from endpoints.projects import Projects
from endpoints.lists import Lists
from endpoints.todos import Todos
from endpoints.labels import Labels
class Tracked:
def __init__(self, email_address: str, api_token: str, basecamp_account_id: int):
self.email_address = email_address
self.api_token = api_token
self.basecamp_account_id = basecamp_account_id
self.session = requests.Session()
@property
def projects(self):
return Projects(self)
@property
def lists(self):
return Lists(self)
@property
def todos(self):
return Todos(self)
@property
def labels(self):
return Labels(self)
"""
========================================================
Examples
========================================================
tracked = Tracked(...)
# === PROJECTS ===
# Get all projects
tracked.projects.list()
# === LISTS ===
# Get all lists for a project
tracked.lists.list(project_id)
# === TODOS ===
# List todos from project
tracked.todos.list(project_id)
# Update Kanban list and/or position for a to-do
tracked.todos.update(project_id, todo_id, position, list_name)
# === LABELS ===
# Create a label
tracked.labels.create(project_id, "TestLabel", "#00ffff")
# List labels
tracked.labels.list(project_id)
# Add a label to a todo
tracked.labels.add(project_id, label_id, todo_id)
# Get labels of a todo
tracked.labels.get(basecamp_project_id, basecamp_todo_id)
========================================================
"""