add some more

This commit is contained in:
Danglewood
2023-10-04 20:37:54 -07:00
parent a9e229282d
commit 16f93a6b65
4 changed files with 93 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
"""Industry P/E Ratio data model."""
from datetime import date as dateType
from typing import Optional
from pydantic import Field
from openbb_provider.abstract.data import Data
from openbb_provider.abstract.query_params import QueryParams
class IndustryPeQueryParams(QueryParams):
"""Industry P/E Ratio Query."""
class IndustryPeData(Data):
"""Industry P/E Ratio Data."""
date: Optional[dateType] = Field(
description="The date of the P/E ratio.", default=None
)
exchange: Optional[str] = Field(
default=None, description="The exchange where the data is from."
)
sector: str = Field(description="The name of the industry.")
pe: float = Field(description="The P/E ratio of the industry.")

View File

@@ -0,0 +1,24 @@
"""Market Movers data model. Base model for market gainers/losers/most active."""
from typing import Optional
from pydantic import Field
from openbb_provider.abstract.data import Data
from openbb_provider.abstract.query_params import QueryParams
class MarketMoversQueryParams(QueryParams):
"""Market Movers Query."""
class MarketMoversData(Data):
"""Market Movers Data."""
symbol: str = Field(description="The ticker symbol.")
name: Optional[str] = Field(
default=None, description="The name associated with the ticker."
)
price: float = Field(description="The last price of the ticker.")
change: float = Field(description="The change in price from open.")
change_percent: float = Field(description="The change in percent from open.")

View File

@@ -0,0 +1,26 @@
"""Sector P/E Ratio data model."""
from datetime import date as dateType
from typing import Optional
from pydantic import Field
from openbb_provider.abstract.data import Data
from openbb_provider.abstract.query_params import QueryParams
class SectorPeQueryParams(QueryParams):
"""Sector P/E Ratio Query."""
class SectorPeData(Data):
"""Sector P/E Ratio Data."""
date: Optional[dateType] = Field(
description="The date of the P/E ratio.", default=None
)
exchange: Optional[str] = Field(
default=None, description="The exchange where the data is from."
)
sector: str = Field(description="The name of the sector.")
pe: float = Field(description="The P/E ratio of the sector.")

View File

@@ -0,0 +1,17 @@
"""Sector Performance data model."""
from pydantic import Field
from openbb_provider.abstract.data import Data
from openbb_provider.abstract.query_params import QueryParams
class SectorPerformanceQueryParams(QueryParams):
"""Sector Performance Query."""
class SectorPerformanceData(Data):
"""Sector Performance Data."""
sector: str = Field(description="The name of the sector.")
change_percent: float = Field(description="The change in percent from open.")