Coverage for src/jquantstats/_utils/_protocol.py: 100%
3 statements
« prev ^ index » next coverage.py v7.14.1, created at 2026-06-23 06:13 +0000
« prev ^ index » next coverage.py v7.14.1, created at 2026-06-23 06:13 +0000
1"""Protocols describing the minimal interfaces required by the _utils subpackage."""
3from __future__ import annotations
5from typing import Protocol, runtime_checkable
7from jquantstats._protocol import DataLike
10@runtime_checkable
11class PortfolioLike(Protocol): # pragma: no cover
12 """Structural interface required by `PortfolioUtils`.
14 Any object satisfying this protocol can be passed as ``portfolio`` without a
15 concrete dependency on `Portfolio`.
16 """
18 @property
19 def data(self) -> DataLike:
20 """Bridge to the Data analytics object for this portfolio."""
21 ...
23 @property
24 def assets(self) -> list[str]:
25 """Asset column names."""
26 ...