bayesline.api.equity.PortfolioSettings#
- pydantic model bayesline.api.equity.PortfolioSettings#
Specifies different options of obtaining portfolios.
Show JSON schema
{ "title": "PortfolioSettings", "description": "Specifies different options of obtaining portfolios.", "type": "object", "properties": { "portfolio_schema": { "anyOf": [ { "type": "string" }, { "type": "integer" }, { "$ref": "#/$defs/PortfolioOrganizerSettings" } ], "description": "The portfolio organizer settings to use as an underlying schema of portfolios. The 'Default' schema is used by default.", "title": "Portfolio Schema" } }, "$defs": { "PortfolioOrganizerSettings": { "additionalProperties": false, "description": "Definition of where to source portfolio data from.\n\nSpecifies which portfolios to enable (from different sources).\nDifferent sources (e.g. uploaded portfolios) can provide the same portfolio\nidentifiers. These settings allow to specify which portfolios to enable from\nwhich sources.", "properties": { "enabled_portfolios": { "anyOf": [ { "type": "string" }, { "additionalProperties": { "type": "string" }, "type": "object" } ], "description": "The enabled portfolios from different sources. The key is the portfolio ID, and the value is the source (name of the underlying portfolio service). Pass a str to reference an entire portfolio source (e.g. all portfolios from an upload).", "title": "Enabled Portfolios" }, "auxiliary_portfolios": { "additionalProperties": { "type": "string" }, "description": "Portfolios pulled in by fund-of-funds (FoF) cascade. Informational: always recomputed from ``enabled_portfolios`` plus the FoF graph at load time. Persisted as-is on save; any stale values are overwritten on the next normalize. The loader's effective enabled set is the union of ``enabled_portfolios`` and ``auxiliary_portfolios`` with user-explicit entries winning on key collision.", "title": "Auxiliary Portfolios", "type": "object" } }, "required": [ "enabled_portfolios" ], "title": "PortfolioOrganizerSettings", "type": "object" } }, "additionalProperties": false, "required": [ "portfolio_schema" ] }
- Config:
frozen: bool = True
extra: str = forbid
- Fields:
portfolio_schema (str | int | bayesline.api._src.equity.portfolio_settings.PortfolioOrganizerSettings)
- Validators:
validate_portfolio_schema»portfolio_schema
-
field portfolio_schema:
Annotated[str|int|PortfolioOrganizerSettings] [Required]# The portfolio organizer settings to use as an underlying schema of portfolios. The ‘Default’ schema is used by default.
- Constraints:
references = <class ‘bayesline.api._src.equity.portfolio_settings.PortfolioOrganizerSettings’>
- Validated by:
_strip_unknown_on_loadvalidate_portfolio_schema
- get_references() Sequence[str | int]#
Get references for this settings object.
Returns#
- Sequence[str | int]
A sequence of references (strings or integers) for this settings object.
Get the menu type for this settings object.
Returns#
- type[M]
The menu type for this settings object.
- classmethod from_source(source: str) PortfolioSettings#
Create portfolio settings from a source.
Parameters#
- sourcestr
The name of an upload from the portfolio uploader.
Returns#
- PortfolioSettings
The created portfolio settings.
- validator validate_portfolio_schema str | int | PortfolioOrganizerSettings » portfolio_schema#
- describe(menu: PortfolioSettingsMenu) str#
Describe the settings.
Parameters#
- menuPortfolioSettingsMenu
The menu to get context information from.
Returns#
- str
A description of the settings.