-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Seprate Intrinio financials data tags into a different command (#5723)
* add `ebit` field in income statement standard model * only add required data tags * remove calculations data * use `name` key instead of `tag` key * set `period` as required in data * remove `period` and `cik` from provider models * add `equity/fundamental/search_financial_attributes` with tests * clean descriptions file * add `equity/fundamental/financial_attributes` with tests * set `value` as `Optional`
- Loading branch information
Showing
18 changed files
with
505 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
openbb_platform/platform/provider/openbb_provider/standard_models/financial_attributes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""Financial Attributes standard model.""" | ||
|
||
from datetime import date as dateType | ||
from typing import Literal, Optional | ||
|
||
from pydantic import Field | ||
|
||
from openbb_provider.abstract.data import Data | ||
from openbb_provider.abstract.query_params import QueryParams | ||
from openbb_provider.utils.descriptions import DATA_DESCRIPTIONS, QUERY_DESCRIPTIONS | ||
|
||
|
||
class FinancialAttributesQueryParams(QueryParams): | ||
"""Financial Attributes Query.""" | ||
|
||
symbol: str = Field(description=QUERY_DESCRIPTIONS.get("symbol")) | ||
tag: str = Field(description=QUERY_DESCRIPTIONS.get("tag")) | ||
period: Optional[Literal["annual", "quarter"]] = Field( | ||
default="annual", description=QUERY_DESCRIPTIONS.get("period") | ||
) | ||
limit: Optional[int] = Field( | ||
default=1000, description=QUERY_DESCRIPTIONS.get("limit") | ||
) | ||
type: Optional[str] = Field( | ||
default=None, description="Filter by type, when applicable." | ||
) | ||
start_date: Optional[dateType] = Field( | ||
default=None, description=QUERY_DESCRIPTIONS.get("start_date") | ||
) | ||
end_date: Optional[dateType] = Field( | ||
default=None, description=QUERY_DESCRIPTIONS.get("end_date") | ||
) | ||
sort: Optional[Literal["asc", "desc"]] = Field( | ||
default="desc", description="Sort order." | ||
) | ||
|
||
|
||
class FinancialAttributesData(Data): | ||
"""Financial Attributes Data.""" | ||
|
||
date: dateType = Field(description=DATA_DESCRIPTIONS.get("date")) | ||
value: Optional[float] = Field(default=None, description="The value of the data.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...platform/platform/provider/openbb_provider/standard_models/search_financial_attributes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
"""Search Financial Attributes standard model.""" | ||
|
||
from typing import Optional | ||
|
||
from pydantic import Field | ||
|
||
from openbb_provider.abstract.data import Data | ||
from openbb_provider.abstract.query_params import QueryParams | ||
from openbb_provider.utils.descriptions import QUERY_DESCRIPTIONS | ||
|
||
|
||
class SearchFinancialAttributesQueryParams(QueryParams): | ||
"""Search Financial Attributes Query.""" | ||
|
||
query: str = Field(description="Query to search for.") | ||
limit: Optional[int] = Field( | ||
default=1000, description=QUERY_DESCRIPTIONS.get("limit") | ||
) | ||
|
||
|
||
class SearchFinancialAttributesData(Data): | ||
"""Search Financial Attributes Data.""" | ||
|
||
id: str = Field(description="ID of the financial attribute.") | ||
name: str = Field(description="Name of the financial attribute.") | ||
tag: str = Field(description="Tag of the financial attribute.") | ||
statement_code: str = Field(description="Code of the financial statement.") | ||
statement_type: Optional[str] = Field( | ||
default=None, description="Type of the financial statement." | ||
) | ||
parent_name: Optional[str] = Field( | ||
default=None, description="Parent's name of the financial attribute." | ||
) | ||
sequence: Optional[int] = Field( | ||
default=None, description="Sequence of the financial statement." | ||
) | ||
factor: Optional[str] = Field( | ||
default=None, description="Unit of the financial attribute." | ||
) | ||
transaction: Optional[str] = Field( | ||
default=None, | ||
description="Transaction type (credit/debit) of the financial attribute.", | ||
) | ||
type: Optional[str] = Field( | ||
default=None, description="Type of the financial attribute." | ||
) | ||
unit: Optional[str] = Field( | ||
default=None, description="Unit of the financial attribute." | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.