Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

try to add fmp senate trading data api #6761

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
aae8d34
add snowflake integration video (#6339)
montezdesousa Apr 24, 2024
3970eb0
[HotFix] Fix broken URLs in docs page. (#6368)
deeleeramone May 7, 2024
a0f08ab
[Release] 4.2.0 (#6422)
montezdesousa May 15, 2024
b04216d
Release/4.2.1 (#6456)
hjoaquim May 22, 2024
fac368e
[Docs] Guides for Metadata and AnnotatedResult (#6457)
deeleeramone May 23, 2024
cd04f30
[Docs] Redirect contributing URL (#6460)
montezdesousa May 23, 2024
cdf0bef
[Release] 4.2.2 (#6480)
montezdesousa Jun 5, 2024
a114896
[Docs] Fix Broken URLs (#6494)
deeleeramone Jun 12, 2024
b7088a2
[Docs] Excel docs update (#6504)
montezdesousa Jun 14, 2024
2392a8a
Release/4.2.3 (#6517)
hjoaquim Jun 19, 2024
0202079
fix: openapi bug (#6525)
montezdesousa Jun 20, 2024
ad900c7
Release/openbb charting 2.1.3 (#6529)
hjoaquim Jun 21, 2024
c0d0989
fix: fix provider description (#6537)
montezdesousa Jun 24, 2024
fcce1ea
Move documentation to `openbb-docs` (#6539)
montezdesousa Jun 24, 2024
1070580
fixing local variable 'export' referenced before assignment (#6546)
hjoaquim Jun 26, 2024
57ad2d0
fix logging service (#6549)
deeleeramone Jun 28, 2024
5019b1c
[Hotfix] Bump versions (#6551)
hjoaquim Jun 28, 2024
6f7f30a
[Release] 4.3.0 (#6572)
montezdesousa Jul 9, 2024
d6931b3
bump version (#6576)
hjoaquim Jul 10, 2024
fe649ac
Release openbb-econometrics 1.4.0 (#6605)
piiq Aug 1, 2024
b27df0d
merge develop into main
deeleeramone Aug 8, 2024
5830f86
rebuild static
deeleeramone Aug 8, 2024
0eeff8b
merge artifact
deeleeramone Aug 8, 2024
a9aec9f
Merge pull request #6618 from OpenBB-finance/release/4.3.1
deeleeramone Aug 9, 2024
4bc5cd0
[Release] Release 4.3.2 (#6658)
deeleeramone Sep 9, 2024
8050db6
start version bumps and open draft PR
deeleeramone Oct 3, 2024
b6f202a
Merge remote-tracking branch 'origin/main' into release/4.3.3
deeleeramone Oct 3, 2024
711ac10
merge artifacts
deeleeramone Oct 3, 2024
f98350d
version bumps
deeleeramone Oct 4, 2024
a4727c7
too-many-positional-arguments
deeleeramone Oct 4, 2024
b985f62
core 1.3.4
deeleeramone Oct 4, 2024
738040a
Merge pull request #6737 from OpenBB-finance/release/4.3.3
deeleeramone Oct 8, 2024
52554eb
add fmp senante trading support
markqiu Oct 12, 2024
4937ec8
Merge branch 'main' into develop
markqiu Oct 12, 2024
dac2f92
add fmp senante trading support
markqiu Oct 12, 2024
d0d0917
register fmp senante trading support
markqiu Oct 12, 2024
9a26c06
Merge branch 'OpenBB-finance:develop' into develop
markqiu Oct 17, 2024
dcd9f1e
[Feature] Add Endpoint For The FMP Valuation Data
joshuaBri Nov 18, 2024
ffa71c2
[Feature] Add Endpoint For The FMP Government Trades Data and Form13f…
joshuaBri Nov 18, 2024
91b6b99
[Feature] Adds Router for Equity Estimates and Equity Ownership
joshuaBri Nov 18, 2024
47c772b
Merge remote-tracking branch 'joshuaBri/feature/valuation' into develop
markqiu Nov 19, 2024
b2ecf12
Merge branch 'develop' into develop
deeleeramone Nov 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
"""Advanced Dcf Standard Model."""

from typing import Optional

from openbb_core.provider.abstract.data import Data
from openbb_core.provider.abstract.query_params import QueryParams
from openbb_core.provider.utils.descriptions import (
DATA_DESCRIPTIONS,
QUERY_DESCRIPTIONS,
)
from pydantic import Field, field_validator


class AdvancedDcfQueryParams(QueryParams):
"""Advanced Dcf Query."""

symbol: Optional[str] = Field(
default=None, description=QUERY_DESCRIPTIONS.get("symbol", "")
)
debt: bool = Field(
default=False, description="Take the debt level into account or not."
)

@field_validator("symbol", mode="before", check_fields=False)
@classmethod
def to_upper(cls, v: str) -> str:
"""Convert field to uppercase."""
return v.upper()


class AdvancedDcfData(Data):
"""Advanced Dcf data."""

year: Optional[int] = Field(default=None, description="Year of the data.")
symbol: Optional[str] = Field(
default=None, description=DATA_DESCRIPTIONS.get("symbol", "")
)
revenue: Optional[float] = Field(
default=None, description="Annual revenue of the company, i.e., total sales."
)
revenue_percentage: Optional[float] = Field(
default=None,
description="Revenue percentage, typically relative to industry or overall financials.",
)
capital_expenditure: Optional[float] = Field(
default=None,
description="Capital expenditure, i.e., spending on fixed assets or asset expansion.",
)
capital_expenditure_percentage: Optional[float] = Field(
default=None,
description="Capital expenditure percentage, usually relative to revenue.",
)
price: Optional[float] = Field(default=None, description="Stock price.")
beta: Optional[float] = Field(
default=None,
description="Stock beta, indicating volatility relative to the market.",
)
diluted_shares_outstanding: Optional[float] = Field(
default=None,
description="Diluted shares outstanding, i.e., total shares after all potential issuances.",
)
cost_of_debt: Optional[float] = Field(
default=None,
description="Cost of debt, or the average interest rate on the company's borrowing.",
)
tax_rate: Optional[float] = Field(
default=None, description="Corporate income tax rate."
)
after_tax_cost_of_debt: Optional[float] = Field(
default=None,
description="After-tax cost of debt, actual debt cost after tax deductions.",
)
risk_free_rate: Optional[float] = Field(
default=None,
description="Risk-free rate, typically represented by government bond yields.",
)
market_risk_premium: Optional[float] = Field(
default=None,
description="Market risk premium, i.e., the difference between market returns and the risk-free rate.",
)
cost_of_equity: Optional[float] = Field(
default=None,
description="Cost of equity, or the expected return rate by investors.",
)
total_debt: Optional[float] = Field(
default=None, description="Total debt of the company."
)
total_equity: Optional[float] = Field(
default=None, description="Total equity or shareholder assets of the company."
)
total_capital: Optional[float] = Field(
default=None, description="Total capital, or the sum of debt and equity."
)
debt_weighting: Optional[float] = Field(
default=None, description="Debt weighting in capital structure, in percentage."
)
equity_weighting: Optional[float] = Field(
default=None,
description="Equity weighting in capital structure, in percentage.",
)
wacc: Optional[float] = Field(
default=None,
description="Weighted average cost of capital, or the company's overall financing cost.",
)
long_term_growth_rate: Optional[float] = Field(
default=None, description="Long-term growth rate forecast for the company."
)
terminal_value: Optional[float] = Field(
default=None,
description="Terminal value, an estimate of future cash flows in DCF models.",
)
present_terminal_value: Optional[float] = Field(
default=None,
description="Present terminal value, i.e., the discounted value of terminal value.",
)
enterprise_value: Optional[float] = Field(
default=None,
description="Enterprise value, or the total value of the company excluding cash and debt.",
)
net_debt: Optional[float] = Field(
default=None, description="Net debt, or total debt minus cash."
)
equity_value: Optional[float] = Field(
default=None,
description="Equity value of the company, or enterprise value minus net debt.",
)
equity_value_per_share: Optional[float] = Field(
default=None,
description="Equity value per share, calculated as equity value divided by shares outstanding.",
)
free_cash_flow_t1: Optional[float] = Field(
default=None, description="Projected free cash flow for the first year."
)
38 changes: 38 additions & 0 deletions openbb_platform/core/openbb_core/provider/standard_models/dcf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""Dcf Standard Model."""

from datetime import date as dateType
from typing import Optional

from openbb_core.provider.abstract.data import Data
from openbb_core.provider.abstract.query_params import QueryParams
from openbb_core.provider.utils.descriptions import (
DATA_DESCRIPTIONS,
QUERY_DESCRIPTIONS,
)
from pydantic import Field, field_validator


class DcfQueryParams(QueryParams):
"""Dcf Query."""

symbol: Optional[str] = Field(
default=None, description=QUERY_DESCRIPTIONS.get("symbol", "")
)

@field_validator("symbol", mode="before", check_fields=False)
@classmethod
def to_upper(cls, v: str) -> str:
"""Convert field to uppercase."""
return v.upper()


class DcfData(Data):
"""Dcf data."""

symbol: Optional[str] = Field(
default=None, description=DATA_DESCRIPTIONS.get("symbol", "")
)
date: dateType = Field(description=DATA_DESCRIPTIONS.get("date", ""))
dcf: Optional[float] = Field(
default=None, description="Discounted Cash Flow value."
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""Government Trades Standard Model."""

from datetime import date as dateType
from typing import Literal, Optional

from openbb_core.provider.abstract.data import Data
from openbb_core.provider.abstract.query_params import QueryParams
from openbb_core.provider.utils.descriptions import (
DATA_DESCRIPTIONS,
QUERY_DESCRIPTIONS,
)
from pydantic import Field, NonNegativeInt, field_validator


class GovernmentTradesQueryParams(QueryParams):
"""Government Trades Query."""

symbol: Optional[str] = Field(
default=None, description=QUERY_DESCRIPTIONS.get("symbol", "")
)
chamber: Literal["house", "senate", "all"] = Field(
description="Government Chamber."
)
limit: Optional[NonNegativeInt] = Field(
default=100, description=QUERY_DESCRIPTIONS.get("limit", "")
)

@field_validator("symbol", mode="before", check_fields=False)
@classmethod
def to_upper(cls, v: str) -> str:
"""Convert field to uppercase."""
return v.upper()


class GovernmentTradesData(Data):
"""Government Trades data."""

symbol: str = Field(description=DATA_DESCRIPTIONS.get("symbol", ""))
date: dateType = Field(description=DATA_DESCRIPTIONS.get("date", ""))
transaction_date: dateType = Field(default=None, description="Date of Transaction.")
representative: Optional[str] = Field(
default=None, description="Name of Representative."
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""House Disclosure Standard Model."""

from datetime import date as dateType
from typing import Optional

from pydantic import Field, field_validator

from openbb_core.provider.abstract.data import Data
from openbb_core.provider.abstract.query_params import QueryParams
from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS, DATA_DESCRIPTIONS


class HouseDisclosureQueryParams(QueryParams):
"""House Disclosure Query Parameters."""

symbol: str = Field(..., description=QUERY_DESCRIPTIONS.get("symbol", "The symbol of the company."))

@field_validator("symbol", mode="before", check_fields=False)
@classmethod
def to_upper(cls, v: str) -> str:
"""Convert field to uppercase."""
return v.upper()


class HouseDisclosureData(Data):
"""House Disclosure Data Model."""

disclosure_year: str = Field(description="The year of the disclosure.")
disclosure_date: dateType = Field(description="The date of the disclosure.")
transaction_date: dateType = Field(description="The date of the transaction.")
owner: str = Field(description="The owner of the transaction.")
symbol: str = Field(description=DATA_DESCRIPTIONS.get("symbol", "The symbol of the company."))
asset_description: str = Field(description="The description of the asset.")
type: str = Field(description="The type of transaction.")
amount: str = Field(description="The amount of the transaction.")
representative: str = Field(description="The representative associated with the transaction.")
district: str = Field(description="The district of the representative.")
link: str = Field(description="The link to the disclosure document.")
capital_gains_over_200_usd: Optional[bool] = Field(default=None, description="Whether the capital gains exceed 200 USD.")
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""House Disclosure RSS Feed Standard Model."""

from datetime import date as dateType
from typing import Optional

from pydantic import Field

from openbb_core.provider.abstract.data import Data
from openbb_core.provider.abstract.query_params import QueryParams



class HouseDisclosureRSSFeedQueryParams(QueryParams):
"""House Disclosure RSS Feed Query Parameters."""

page: Optional[int] = Field(None, description="The page number of the RSS feed.", ge=0)


class HouseDisclosureRSSFeedData(Data):
"""House Disclosure RSS Feed Data Model."""

disclosure_year: str = Field(description="The year of the disclosure.")
disclosure_date: dateType = Field(description="The date of the disclosure.")
transaction_date: dateType = Field(description="The date of the transaction.")
owner: str = Field(description="The owner of the transaction.")
ticker: str = Field(description="The ticker symbol of the asset.")
asset_description: str = Field(description="The description of the asset.")
type: str = Field(description="The type of transaction.")
amount: str = Field(description="The amount of the transaction.")
representative: str = Field(description="The representative associated with the transaction.")
district: str = Field(description="The district of the representative.")
link: str = Field(description="The link to the disclosure document.")
capital_gains_over_200_usd: Optional[str] = Field(None, description="Whether the capital gains exceed 200 USD.")
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
"""Rating Standard Model."""

from typing import Optional

from openbb_core.provider.abstract.data import Data
from openbb_core.provider.abstract.query_params import QueryParams
from openbb_core.provider.utils.descriptions import (
DATA_DESCRIPTIONS,
QUERY_DESCRIPTIONS,
)
from pydantic import Field, field_validator


class RatingQueryParams(QueryParams):
"""Rating Query."""

symbol: Optional[str] = Field(
default=None, description=QUERY_DESCRIPTIONS.get("symbol", "")
)

@field_validator("symbol", mode="before", check_fields=False)
@classmethod
def to_upper(cls, v: str) -> str:
"""Convert field to uppercase."""
return v.upper()


class RatingData(Data):
"""Rating data."""

symbol: Optional[str] = Field(
default=None, description=DATA_DESCRIPTIONS.get("symbol", "")
)
date: Optional[str] = Field(
default=None, description=DATA_DESCRIPTIONS.get("date", "")
)
rating: Optional[str] = Field(
default=None, description="Overall rating of the stock."
)
rating_score: Optional[int] = Field(
default=None, description="Overall rating score."
)
rating_recommendation: Optional[str] = Field(
default=None, description="Overall recommendation based on the rating."
)
rating_details_dcf_score: Optional[int] = Field(
default=None, description="Score based on DCF analysis."
)
rating_details_dcf_recommendation: Optional[str] = Field(
default=None, description="Recommendation based on DCF score."
)
rating_details_roe_score: Optional[int] = Field(
default=None, description="Score based on ROE analysis."
)
rating_details_roe_recommendation: Optional[str] = Field(
default=None, description="Recommendation based on ROE score."
)
rating_details_roa_score: Optional[int] = Field(
default=None, description="Score based on ROA analysis."
)
rating_details_roa_recommendation: Optional[str] = Field(
default=None, description="Recommendation based on ROA score."
)
rating_details_de_score: Optional[int] = Field(
default=None, description="Score based on DE (Debt to Equity) analysis."
)
rating_details_de_recommendation: Optional[str] = Field(
default=None, description="Recommendation based on DE score."
)
rating_details_pe_score: Optional[int] = Field(
default=None, description="Score based on PE (Price to Earnings) analysis."
)
rating_details_pe_recommendation: Optional[str] = Field(
default=None, description="Recommendation based on PE score."
)
rating_details_pb_score: Optional[int] = Field(
default=None, description="Score based on PB (Price to Book) analysis."
)
rating_details_pb_recommendation: Optional[str] = Field(
default=None, description="Recommendation based on PB score."
)
Loading