aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA Farzat <a@farzat.xyz>2025-08-19 19:48:03 +0300
committerA Farzat <a@farzat.xyz>2025-08-19 19:48:03 +0300
commit4b14119c651e3a7ce9425d015ccde26765b93e91 (patch)
tree51d8dca8a1212f9692dc5100f5b86278a7d65298
parent9af9e9031a460fe6e26f61cbae84c23c88606bcc (diff)
downloadcsca5028-4b14119c651e3a7ce9425d015ccde26765b93e91.tar.gz
csca5028-4b14119c651e3a7ce9425d015ccde26765b93e91.zip
Create a TypedDict for users
-rw-r--r--data-collection/components/users/typing.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/data-collection/components/users/typing.py b/data-collection/components/users/typing.py
new file mode 100644
index 0000000..f03eecb
--- /dev/null
+++ b/data-collection/components/users/typing.py
@@ -0,0 +1,13 @@
+from datetime import datetime
+from typing import TypedDict, NamedTuple, List, Tuple
+from bson.objectid import ObjectId
+
+class SubscriptionItem(NamedTuple):
+ id: str
+ time_between_fetches: int
+ last_viewed: datetime
+
+class UserDict(TypedDict):
+ id: ObjectId
+ name: str
+ subscriptions: List[SubscriptionItem]