Reports
albert.collections.reports
AlbertSession
AlbertSession(
*,
base_url: str,
token: str | None = None,
client_credentials: ClientCredentials | None = None,
retries: int | None = None,
)
Bases: Session
A session that has a base URL, which is prefixed to all request URLs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base_url
|
str
|
The base URL to prefix to all requests. (e.g., "https://sandbox.albertinvent.com") |
required |
retries
|
int
|
The number of retries for failed requests. Defaults to 3. |
None
|
client_credentials
|
ClientCredentials | None
|
The client credentials for programmatic authentication. Optional if token is provided. |
None
|
token
|
str | None
|
The JWT token for authentication. Optional if client credentials are provided. |
None
|
Methods:
Name | Description |
---|---|
request |
|
Source code in src/albert/session.py
request
Source code in src/albert/session.py
BaseCollection
BaseCollection(*, session: AlbertSession)
BaseCollection is the base class for all collection classes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert API Session instance. |
required |
Source code in src/albert/collections/base.py
ReportCollection
ReportCollection(*, session: AlbertSession)
Bases: BaseCollection
ReportCollection is a collection class for managing Report entities in the Albert platform.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
AlbertSession
|
The Albert session instance. |
required |
Methods:
Name | Description |
---|---|
get_datascience_report |
Get a datascience report by its report type ID. |
Source code in src/albert/collections/reports.py
get_datascience_report
get_datascience_report(
*,
report_type_id: str,
input_data: dict[str, Any] | None = None,
) -> ReportInfo
Get a datascience report by its report type ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
report_type_id
|
str
|
The report type ID for the report. |
required |
input_data
|
dict[str, Any] | None
|
Additional input data for generating the report (e.g., project IDs and unique IDs). |
None
|
Returns:
Type | Description |
---|---|
ReportInfo
|
The info for the report. |
Examples:
>>> report = client.reports.get_datascience_report(
... report_type_id="RET51",
... input_data={
... "projectId": ["PRO123"],
... "uniqueId": ["DAT123_DAC123"]
... }
... )
Source code in src/albert/collections/reports.py
ReportInfo
Bases: BaseResource
report_type_id
class-attribute
instance-attribute
report_type_id: str = Field(..., alias='reportTypeId')