mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 13:32:08 +00:00
* merge branch develop with main * bump desktop version * fix the merge * sync Cargo.lock to desktop 2.0.0 * fix cli conftest.py --------- Co-authored-by: deeleeramone <>
29 lines
712 B
Python
29 lines
712 B
Python
"""Base output adapter protocol."""
|
|
|
|
from typing import Any, Protocol
|
|
|
|
|
|
class OutputAdapter(Protocol):
|
|
"""Protocol for output adapters."""
|
|
|
|
def display(
|
|
self,
|
|
data: Any,
|
|
title: str = "",
|
|
export: bool = False,
|
|
chart: bool = False,
|
|
) -> None:
|
|
"""Display data in the adapter's format.
|
|
|
|
Parameters
|
|
----------
|
|
data : Any
|
|
Data to display - can be OBBject, DataFrame, Series, dict, list, scalar, etc.
|
|
title : str
|
|
Title for the output
|
|
export : bool
|
|
Whether we are exporting (don't display if True)
|
|
chart : bool
|
|
Whether to display as chart if available
|
|
"""
|