blackboard-cli 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
bb/__init__.py ADDED
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
File without changes
bb/adapters/base.py ADDED
@@ -0,0 +1,56 @@
1
+ from __future__ import annotations
2
+
3
+ from abc import ABC, abstractmethod
4
+ from dataclasses import dataclass
5
+ from datetime import datetime
6
+
7
+
8
+ @dataclass
9
+ class Deadline:
10
+ id: str
11
+ course: str
12
+ title: str
13
+ due_at: datetime
14
+ source: str # 'ical' | 'stream'
15
+
16
+
17
+ @dataclass
18
+ class Announcement:
19
+ id: str
20
+ course: str
21
+ title: str
22
+ body: str
23
+ posted_at: datetime
24
+ read_at: datetime | None
25
+
26
+
27
+ @dataclass
28
+ class GradeItem:
29
+ id: str
30
+ course: str
31
+ item: str
32
+ score: float | None
33
+ out_of: float | None
34
+ status: str
35
+
36
+
37
+ class LMSAdapter(ABC):
38
+ @abstractmethod
39
+ def authenticate(self) -> None: ...
40
+
41
+ @abstractmethod
42
+ def check_session(self) -> str: ...
43
+
44
+ # Returns: 'fresh' | 'uncertain' | 'expired'
45
+
46
+ @abstractmethod
47
+ def fetch_activity_stream(self) -> list[Deadline | Announcement | GradeItem]: ...
48
+
49
+ @abstractmethod
50
+ def fetch_grades(self) -> list[GradeItem]: ...
51
+
52
+ @abstractmethod
53
+ def fetch_course_list(self) -> list[dict]: ...
54
+
55
+ @abstractmethod
56
+ def fetch_course_content(self, course_code: str, course_bb_id: str) -> object: ...