-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from OpenBB-finance/feature/openbb-sdk-v4
Feature/openbb sdk v4
- Loading branch information
Showing
22 changed files
with
1,475 additions
and
1,566 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
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
33 changes: 33 additions & 0 deletions
33
openbb_platform/platform/provider/openbb_provider/standard_models/options_unusual.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,33 @@ | ||
"""Unusual Options data model.""" | ||
|
||
from typing import Optional | ||
|
||
from pydantic import Field, field_validator | ||
|
||
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 OptionsUnusualQueryParams(QueryParams): | ||
"""Unusual Options Query Params""" | ||
|
||
symbol: Optional[str] = Field( | ||
default=None, | ||
description=QUERY_DESCRIPTIONS.get("symbol", "") + " (the underlying symbol)", | ||
) | ||
|
||
@field_validator("symbol", mode="before", check_fields=False) | ||
def upper_symbol(cls, v: str): | ||
"""Convert symbol to uppercase.""" | ||
return v.upper() if v else None | ||
|
||
|
||
class OptionsUnusualData(Data): | ||
"""Unusual Options Data.""" | ||
|
||
underlying_symbol: Optional[str] = Field( | ||
description=DATA_DESCRIPTIONS.get("symbol", "") + " (the underlying symbol)", | ||
default=None, | ||
) | ||
contract_symbol: str = Field(description="Contract symbol for the option.") |
Oops, something went wrong.