-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[Feature]try to add fmp senate trading data api #6957
[Feature]try to add fmp senate trading data api #6957
Conversation
@mmistroni take a look please. |
sr - but beware i m not OBB :)
pls give me couple of days as i m busy w work :(
- also can you point me to your repo and branch so i can hv a look? - sorry for being lazy
…On Wed, Nov 27, 2024 at 8:18 AM 邱承 ***@***.***> wrote:
@mmistroni <https://github.com/mmistroni> take a look please.
—
Reply to this email directly, view it on GitHub
<#6957 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACPNCDUGPBMZZZ643GCGQK32CV54TAVCNFSM6AAAAABSINNVOGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMBTGIYDSNJTG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, this is great!
I'm asking for a few minor changes, and to please translate all code comments into English.
Thanks very much!
openbb_platform/core/openbb_core/provider/standard_models/government_trades.py
Show resolved
Hide resolved
openbb_platform/core/openbb_core/provider/standard_models/government_trades.py
Outdated
Show resolved
Hide resolved
openbb_platform/providers/fmp/openbb_fmp/models/government_trades.py
Outdated
Show resolved
Hide resolved
openbb_platform/providers/fmp/openbb_fmp/models/government_trades.py
Outdated
Show resolved
Hide resolved
openbb_platform/providers/fmp/openbb_fmp/models/government_trades.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deeleeramone Thanks for your correction, I alreadey improved my codes.
openbb_platform/providers/fmp/openbb_fmp/models/government_trades.py
Outdated
Show resolved
Hide resolved
We still need to clear all the empty strings and sort the output by date, doing so will reveal problems with the data model definitions. Symbol is not always going to be reported because it might not be a stock. It will need to be Here's what happens: return sorted(
[
FMPGovernmentTradesData(
**{k: v for k, v in d.items() if v and v != "--"}
)
for d in data
],
key=lambda x: x.date,
reverse=True,
) OpenBBError:
[Error] -> 1 validations error(s)
[Data Model] FMPGovernmentTradesData
[Arg] symbol -> input: {'date': '2024-11-21', 'transaction_date': '2024-11-04', 'owner': 'Joint', 'assetDescription': 'TX Trans Commn TPK 5% TPK Tran Due 08/15/42', 'type': 'Purchase', 'amount': '$1,001 - $15,000', 'representative': 'Suzan K. DelBene', 'link': 'https://disclosures-clerk.house.gov/public_disc/ptr-pdfs/2024/20026238.pdf'} -> Field required |
I apologize for not uploading the sorting part of the code earlier. I've tested it elsewhere and realized that duplicate fields and the possibility of 'symbol' being empty were causing standard class validation errors. |
openbb_platform/core/openbb_core/provider/standard_models/government_trades.py
Outdated
Show resolved
Hide resolved
…feature/government_trades
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your contribution, excellent work!
I made some small changes for linters and repo consistency. I also discovered that the last page in the RSS feeds is 30, so I capped the requests from happening beyond that point. FMP includes bad requests in their limits.
@joshuaBri, you need to do this before the PR can be merged, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you most kindly for your contribution!
try to add fmp senate trading data api
2. What?:
attempted to integrate the Senate API