Example #1
0
 def __init__(self) -> None:
     self.name = "Geography-based activity"
     self.dimensions = Dimensions(Required("country"))
     self.filters = Filters(
         ZeroOrOne("continent", "subContinent"),
         ZeroOrOne("video", "group"),
     )
     self.metrics = Metrics(*data.ALL_VIDEO_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #2
0
 def __init__(self) -> None:
     self.name = "Ad performance"
     self.dimensions = Dimensions(Required("adType"), Optional("day"))
     self.filters = Filters(
         ZeroOrOne("video", "group"),
         ZeroOrOne("country", "continent", "subContinent"),
     )
     self.metrics = Metrics("grossRevenue", "adImpressions", "cpm")
     self.sort_options = SortOptions(*self.metrics.values)
Example #3
0
 def __init__(self) -> None:
     self.name = "User activity by subscribed status (US)"
     self.dimensions = Dimensions(Optional("subscribedStatus"),
                                  ZeroOrOne("day", "month"))
     self.filters = Filters(
         ZeroOrOne("video", "group"),
         ZeroOrMore("province", "subscribedStatus"),
     )
     self.metrics = Metrics(*data.LESSER_SUBSCRIPTION_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #4
0
 def __init__(self) -> None:
     self.name = "Basic user activity for playlists"
     self.dimensions = Dimensions()
     self.filters = Filters(
         Required("isCurated==1"),
         ZeroOrOne("country", "province", "continent", "subContinent"),
         ZeroOrOne("playlist", "group"),
         ZeroOrMore("subscribedStatus", "youtubeProduct"),
     )
     self.metrics = Metrics(*data.ALL_PLAYLIST_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #5
0
 def __init__(self) -> None:
     self.name = "User activity by subscribed status"
     self.dimensions = Dimensions(Optional("subscribedStatus"),
                                  ZeroOrOne("day", "month"))
     self.filters = Filters(
         ZeroOrOne("country", "continent", "subContinent"),
         ZeroOrOne("video", "group"),
         Optional("subscribedStatus"),
     )
     self.metrics = Metrics(*data.SUBSCRIPTION_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #6
0
 def __init__(self) -> None:
     self.name = "Viewer demographics"
     self.dimensions = Dimensions(
         OneOrMore("ageGroup", "gender"),
         ZeroOrMore("liveOrOnDemand", "subscribedStatus"),
     )
     self.filters = Filters(
         ZeroOrOne("country", "province", "continent", "subContinent"),
         ZeroOrOne("video", "group"),
         ZeroOrMore("liveOrOnDemand", "subscribedStatus"),
     )
     self.metrics = Metrics("viewerPercentage")
     self.sort_options = SortOptions(*self.metrics.values)
Example #7
0
 def __init__(self) -> None:
     self.name = "Traffic sources (detailed)"
     self.dimensions = Dimensions(Required("insightTrafficSourceDetail"), )
     self.filters = Filters(
         Required("insightTrafficSourceType"),
         ZeroOrOne("country", "province", "continent", "subContinent"),
         ZeroOrOne("video", "group"),
         ZeroOrMore("liveOrOnDemand", "subscribedStatus"),
     )
     self.metrics = Metrics(*data.LOCATION_AND_TRAFFIC_METRICS)
     self.sort_options = SortOptions(
         *data.LOCATION_AND_TRAFFIC_SORT_OPTIONS, descending_only=True)
     self.max_results = 25
Example #8
0
 def __init__(self) -> None:
     self.name = "Traffic sources"
     self.dimensions = Dimensions(
         Required("insightTrafficSourceType"),
         ZeroOrMore("day", "liveOrOnDemand", "subscribedStatus"),
     )
     self.filters = Filters(
         ZeroOrOne("country", "province", "continent", "subContinent"),
         ZeroOrOne("video", "group"),
         ZeroOrMore("liveOrOnDemand", "subscribedStatus"),
     )
     self.metrics = Metrics(*data.LOCATION_AND_TRAFFIC_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #9
0
 def __init__(self) -> None:
     self.name = "Geography-based playback details (view percentage)"
     self.dimensions = Dimensions(
         Required("country"),
         ZeroOrMore("subscribedStatus", "youtubeProduct"),
     )
     self.filters = Filters(
         ZeroOrOne("continent", "subContinent"),
         ZeroOrOne("video", "group"),
         ZeroOrMore("subscribedStatus", "youtubeProduct"),
     )
     self.metrics = Metrics(*data.VIEW_PERCENTAGE_PLAYBACK_DETAIL_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #10
0
 def __init__(self) -> None:
     self.name = "Time-based playback details (live)"
     self.dimensions = Dimensions(
         ZeroOrMore("liveOrOnDemand", "subscribedStatus", "youtubeProduct"),
         ZeroOrOne("day", "month"),
     )
     self.filters = Filters(
         ZeroOrOne("country", "province", "continent", "subContinent"),
         ZeroOrOne("video", "group"),
         ZeroOrMore("liveOrOnDemand", "subscribedStatus", "youtubeProduct"),
     )
     self.metrics = Metrics(*data.LIVE_PLAYBACK_DETAIL_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #11
0
 def __init__(self) -> None:
     self.name = "Engagement and content sharing"
     self.dimensions = Dimensions(
         Required("sharingService"),
         Optional("subscribedStatus"),
     )
     self.filters = Filters(
         ZeroOrOne("country", "continent", "subContinent"),
         ZeroOrOne("video", "group"),
         Optional("subscribedStatus"),
     )
     self.metrics = Metrics("viewerPercentage")
     self.sort_options = SortOptions(*self.metrics.values)
Example #12
0
 def __init__(self) -> None:
     self.name = "Device types and operating systems for playlists"
     self.dimensions = Dimensions(
         Required("deviceType", "operatingSystem"),
         ZeroOrMore("day", "subscribedStatus", "youtubeProduct"),
     )
     self.filters = Filters(
         Required("isCurated==1"),
         ZeroOrOne("country", "province", "continent", "subContinent"),
         ZeroOrOne("playlist", "group"),
         ZeroOrMore("subscribedStatus", "youtubeProduct"),
     )
     self.metrics = Metrics(*data.LOCATION_AND_TRAFFIC_PLAYLIST_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #13
0
 def __init__(self) -> None:
     self.name = "Traffic sources for playlists (detailed)"
     self.dimensions = Dimensions(Required("insightTrafficSourceDetail"), )
     self.filters = Filters(
         Required("isCurated==1", "insightTrafficSourceType"),
         ZeroOrOne("country", "province", "continent", "subContinent"),
         ZeroOrOne("playlist", "group"),
         Optional("subscribedStatus"),
     )
     self.metrics = Metrics(*data.LOCATION_AND_TRAFFIC_PLAYLIST_METRICS)
     self.sort_options = SortOptions(
         *data.LOCATION_AND_TRAFFIC_PLAYLIST_SORT_OPTIONS,
         descending_only=True)
     self.max_results = 25
Example #14
0
 def __init__(self) -> None:
     self.name = "Traffic sources for playlists"
     self.dimensions = Dimensions(
         Required("insightTrafficSourceType"),
         ZeroOrMore("day", "subscribedStatus"),
     )
     self.filters = Filters(
         Required("isCurated==1"),
         ZeroOrOne("country", "province", "continent", "subContinent"),
         ZeroOrOne("playlist", "group"),
         Optional("subscribedStatus"),
     )
     self.metrics = Metrics(*data.LOCATION_AND_TRAFFIC_PLAYLIST_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #15
0
 def __init__(self) -> None:
     self.name = "Viewer demographics for playlists"
     self.dimensions = Dimensions(
         OneOrMore("ageGroup", "gender"),
         Optional("subscribedStatus"),
     )
     self.filters = Filters(
         Required("isCurated==1"),
         ZeroOrOne("country", "province", "continent", "subContinent"),
         ZeroOrOne("playlist", "group"),
         ZeroOrMore("subscribedStatus"),
     )
     self.metrics = Metrics("viewerPercentage")
     self.sort_options = SortOptions(*self.metrics.values)
Example #16
0
 def __init__(self) -> None:
     self.name = "Time-based activity (US)"
     self.dimensions = Dimensions(ExactlyOne("day", "month"))
     self.filters = Filters(
         Required("province"),
         ZeroOrOne("video", "group"),
     )
     self.metrics = Metrics(*data.ALL_PROVINCE_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #17
0
 def __init__(self) -> None:
     self.name = "Top videos by region"
     self.dimensions = Dimensions(Required("video"))
     self.filters = Filters(
         ZeroOrOne("country", "continent", "subContinent"))
     self.metrics = Metrics(*data.ALL_VIDEO_METRICS)
     self.sort_options = SortOptions(*data.TOP_VIDEOS_EXTRA_SORT_OPTIONS,
                                     descending_only=True)
     self.max_results = 200
Example #18
0
 def __init__(self) -> None:
     self.name = "Geography-based activity (US)"
     self.dimensions = Dimensions(Required("province"))
     self.filters = Filters(
         Required("country==US"),
         ZeroOrOne("video", "group"),
     )
     self.metrics = Metrics(*data.ALL_PROVINCE_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #19
0
 def __init__(self) -> None:
     self.name = "Operating systems"
     self.dimensions = Dimensions(
         Required("operatingSystem"),
         ZeroOrMore("day", "liveOrOnDemand", "subscribedStatus",
                    "youtubeProduct"),
     )
     self.filters = Filters(
         ZeroOrOne("country", "province", "continent", "subContinent"),
         ZeroOrOne("video", "group"),
         ZeroOrMore(
             "deviceType",
             "liveOrOnDemand",
             "subscribedStatus",
             "youtubeProduct",
         ),
     )
     self.metrics = Metrics(*data.LOCATION_AND_TRAFFIC_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #20
0
 def __init__(self) -> None:
     self.name = "Top playlists"
     self.dimensions = Dimensions(Required("playlist"))
     self.filters = Filters(
         Required("isCurated==1"),
         ZeroOrOne("country", "province", "continent", "subContinent"),
         ZeroOrMore("playlist", "subscribedStatus", "youtubeProduct"),
     )
     self.metrics = Metrics(*data.ALL_PLAYLIST_METRICS)
     self.sort_options = SortOptions(*data.TOP_VIDEOS_SORT_OPTIONS)
     self.max_results = 200
Example #21
0
 def __init__(self) -> None:
     self.name = "Top videos by subscription status"
     self.dimensions = Dimensions(Required("video"))
     self.filters = Filters(
         Optional("subscribedStatus"),
         ZeroOrOne("country", "continent", "subContinent"),
     )
     self.metrics = Metrics(*data.SUBSCRIPTION_METRICS)
     self.sort_options = SortOptions(*data.TOP_VIDEOS_SORT_OPTIONS,
                                     descending_only=True)
     self.max_results = 200
Example #22
0
 def __init__(self) -> None:
     self.name = "Top videos by playback detail"
     self.dimensions = Dimensions(Required("video"))
     self.filters = Filters(
         ZeroOrOne("country", "province", "continent", "subContinent"),
         ZeroOrMore("liveOrOnDemand", "subscribedStatus", "youtubeProduct"),
     )
     self.metrics = Metrics(*data.VIEW_PERCENTAGE_PLAYBACK_DETAIL_METRICS)
     self.sort_options = SortOptions(*data.TOP_VIDEOS_SORT_OPTIONS,
                                     descending_only=True)
     self.max_results = 200
Example #23
0
 def __init__(self) -> None:
     self.name = "Geography-based playback details (live, US)"
     self.dimensions = Dimensions(
         Required("province"),
         ZeroOrMore("liveOrOnDemand", "subscribedStatus", "youtubeProduct"),
     )
     self.filters = Filters(
         Required("country==US"),
         ZeroOrOne("video", "group"),
         ZeroOrMore("liveOrOnDemand", "subscribedStatus", "youtubeProduct"),
     )
     self.metrics = Metrics(*data.LIVE_PLAYBACK_DETAIL_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #24
0
 def __init__(self) -> None:
     self.name = "Geography-based activity for playlists (US)"
     self.dimensions = Dimensions(
         Required("province"),
         ZeroOrMore("subscribedStatus", "youtubeProduct"),
     )
     self.filters = Filters(
         Required("isCurated==1", "country==US"),
         ZeroOrOne("playlist", "group"),
         ZeroOrMore("subscribedStatus", "youtubeProduct"),
     )
     self.metrics = Metrics(*data.ALL_PLAYLIST_METRICS)
     self.sort_options = SortOptions(*self.metrics.values)
Example #25
0
def dimensions_zero_or_one() -> Dimensions:
    return Dimensions(ZeroOrOne("day", "month"))
Example #26
0
def filters_zero_or_one() -> Filters:
    return Filters(ZeroOrOne("country", "video"))