Report Templates
albert.collections.report_templates.ReportTemplateCollection
Bases: BaseCollection
Manage Report Templates in the Albert platform.
A Report Template defines a reusable report configuration: the report type it
is based on, its available filters, and its default column, chart, and
metadata state. Templates are the catalog of report types that can be run via
ReportCollection. Each template belongs
to a ReportTemplateCategory
(analytics, datascience, or reports).
This collection is read-only: it retrieves and lists existing templates.
This collection is accessed as client.report_templates.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The authenticated Albert session used for API calls. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
base_path |
str
|
The base API route for report template requests. |
Methods:
| Name | Description |
|---|---|
get_by_id |
Get a single report template by its ID. |
get_all |
List all report templates, optionally filtered by category. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
AlbertSession
|
The authenticated Albert session used for API calls. |
required |
Source code in src/albert/collections/report_templates.py
get_by_id
get_by_id(*, id: str) -> ReportTemplate
Get a single report template by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
The ID of the report template to retrieve. |
required |
Returns:
| Type | Description |
|---|---|
ReportTemplate
|
The fully populated report template. |
Source code in src/albert/collections/report_templates.py
get_all
get_all(
*, category: ReportTemplateCategory | None = None
) -> list[ReportTemplate]
List all report templates, optionally filtered by category.
Example
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
category
|
ReportTemplateCategory | None
|
Restrict the results to a single template category. If omitted, all categories are returned. |
None
|
Returns:
| Type | Description |
|---|---|
list[ReportTemplate]
|
The matching report templates. |