-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/ssl-context
- Loading branch information
Showing
12 changed files
with
871 additions
and
1 deletion.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
openbb_platform/core/openbb_core/provider/standard_models/government_trades.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,47 @@ | ||
"""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( | ||
default="all", 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): | ||
"""Convert field to uppercase.""" | ||
return v.upper() if v else None | ||
|
||
|
||
class GovernmentTradesData(Data): | ||
"""Government Trades data.""" | ||
|
||
symbol: Optional[str] = Field( | ||
default=None, description=DATA_DESCRIPTIONS.get("symbol", "") | ||
) | ||
date: dateType = Field(description=DATA_DESCRIPTIONS.get("date", "")) | ||
transaction_date: Optional[dateType] = Field( | ||
default=None, description="Date of Transaction." | ||
) | ||
representative: Optional[str] = Field( | ||
default=None, description="Name of Representative." | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"info": { | ||
"title": "OpenBB Platform (Python)", | ||
"description": "Investment research for everyone, anywhere.", | ||
"core": "1.3.6", | ||
"core": "1.3.7", | ||
"extensions": { | ||
"openbb_core_extension": [ | ||
"[email protected]", | ||
|
@@ -10271,6 +10271,7 @@ | |
"dominica", | ||
"dominican_republic", | ||
"east_germany", | ||
"eastern_caribbean_currency_union", | ||
"ecuador", | ||
"egypt", | ||
"el_salvador", | ||
|
@@ -10526,6 +10527,7 @@ | |
"dominica", | ||
"dominican_republic", | ||
"east_germany", | ||
"eastern_caribbean_currency_union", | ||
"ecuador", | ||
"egypt", | ||
"el_salvador", | ||
|
@@ -28322,6 +28324,175 @@ | |
}, | ||
"model": "Form13FHR" | ||
}, | ||
"/equity/ownership/government_trades": { | ||
"deprecated": { | ||
"flag": null, | ||
"message": null | ||
}, | ||
"description": "Obtain government transaction data, including data from the Senate\nand the House of Representatives.", | ||
"examples": "\nExamples\n--------\n\n```python\nfrom openbb import obb\nobb.equity.ownership.government_trades(symbol='AAPL', chamber='all', provider='fmp')\nobb.equity.ownership.government_trades(limit=500, chamber='all', provider='fmp')\n```\n\n", | ||
"parameters": { | ||
"standard": [ | ||
{ | ||
"name": "symbol", | ||
"type": "Union[str, List[str]]", | ||
"description": "Symbol to get data for. Multiple items allowed for provider(s): fmp.", | ||
"default": null, | ||
"optional": true, | ||
"choices": null | ||
}, | ||
{ | ||
"name": "chamber", | ||
"type": "Literal['house', 'senate', 'all']", | ||
"description": "Government Chamber.", | ||
"default": "all", | ||
"optional": true, | ||
"choices": null | ||
}, | ||
{ | ||
"name": "limit", | ||
"type": "Annotated[int, Ge(ge=0)]", | ||
"description": "The number of data entries to return.", | ||
"default": 100, | ||
"optional": true, | ||
"choices": null | ||
} | ||
], | ||
"fmp": [] | ||
}, | ||
"returns": { | ||
"OBBject": [ | ||
{ | ||
"name": "results", | ||
"type": "List[GovernmentTrades]", | ||
"description": "Serializable results." | ||
}, | ||
{ | ||
"name": "provider", | ||
"type": "Optional[Literal['fmp']]", | ||
"description": "Provider name." | ||
}, | ||
{ | ||
"name": "warnings", | ||
"type": "Optional[List[Warning_]]", | ||
"description": "List of warnings." | ||
}, | ||
{ | ||
"name": "chart", | ||
"type": "Optional[Chart]", | ||
"description": "Chart object." | ||
}, | ||
{ | ||
"name": "extra", | ||
"type": "Dict[str, Any]", | ||
"description": "Extra info." | ||
} | ||
] | ||
}, | ||
"data": { | ||
"standard": [ | ||
{ | ||
"name": "symbol", | ||
"type": "str", | ||
"description": "Symbol representing the entity requested in the data.", | ||
"default": null, | ||
"optional": true, | ||
"choices": null | ||
}, | ||
{ | ||
"name": "date", | ||
"type": "Union[date, str]", | ||
"description": "The date of the data.", | ||
"default": "", | ||
"optional": false, | ||
"choices": null | ||
}, | ||
{ | ||
"name": "transaction_date", | ||
"type": "date", | ||
"description": "Date of Transaction.", | ||
"default": null, | ||
"optional": true, | ||
"choices": null | ||
}, | ||
{ | ||
"name": "representative", | ||
"type": "str", | ||
"description": "Name of Representative.", | ||
"default": null, | ||
"optional": true, | ||
"choices": null | ||
} | ||
], | ||
"fmp": [ | ||
{ | ||
"name": "chamber", | ||
"type": "Literal['house', 'senate']", | ||
"description": "Government Chamber - House or Senate.", | ||
"default": "", | ||
"optional": false, | ||
"choices": null | ||
}, | ||
{ | ||
"name": "owner", | ||
"type": "str", | ||
"description": "Ownership status (e.g., Spouse, Joint).", | ||
"default": null, | ||
"optional": true, | ||
"choices": null | ||
}, | ||
{ | ||
"name": "asset_type", | ||
"type": "str", | ||
"description": "Type of asset involved in the transaction.", | ||
"default": null, | ||
"optional": true, | ||
"choices": null | ||
}, | ||
{ | ||
"name": "asset_description", | ||
"type": "str", | ||
"description": "Description of the asset.", | ||
"default": null, | ||
"optional": true, | ||
"choices": null | ||
}, | ||
{ | ||
"name": "transaction_type", | ||
"type": "str", | ||
"description": "Type of transaction (e.g., Sale, Purchase).", | ||
"default": null, | ||
"optional": true, | ||
"choices": null | ||
}, | ||
{ | ||
"name": "amount", | ||
"type": "str", | ||
"description": "Transaction amount range.", | ||
"default": null, | ||
"optional": true, | ||
"choices": null | ||
}, | ||
{ | ||
"name": "comment", | ||
"type": "str", | ||
"description": "Additional comments on the transaction.", | ||
"default": null, | ||
"optional": true, | ||
"choices": null | ||
}, | ||
{ | ||
"name": "url", | ||
"type": "str", | ||
"description": "Link to the transaction document.", | ||
"default": null, | ||
"optional": true, | ||
"choices": null | ||
} | ||
] | ||
}, | ||
"model": "GovernmentTrades" | ||
}, | ||
"/equity/price/quote": { | ||
"deprecated": { | ||
"flag": null, | ||
|
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.