brandkit
brandkit ¶
DomoInstanceConfig Brand Kit Management
This module provides a unified interface for managing brand kit configurations in Domo, including custom color palettes and active palette settings.
BrandKit_InstantiationError ¶
BrandKit_InstantiationError(
auth: DomoAuth, message: str, cls=None
)
Bases: ClassError
Exception raised when brand kit instantiation fails.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
37 38 39 40 41 42 | |
ColorPalette
dataclass
¶
ColorPalette(
name: str = "Custom Color Palette",
palette_id: str | None = None,
settings: ColorPaletteSettings = ColorPaletteSettings(),
color_ranges: list[ColorRange] = list(),
color_rules: list[ColorRule] = list(),
selector: list[list[list[int]]] = list(),
gradients: list[Gradient] = list(),
line_colors: list[list[int]] = list(),
pop_colors: list[list[int]] = list(),
pop_var_line_colors: list[list[int]] = list(),
pop_var_colors: list[list[int]] = list(),
pop_line_colors: list[list[int]] = list(),
name_color_map: dict[str, list[int]] = dict(),
)
Bases: DomoBase
Complete color palette composition with all components.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Palette name |
palette_id |
str | None
|
Unique identifier (populated after creation) |
settings |
ColorPaletteSettings
|
Color palette settings |
color_ranges |
list[ColorRange]
|
List of color ranges |
color_rules |
list[ColorRule]
|
List of color rules |
selector |
list[list[list[int]]]
|
Selector configuration |
gradients |
list[Gradient]
|
List of gradient configurations |
line_colors |
list[list[int]]
|
Line color references |
pop_colors |
list[list[int]]
|
Period-over-period colors |
pop_var_line_colors |
list[list[int]]
|
PoP variance line colors |
pop_var_colors |
list[list[int]]
|
PoP variance colors |
pop_line_colors |
list[list[int]]
|
PoP line colors |
name_color_map |
dict[str, list[int]]
|
Named color mappings for specific chart elements |
from_dict
classmethod
¶
from_dict(
obj: dict[str, Any], name: str = "Custom Color Palette"
) -> ColorPalette
Create ColorPalette from dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
dict[str, Any]
|
Dictionary containing palette configuration |
required |
name
|
str
|
Palette name |
'Custom Color Palette'
|
Returns:
| Type | Description |
|---|---|
ColorPalette
|
ColorPalette instance |
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | |
to_dict ¶
to_dict() -> dict[str, Any]
Convert to dictionary for API payload.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
ColorPaletteSettings
dataclass
¶
ColorPaletteSettings(
selection_method_pop: str = "manual",
color_mode: str = "oklab",
selection_method: str = "manual",
pairing_options: dict[str, Any] = (
lambda: {"colorCount": 2}
)(),
pairing_options_pop: dict[str, Any] = (
lambda: {"colorCount": 3}
)(),
lightness_range: list[int] = (lambda: [30, 95])(),
)
Bases: DomoBase
Settings for color palette generation and behavior.
Attributes:
| Name | Type | Description |
|---|---|---|
selection_method_pop |
str
|
Selection method for period-over-period colors |
color_mode |
str
|
Color interpolation mode (e.g., "oklab") |
selection_method |
str
|
Primary color selection method |
pairing_options |
dict[str, Any]
|
Options for color pairing |
pairing_options_pop |
dict[str, Any]
|
PoP pairing options |
lightness_range |
list[int]
|
Range for lightness values [min, max] |
from_dict
classmethod
¶
from_dict(obj: dict[str, Any]) -> ColorPaletteSettings
Create ColorPaletteSettings from dictionary.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
198 199 200 201 202 203 204 205 206 207 208 | |
to_dict ¶
to_dict() -> dict[str, Any]
Convert to dictionary for API payload.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
187 188 189 190 191 192 193 194 195 196 | |
ColorRange
dataclass
¶
ColorRange(
name: str,
values: list[str] = list(),
key_colors: list[KeyColor] = list(),
)
Bases: DomoBase
Represents a color range in the palette.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Name of the color range (e.g., "AcmeBlue-0") |
values |
list[str]
|
List of hex color values |
key_colors |
list[KeyColor]
|
List of key colors defining the range |
from_dict
classmethod
¶
from_dict(obj: dict[str, Any]) -> ColorRange
Create ColorRange from dictionary.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
107 108 109 110 111 112 113 114 | |
to_dict ¶
to_dict() -> dict[str, Any]
Convert to dictionary for API payload.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
99 100 101 102 103 104 105 | |
ColorRule
dataclass
¶
ColorRule(
min: int, max: int, values: list[list[int]] = list()
)
Bases: DomoBase
Represents a color rule defining which colors to use for specific counts.
Attributes:
| Name | Type | Description |
|---|---|---|
min |
int
|
Minimum number of colors |
max |
int
|
Maximum number of colors |
values |
list[list[int]]
|
List of color references as [range_index, color_index] pairs |
from_dict
classmethod
¶
from_dict(obj: dict[str, Any]) -> ColorRule
Create ColorRule from dictionary.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
135 136 137 138 139 140 | |
to_dict ¶
to_dict() -> dict[str, Any]
Convert to dictionary for API payload.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
131 132 133 | |
DomoBrandKit
dataclass
¶
DomoBrandKit(
auth: DomoAuth,
active_palette_id: str | None = None,
active_palette_type: str = "CUSTOMER",
palettes: dict[str, ColorPalette] = dict(),
)
Bases: DomoBase
Manages brand kit configurations in Domo.
This class provides methods to create, retrieve, and manage custom color palettes and set active palettes for the instance.
Note: Unlike most Domo entities, brand kit represents instance-level configuration and palette management.
Attributes:
| Name | Type | Description |
|---|---|---|
auth |
DomoAuth
|
Authentication object for API requests |
active_palette_id |
str | None
|
ID of the currently active palette |
active_palette_type |
str
|
Type of active palette (e.g., "CUSTOMER") |
palettes |
dict[str, ColorPalette]
|
Cache of retrieved color palettes |
clear_cache ¶
clear_cache()
Clear the palette cache.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
497 498 499 | |
create_color_palette
async
¶
create_color_palette(
palette: ColorPalette,
debug_api: bool = False,
session: AsyncClient | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ColorPalette | dict[str, Any]
Create a custom color palette.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
palette
|
ColorPalette
|
ColorPalette object with complete configuration |
required |
debug_api
|
bool
|
Enable debug output |
False
|
session
|
AsyncClient | None
|
Optional httpx session |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
Returns:
| Type | Description |
|---|---|
ColorPalette | dict[str, Any]
|
ColorPalette instance with populated palette_id, or raw response if return_raw=True |
Raises:
| Type | Description |
|---|---|
BrandKit_CRUD_Error
|
If palette creation fails |
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | |
get_palette_by_id
async
¶
get_palette_by_id(
palette_id: str,
use_cache: bool = True,
debug_api: bool = False,
session: AsyncClient | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ColorPalette | dict[str, Any]
Get a color palette by ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
palette_id
|
str
|
Unique identifier for the palette |
required |
use_cache
|
bool
|
Check cache before making API call |
True
|
debug_api
|
bool
|
Enable debug output |
False
|
session
|
AsyncClient | None
|
Optional httpx session |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
Returns:
| Type | Description |
|---|---|
ColorPalette | dict[str, Any]
|
ColorPalette instance or raw response if return_raw=True |
Raises:
| Type | Description |
|---|---|
BrandKit_GET_Error
|
If palette retrieval fails |
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 | |
set_active_palette
async
¶
set_active_palette(
palette_id: str | None = None,
palette: ColorPalette | None = None,
palette_type: str = "CUSTOMER",
debug_api: bool = False,
session: AsyncClient | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> dict[str, Any]
Set a color palette as the active default for the instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
palette_id
|
str | None
|
ID of palette to set as active (provide either this or palette) |
None
|
palette
|
ColorPalette | None
|
ColorPalette object (will use its palette_id) |
None
|
palette_type
|
str
|
Type of palette (default: "CUSTOMER") |
'CUSTOMER'
|
debug_api
|
bool
|
Enable debug output |
False
|
session
|
AsyncClient | None
|
Optional httpx session |
None
|
return_raw
|
bool
|
Return raw response without processing |
False
|
context
|
RouteContext | None
|
Optional RouteContext for API call configuration |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Response indicating success/failure |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither palette_id nor palette is provided |
BrandKit_CRUD_Error
|
If setting active palette fails |
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 | |
Gradient
dataclass
¶
Gradient(col_count: int, values: list[list[int]] = list())
Bases: DomoBase
Represents a gradient configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
col_count |
int
|
Number of colors in the gradient |
values |
list[list[int]]
|
List of color references as [range_index, color_index] pairs |
from_dict
classmethod
¶
from_dict(obj: dict[str, Any]) -> Gradient
Create Gradient from dictionary.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
159 160 161 162 | |
to_dict ¶
to_dict() -> dict[str, Any]
Convert to dictionary for API payload.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
155 156 157 | |
KeyColor
dataclass
¶
KeyColor(
color: str,
step_value: int | None = None,
locked: bool = False,
base: bool = False,
index: int = 0,
)
Bases: DomoBase
Represents a key color in a color range.
Attributes:
| Name | Type | Description |
|---|---|---|
color |
str
|
Hex color code (e.g., "#E7F3FB") |
step_value |
int | None
|
Step value for the color (e.g., 50, 500) |
locked |
bool
|
Whether the color is locked |
base |
bool
|
Whether this is a base color |
index |
int
|
Index in the color range |
from_dict
classmethod
¶
from_dict(obj: dict[str, Any]) -> KeyColor
Create KeyColor from dictionary.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
73 74 75 76 77 78 79 80 81 82 | |
to_dict ¶
to_dict() -> dict[str, Any]
Convert to dictionary for API payload.
Source code in src/crew_dcs/classes/DomoInstanceConfig/brandkit.py
63 64 65 66 67 68 69 70 71 | |