Skip to content

interface

Interfaces for the StockTracer Module.

Analysis

Base class for all analysis techniques.

Source code in src/stocktracer/interface.py
@beartype
class Analysis(metaclass=abc.ABCMeta):
    """Base class for all analysis techniques."""

    def __init__(self, options: Options) -> None:
        self.options = options
        assert self.options is not None

    @abc.abstractmethod
    def analyze(self) -> Optional[DataFrame]:
        """Perform financial analysis.

        Returns:
            Optional[DataFrame]: results of analysis
        """

    under_development: bool = False

analyze() abstractmethod

Perform financial analysis.

Returns:

Type Description
Optional[DataFrame]

Optional[DataFrame]: results of analysis

Source code in src/stocktracer/interface.py
@abc.abstractmethod
def analyze(self) -> Optional[DataFrame]:
    """Perform financial analysis.

    Returns:
        Optional[DataFrame]: results of analysis
    """

Options dataclass

Command Line Options.

Source code in src/stocktracer/interface.py
@beartype
@dataclass(frozen=True)
class Options:
    """Command Line Options."""

    tickers: list[str]
    final_report: ReportDate = ReportDate()

    def __post_init__(self):
        self.tickers.sort()

Last update: July 3, 2023