entities
entities ¶
Access ¶
DomoEntity
dataclass
¶
DomoEntity(auth: DomoAuth, id: str, raw: dict)
Bases: DomoBase
Base class for all Domo entities (datasets, cards, pages, users, etc.).
Provides core functionality including authentication, unique identification, data conversion utilities, and relationship management. All concrete entity types should inherit from this class or one of its subclasses.
Attributes:
| Name | Type | Description |
|---|---|---|
auth |
DomoAuth
|
Authentication object for API requests (hidden in repr) |
id |
str
|
Unique identifier for the entity |
raw |
dict
|
Raw API response data for the entity (hidden in repr) |
Relations |
Any
|
Relationship controller for managing entity relationships |
Class Attributes
entity_type: The Domo entity type string (e.g., "DATA_SOURCE", "PAGE"). Concrete subclasses MUST set this. Intermediate/abstract bases that don't override it are skipped by auto-registration. has_lineage: Whether this entity type supports lineage tracking. Defaults to False on DomoEntity, True on DomoEntity_w_Lineage.
Example
entity = SomeDomoEntity(auth=auth, id="123", raw={}) entity.display_url() # Implemented by subclass 'https://mycompany.domo.com/...'
display_url
abstractmethod
property
¶
display_url: str
Generate the URL to display this entity in the Domo interface.
This method should return the direct URL to view the entity in Domo's web interface, allowing users to navigate directly to the entity.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Complete URL to view the entity in Domo |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses |
entity_name
property
¶
entity_name: str
Get the display name for this entity.
Tries common name fields in order: name, title, display_name. Falls back to entity ID if no name is found.
Subclasses can override this property to use entity-specific name fields.
Returns:
| Type | Description |
|---|---|
str
|
Display name for the entity, or entity ID as fallback |
create
async
classmethod
¶
create(auth: DomoAuth, **kwargs) -> DomoEntity
Create a new entity and return it (classmethod: no instance yet).
Creatable entities override this to build the create payload (typically via a builder) and call the corresponding route.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If this entity type does not support creation. |
Source code in src/crew_dcs/base/entities.py
276 277 278 279 280 281 282 283 284 285 286 | |
delete
async
¶
delete(**kwargs)
Delete this entity.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If this entity type does not support deletion. |
Source code in src/crew_dcs/base/entities.py
296 297 298 299 300 301 302 | |
dispatch_get_by_id
async
classmethod
¶
dispatch_get_by_id(
auth: DomoAuth,
entity_type: str,
entity_id: str,
**kwargs
)
Route entity_type + entity_id to the right subclass.get_entity_by_id().
The entity class must already be imported (which triggers init_subclass registration). If you get a "not registered" error, import the entity module before calling this method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
entity_type
|
str
|
The Domo entity type string (e.g., "DATA_SOURCE", "PAGE") |
required |
entity_id
|
str
|
Unique identifier of the entity to retrieve |
required |
**kwargs
|
Additional arguments passed to the subclass's get_entity_by_id |
{}
|
Returns:
| Type | Description |
|---|---|
|
An instance of the appropriate DomoEntity subclass |
Raises:
| Type | Description |
|---|---|
ValueError
|
If entity_type is not registered |
Source code in src/crew_dcs/base/entities.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |
from_dict
abstractmethod
classmethod
¶
from_dict(auth: DomoAuth, obj: dict[str, Any])
Create an entity instance from a dictionary representation.
This method should be implemented by subclasses to handle the conversion from API response dictionaries to entity objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
obj
|
dict[str, Any]
|
Dictionary representation of the entity from the API |
required |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses |
Source code in src/crew_dcs/base/entities.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | |
get_by_id
abstractmethod
async
classmethod
¶
get_by_id(
auth: DomoAuth,
id: str,
debug_num_stacks_to_drop=2,
debug_api: bool = False,
session: AsyncClient | None = None,
)
Fetch an entity by its unique identifier.
This method should be implemented by subclasses to handle entity-specific retrieval logic from the Domo API.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
entity_id
|
str
|
Unique identifier of the entity to retrieve |
required |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses |
Source code in src/crew_dcs/base/entities.py
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | |
get_entity_by_id
abstractmethod
async
classmethod
¶
get_entity_by_id(
auth: DomoAuth,
entity_id: str,
debug_num_stacks_to_drop: int = 2,
debug_api: bool = False,
session: AsyncClient | None = None,
check_if_published: bool | None = None,
parent_auth_retrieval_fn: Any | None = None,
parent_auth: Any | None = None,
**kwargs
)
Fetch an entity by its ID
This method should be implemented by subclasses to fetch the specific entity type while ensuring lineage tracking is properly initialized.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object for API requests |
required |
entity_id
|
str
|
Unique identifier of the entity to retrieve |
required |
debug_num_stacks_to_drop
|
int
|
Number of stack frames to drop for debug logging (default: 2) |
2
|
debug_api
|
bool
|
Enable API debug logging (default: False) |
False
|
session
|
AsyncClient | None
|
Optional HTTP client session |
None
|
check_if_published
|
bool | None
|
When True attempt to resolve publish subscriptions. If None and either parent_auth or parent_auth_retrieval_fn is provided, subclasses should default to True. |
None
|
parent_auth_retrieval_fn
|
Any | None
|
Callable used to obtain publisher auth for publish checks |
None
|
parent_auth
|
Any | None
|
Pre-existing publisher auth (alternative to parent_auth_retrieval_fn) |
None
|
**kwargs
|
Additional arguments passed to the underlying get_by_id method |
{}
|
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses |
Source code in src/crew_dcs/base/entities.py
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 | |
refresh
async
¶
refresh(
debug_num_stacks_to_drop=2,
debug_api: bool = False,
session: AsyncClient | None = None,
**kwargs
)
Refresh this instance from the API using its id and auth.
Source code in src/crew_dcs/base/entities.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | |
to_dict ¶
to_dict(
override_fn: Callable | None = None,
return_snake_case: bool = False,
) -> dict
Convert all dataclass attributes to a dictionary in camelCase or snake_case.
This method is useful for serializing entity data for API requests or data export operations.
Only fields with repr=True are included, plus any properties listed in serialize_properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
override_fn
|
Callable | None
|
Custom conversion function to override default behavior |
None
|
return_snake_case
|
bool
|
If True, return keys in snake_case. If False (default), return camelCase. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Dictionary with camelCase (default) or snake_case keys and corresponding attribute values |
Example
entity.to_dict() {'id': '123', 'displayName': 'My Entity', 'displayUrl': '...', ...} entity.to_dict(return_snake_case=True) {'id': '123', 'display_name': 'My Entity', 'display_url': '...', ...}
Source code in src/crew_dcs/base/entities.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | |
update
async
¶
update(**kwargs) -> DomoEntity
Update this entity in place and return self.
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If this entity type does not support update. |
Source code in src/crew_dcs/base/entities.py
288 289 290 291 292 293 294 | |
DomoEntity_w_Lineage
dataclass
¶
DomoEntity_w_Lineage(auth: DomoAuth, id: str, raw: dict)
Bases: DomoEntity
Entity with lineage tracking capabilities.
Extends DomoEntity to include lineage tracking functionality, enabling entities to track their relationships and dependencies within the Domo ecosystem.
Attributes:
| Name | Type | Description |
|---|---|---|
Lineage |
Any | None
|
Lineage tracking object for dependency management (hidden in repr) |
Federation |
Any | None
|
Federation context for publish/subscribe state (hidden in repr) |
__skip_lineage_registration__ |
Any | None
|
Class attribute to opt out of registration requirement. Set to True for abstract or intermediate base classes that should not be registered. |
name
property
¶
name: str
Get the display name for this entity.
All entities with lineage provide a name property for consistent identification in lineage diagrams and reports.
Entities that use 'title' (DomoCard, DomoPage) should override this as: @property def name(self) -> str: return self.title or f"Untitled {self.entity_type}"
Entities with a 'name' attribute (DomoDataset, DomoDataflow, DomoPublication) will use their dataclass field directly.
Returns:
| Type | Description |
|---|---|
str
|
Display name for the entity |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If entity doesn't have name, title, or override this property |
enable_federation_support ¶
enable_federation_support()
Ensure this entity has an attached FederationContext helper. returns FederationContext instance.
Source code in src/crew_dcs/base/entities.py
507 508 509 510 511 512 513 514 515 516 517 | |
probe_is_published
async
classmethod
¶
probe_is_published(
entity_id: str,
subscriber_auth: DomoAuth,
parent_auth: DomoAuth | None = None,
parent_auth_retrieval_fn: Callable | None = None,
session: AsyncClient | None = None,
debug_api: bool = False,
max_subscriptions_to_check: int | None = None,
context: RouteContext | None = None,
)
Check if entity is published (federated) - works for all entity types.
Uses lineage type registry to determine entity type automatically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entity_id
|
str
|
Entity identifier to check |
required |
subscriber_auth
|
DomoAuth
|
Auth for subscriber instance |
required |
parent_auth
|
DomoAuth | None
|
Optional pre-existing publisher auth |
None
|
parent_auth_retrieval_fn
|
Callable | None
|
Callable to retrieve publisher auth |
None
|
session
|
AsyncClient | None
|
Optional HTTP session for reuse |
None
|
debug_api
|
bool
|
Enable debug logging |
False
|
max_subscriptions_to_check
|
int | None
|
Limit subscription checking |
None
|
context
|
RouteContext | None
|
Optional pre-built context |
None
|
Returns:
| Type | Description |
|---|---|
|
FederationContext with subscription info if published |
Raises:
| Type | Description |
|---|---|
ValueError
|
If class not registered with lineage type or missing auth |
Source code in src/crew_dcs/base/entities.py
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 | |
DomoManager
dataclass
¶
DomoManager(auth: DomoAuth)
Bases: DomoBase
Base class for entity managers that handle collections of entities.
Provides the foundation for manager classes that handle operations on collections of entities (e.g., DatasetManager, CardManager).
Attributes:
| Name | Type | Description |
|---|---|---|
auth |
DomoAuth
|
Authentication object for API requests (hidden in repr) |
get
abstractmethod
async
¶
get(*args: Any, **kwargs: Any) -> list[DomoEntity]
Retrieve entities based on provided criteria.
Must be implemented by subclasses to handle entity-specific retrieval and filtering logic.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
Any
|
Positional arguments for entity retrieval |
()
|
**kwargs
|
Any
|
Keyword arguments for filtering and options |
{}
|
Returns:
| Type | Description |
|---|---|
list[DomoEntity]
|
list[DomoEntity]: List of entity instances retrieved |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
Must be implemented by subclasses |
Source code in src/crew_dcs/base/entities.py
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 | |
DomoSubEntity
dataclass
¶
DomoSubEntity(parent: DomoEntity)
Bases: DomoBase
Base class for entities that belong to a parent entity.
Handles entities that are sub-components of other entities, such as columns in a dataset or slides in a page. Automatically inherits authentication and parent references.
Attributes:
| Name | Type | Description |
|---|---|---|
parent |
DomoEntity
|
Reference to the parent entity |
auth |
Authentication object (inherited from parent, hidden in repr) |
from_parent
classmethod
¶
from_parent(parent: DomoEntity)
Create a sub-entity instance from a parent entity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent
|
DomoEntity
|
The parent entity to derive from |
required |
Returns:
| Name | Type | Description |
|---|---|---|
DomoSubEntity |
New sub-entity instance with inherited properties |
Source code in src/crew_dcs/base/entities.py
696 697 698 699 700 701 702 703 704 705 706 | |