From b16c2b0a76a5421bb55793afcaf2acc5c398cb06 Mon Sep 17 00:00:00 2001 From: Paige Gulley Date: Mon, 20 Apr 2026 13:28:03 -0400 Subject: [PATCH] added missing types --- mediacloud/api.py | 3 ++- mediacloud/types.py | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mediacloud/api.py b/mediacloud/api.py index 47fee63..d5ed395 100644 --- a/mediacloud/api.py +++ b/mediacloud/api.py @@ -16,6 +16,7 @@ OffsetPage, PaginationToken, Source, + SourceIntervalAttention, SourceCount, SourceWeekAttention, Story, @@ -197,7 +198,7 @@ def stories_by_source_week(self, query: str, start_date: dt.date, end_date: dt.d def stories_by_source_over_interval(self, query: str, start_date: dt.date, end_date: dt.date, collection_ids: Optional[List[int]] = [], source_ids: Optional[List[int]] = [], - platform: Optional[str] = None, interval: Optional[str] = None) -> List[Dict]: + platform: Optional[str] = None, interval: Optional[str] = None) -> List[SourceIntervalAttention]: params = self._prep_default_params(query, start_date, end_date, collection_ids, source_ids, platform) if interval: params['interval'] = interval diff --git a/mediacloud/types.py b/mediacloud/types.py index d659a99..802d796 100644 --- a/mediacloud/types.py +++ b/mediacloud/types.py @@ -49,6 +49,15 @@ class SourceWeekAttention(TypedDict, total=False): ratio: float +class SourceIntervalAttention(TypedDict, total=False): + media_name: str + interval: str + bucket: str + matching_stories: int + total_stories: int + ratio: float + + class Collection(TypedDict, total=False): id: int name: str