resources
Report resources.
These mirror YouTube Analytics API resources, but lack quality-of-life features that the analytix interfaces provide.
ColumnHeader
dataclass
A column header.
Column headers contain various information about the columns in the report. You will never need to create one of these yourself.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The column name. |
required |
data_type |
DataType
|
The data type of the column. |
required |
column_type |
ColumnType
|
The column type. |
required |
Source code in analytix/reports/resources.py
ColumnType
Bases: Enum
An enum of column types. Can be DIMENSION
or METRIC
.
Source code in analytix/reports/resources.py
DataType
Bases: Enum
An enum of data types. Can be STRING
, INTEGER
, or FLOAT
.
Source code in analytix/reports/resources.py
ResultTable
dataclass
A result table.
This is the resource type that gets sent from the YouTube Analytics API.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
kind |
Literal['youtubeAnalytics#resultTable']
|
The kind of resource this is. This will always be "youtubeAnalytics#resultTable". |
required |
column_headers |
List[ColumnHeader]
|
Information about the columns in the report, such as the name and the column type. |
required |
rows |
List[List[Union[str, int, float]]]
|
The rows in the report. This will be a list of lists. |
required |
See Also
Instances of this class are presented as part of Report
instances.
Source code in analytix/reports/resources.py
data
property
The raw data for this result table in JSON format.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
The response data. |
from_json
classmethod
Create a new ResultTable
instance from JSON data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
Dict[str, Any]
|
The raw JSON data from the API. |
required |
Returns:
Type | Description |
---|---|
ResultTable
|
The newly created instance. |