groups
Group interfaces for analytix.
You should never need to create any of these yourself.
Group
dataclass
Bases: _Resource
A group.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kind |
str
|
The kind of resource this is. This will always be "youtube#group". |
required |
etag |
Optional[str]
|
The Etag of this resource. |
required |
id |
str
|
The ID that YouTube uses to uniquely identify the group. |
required |
published_at |
datetime
|
The date and time that the group was created. |
required |
title |
str
|
The group name. |
required |
item_count |
int
|
The number of items in the group. |
required |
item_type |
str
|
The type of resources that the group contains. |
required |
shard |
Shard
|
The shard instance used to fetch this group. |
required |
Source code in analytix/groups/groups.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
data
property
The raw data for this group in JSON format.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The response data. |
fetch_items
Fetch a list of all items within this group.
New in version 5.0
Returns:
Type | Description |
---|---|
GroupItemList
|
An object containing the list of group items and the next page token. |
Raises:
Type | Description |
---|---|
BadRequest
|
Your request was invalid. |
Unauthorised
|
Your access token is invalid. |
Forbidden
|
You tried to access data you're not allowed to access. If your channel is not partnered, this is raised when you try to access monetary data. |
Source code in analytix/groups/groups.py
from_json
classmethod
Create a new Group
instance from JSON data.
Changed in version 5.0
This now takes the shard instance used to fetch the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shard |
Shard
|
The shard instance used to fetch the data. |
required |
data |
Dict[str, Any]
|
The raw JSON data from the API. |
required |
Returns:
Type | Description |
---|---|
Group
|
The newly created instance. |
Source code in analytix/groups/groups.py
GroupItem
dataclass
Bases: _Resource
A group item.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kind |
str
|
The kind of resource this is. This will always be "youtube#groupItem". |
required |
etag |
Optional[str]
|
The Etag of this resource. |
required |
id |
str
|
The ID that YouTube uses to uniquely identify the channel, video, playlist, or asset resource that is included in the group. |
required |
resource |
GroupItemResource
|
The resource object contains information that identifies the item being added to the group. |
required |
Notes
The id
parameter does NOT refer to the actual ID of the channel,
video, playlist, or asset, but instead an ID related to its
inclusion within the group.
To get the actual ID of the resource, use resource.id
.
Source code in analytix/groups/groups.py
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
|
data
property
The raw data for this group in JSON format.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The response data. |
from_json
classmethod
Create a new GroupItem
instance from JSON data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Dict[str, Any]
|
The raw JSON data from the API. |
required |
Returns:
Type | Description |
---|---|
GroupItem
|
The newly created instance. |
Source code in analytix/groups/groups.py
GroupItemList
dataclass
Bases: _Resource
A list of group items.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kind |
str
|
The kind of resource this is. This will always be "youtube#groupListResponse". |
required |
etag |
Optional[str]
|
The Etag of this resource. |
required |
items |
List[GroupItem]
|
A list of items that the group contains. Each item in the list represents a groupItem resource. |
required |
Source code in analytix/groups/groups.py
data
property
The raw data for this group in JSON format.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The response data. |
from_json
classmethod
Create a new GroupItemList
instance from JSON data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Dict[str, Any]
|
The raw JSON data from the API. |
required |
Returns:
Type | Description |
---|---|
GroupItemList
|
The newly created instance. |
Source code in analytix/groups/groups.py
GroupItemResource
dataclass
A group item resource.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kind |
str
|
Identifies the type of resource being added to the group. |
required |
id |
str
|
The channel, video, playlist, or asset ID that YouTube uses to uniquely identify the item that is being added to the group. |
required |
Source code in analytix/groups/groups.py
GroupList
dataclass
Bases: _Resource
A list of groups.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kind |
str
|
The kind of resource this is. This will always be "youtube#groupListResponse". |
required |
etag |
Optional[str]
|
The Etag of this resource. |
required |
items |
List[Group]
|
A list of groups that match the API request parameters. Each item in the list represents a group resource. |
required |
next_page_token |
Optional[str]
|
The token that can be used as the value of the |
required |
Source code in analytix/groups/groups.py
data
property
The raw data for this group in JSON format.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The response data. |
from_json
classmethod
Create a new GroupList
instance from JSON data.
Changed in version 5.0
- This now takes the shard instance used to fetch the data
- This will no longer raise an error if a channel has no groups
Parameters:
Name | Type | Description | Default |
---|---|---|---|
shard |
Shard
|
The shard instance used to fetch the data. |
required |
data |
Dict[str, Any]
|
The raw JSON data from the API. |
required |
Returns:
Type | Description |
---|---|
GroupList
|
The newly created instance. |