finalynx.portfolio.lineο
Module Contentsο
Classesο
This class represents a single investment line in your online account (e.g. Finary). |
APIο
- class finalynx.portfolio.line.Line(name: str, asset_class: finalynx.portfolio.constants.AssetClass = AssetClass.UNKNOWN, asset_subclass: finalynx.portfolio.constants.AssetSubclass = AssetSubclass.UNKNOWN, parent: Optional[finalynx.portfolio.folder.Folder] = None, target: Optional[finalynx.portfolio.targets.Target] = None, key: Optional[str] = None, amount: float = 0, newline: bool = False, perf: Optional[finalynx.portfolio.constants.LinePerf] = None, currency: Optional[str] = None, envelope: Optional[finalynx.portfolio.envelope.Envelope] = None)[source]ο
Bases:
finalynx.portfolio.node.NodeThis class represents a single investment line in your online account (e.g. Finary).
Initialization
This is a subclass of
Nodethat adds anamountandkeyproperty.- Parameters:
name β The name that will be displayed in the final portfolio tree.
parent β Parent of this line. If this line is created in a
Folderinstance, the folder will set iself as the parent at the initialization stage.target β Optional
Targetinstance to format this lineβs amount based on the objective you selected.key β Optional string that must be identical to the name in the online account (e.g. Finary). Defaults to the
nameif the key is not set.amount β How much has been invested on this investment line. If you connect your online account, the amount you specify will be replaced by what has been fetched online.
newline β Print a new line in the console at the end of this
Linefor better readability.
- get_perf() finalynx.portfolio.constants.LinePerf[source]ο
- Returns:
The expected yearly performance of this line (set by user).
- apply_perf(inflation: float = 2.0, n_years: float = 1.0) float[source]ο
Applies the performance if set.
n_yearsspecifies the period to apply the performance over (e.g. 1 / 12 = 0.0833 for one month).- Returns:
The gained amount, or None if no perf was defined.
- _render_account_code() str[source]ο
- Returns:
A formatted string representation of this lineβs envelope.
- static from_dict(dict: Dict[str, Any], envelopes: Dict[str, finalynx.portfolio.envelope.Envelope]) finalynx.portfolio.line.Line[source]ο