Skip to content

Commit

Permalink
add semester attribute to events
Browse files Browse the repository at this point in the history
  • Loading branch information
Highfire1 committed Dec 4, 2024
1 parent 85b373d commit eee3c8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdk/fetch_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def updateDataFromNotion(writeLocation="data/") -> bool:
LCSCEvent(
event_name=propTextExtractor(p["Title"]),
event_date=create_human_readable_date(start, end),
semester=propTextExtractor(p["Semester"]),
event_start_date=start,
event_end_date=end,
location=propTextExtractor(p["Location"]),
Expand All @@ -171,7 +172,7 @@ def updateDataFromNotion(writeLocation="data/") -> bool:
events=sorted(events, key=lambda e: e.event_start_date or "", reverse=True)
)

with open(f"{writeLocation}/json/events_export.json", "w") as fi:
with open(f"{writeLocation}/json/events_export.json", "w", encoding="utf-8") as fi:
fi.write(container.model_dump_json(indent=4))


Expand Down
1 change: 1 addition & 0 deletions sdk/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class LCSCExecutive(BaseModel):

class LCSCEvent(BaseModel):
event_name: str | None
semester: str | None
event_date: str | None
event_start_date: str | None
event_end_date: str | None
Expand Down

0 comments on commit eee3c8b

Please sign in to comment.