core
core ¶
Core DomoCard classes
DomoCard
dataclass
¶
DomoCard(
auth: DomoAuth,
id: str,
raw: dict,
Lineage: DomoLineage | None = None,
Definition: DomoCard_DefinitionManager | None = None,
Datasets: DomoCard_DatasetsManager | None = None,
Owners: DomoCard_OwnerManager | None = None,
Pages: DomoCard_PageManager | None = None,
Access: DomoCardAccessController | None = None,
BeastModes: DomoCard_BeastModesManager | None = None,
title: str | None = None,
description: str | None = None,
type: str | None = None,
urn: str | None = None,
chart_type: str | None = None,
badge_type: str | None = None,
dataset_id: str | None = None,
datastore_id: str | None = None,
domo_collections: list[Any] = list(),
domo_source_code: Any = None,
certification: dict | None = None,
_init_owners: InitVar[list[Any] | None] = None,
pages: list[Any] = list(),
)
Bases: DomoCard_Default
DomoCard factory class that uses composition for federated support
create
async
classmethod
¶
create(
auth: DomoAuth,
chart_type: str,
dataset_id: str,
title: str,
*,
measure_column: str | None = None,
aggregation: str = "SUM",
measure_formula: dict[str, Any] | None = None,
measure_beastmode: dict[str, Any] | None = None,
dimension_column: str | None = None,
series_column: str | None = None,
filters: list[Any] | None = None,
order_by: list[Any] | None = None,
overrides: dict[str, Any] | None = None,
description: str | None = None,
definition: dict[str, Any] | None = None,
return_raw: bool = False,
context: RouteContext | None = None,
**context_kwargs
) -> DomoCard
Create a new KPI card and return the hydrated :class:DomoCard.
This is the high-level entry point that ties the kpi_builder write
side to the create_card route. It builds the card definition from
the supplied chart parameters (or accepts a pre-built definition),
binds it to dataset_id, and returns a fully-loaded card.
Passing the builder output straight through is deliberately safe: this
method sends the inner definition to the route, so callers never have
to unwrap the {"definition": ...} envelope themselves.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
DomoAuth instance. |
required |
chart_type
|
str
|
Friendly chart-type name (e.g. |
required |
dataset_id
|
str
|
The dataSourceId to bind the card to. |
required |
title
|
str
|
Card title. |
required |
measure_column
|
str | None
|
VALUE column (aggregated numeric measure). |
None
|
aggregation
|
str
|
Aggregation applied to |
'SUM'
|
dimension_column
|
str | None
|
ITEM / primary groupBy column. |
None
|
series_column
|
str | None
|
Optional SERIES / secondary grouping column. |
None
|
filters
|
list[Any] | None
|
Optional filters (raw dicts or |
None
|
order_by
|
list[Any] | None
|
Optional sorts (raw dicts or |
None
|
overrides
|
dict[str, Any] | None
|
Chart overrides ( |
None
|
description
|
str | None
|
Optional card description. |
None
|
definition
|
dict[str, Any] | None
|
Escape hatch — a pre-built inner definition dict
(from |
None
|
return_raw
|
bool
|
Return the raw create response instead of a DomoCard. |
False
|
context
|
RouteContext | None
|
Optional RouteContext. |
None
|
Returns:
| Type | Description |
|---|---|
DomoCard
|
The created card, hydrated via :meth: |
DomoCard
|
response when |
Raises:
| Type | Description |
|---|---|
CardApiError
|
If the create call fails. |
ValueError
|
If the create response has no resolvable card id. |
Source code in src/crew_dcs/classes/DomoCard/core.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 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 | |
delete
async
¶
delete(
*, context: RouteContext | None = None, **context_kwargs
) -> Any
Delete this card.
Source code in src/crew_dcs/classes/DomoCard/core.py
127 128 129 130 131 132 133 134 135 136 137 138 139 | |
from_dict
classmethod
¶
from_dict(
auth: DomoAuth,
obj: dict,
owners: list[Any] | None = None,
pages: list[Any] | None = None,
is_published: bool = False,
parent_auth_retrieval_fn: Callable | None = None,
parent_auth: DomoAuth | None = None,
**kwargs
) -> DomoCard
Convert API response dictionary to DomoCard instance.
For federated cards, use composition via card.Federation helper.
Source code in src/crew_dcs/classes/DomoCard/core.py
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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |