Data Columns
albert.collections.data_columns
AlbertHTTPError
Bases: AlbertException
Base class for all erors due to HTTP responses.
Source code in src/albert/exceptions.py
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
DataColumn
Bases: BaseResource
metadata
class-attribute
instance-attribute
DataColumnCollection
DataColumnCollection(*, session: AlbertSession)
Bases: BaseCollection
DataColumnCollection is a collection class for managing DataColumn entities in the Albert platform.
Methods:
Name | Description |
---|---|
create |
Create a new data column entity. |
delete |
Delete a data column entity. |
get_by_id |
Get a data column by its ID. |
get_by_name |
Get a data column by its name. |
list |
Lists data column entities with optional filters. |
update |
Update a data column entity. |
Source code in src/albert/collections/data_columns.py
create
create(*, data_column: DataColumn) -> DataColumn
Create a new data column entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_column
|
DataColumn
|
The data column object to create. |
required |
Returns:
Type | Description |
---|---|
DataColumn
|
The created data column object. |
Source code in src/albert/collections/data_columns.py
delete
delete(*, id: str) -> None
Delete a data column entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the data column object to delete. |
required |
Returns:
Type | Description |
---|---|
None
|
|
Source code in src/albert/collections/data_columns.py
get_by_id
get_by_id(*, id) -> DataColumn
Get a data column by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
The ID of the data column to get. |
required |
Returns:
Type | Description |
---|---|
DataColumn | None
|
The data column object on match or None |
Source code in src/albert/collections/data_columns.py
get_by_name
get_by_name(*, name) -> DataColumn | None
Get a data column by its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the data column to get. |
required |
Returns:
Type | Description |
---|---|
DataColumn | None
|
The data column object on match or None |
Source code in src/albert/collections/data_columns.py
list
list(
*,
order_by: OrderBy = DESCENDING,
ids: str | list[str] | None = None,
name: str | list[str] | None = None,
exact_match: bool | None = None,
default: bool | None = None,
start_key: str | None = None,
limit: int = 100,
return_full: bool = True,
) -> Iterator[DataColumn]
Lists data column entities with optional filters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_by
|
OrderBy
|
The order by which to sort the results, by default OrderBy.DESCENDING. |
DESCENDING
|
ids
|
str | list[str] | None
|
Data column IDs to filter the search by, default None. |
None
|
name
|
Union[str, None]
|
The name of the tag to filter by, by default None. |
None
|
exact_match
|
bool
|
Whether to match the name exactly, by default True. |
None
|
default
|
bool
|
Whether to return only default columns, by default None. |
None
|
return_full
|
bool
|
Whether to make additional API call to fetch the full object, by default True |
True
|
Returns:
Type | Description |
---|---|
Iterator[DataColumn]
|
An iterator of DataColumns matching the provided criteria. |
Source code in src/albert/collections/data_columns.py
update
update(*, data_column: DataColumn) -> DataColumn
Update a data column entity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_column
|
DataColumn
|
The updated data column object. The ID must be set and match an existing data column. |
required |
Returns:
Type | Description |
---|---|
DataColumn
|
The updated data column object as registered in Albert. |