-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Refactor FinancialDatasetAPI integration and the memory cache #42
base: main
Are you sure you want to change the base?
Refactor FinancialDatasetAPI integration and the memory cache #42
Conversation
…tion classes for API setup.
Awesome |
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.
Nice work 👏🏼 Would probably just recommend some typing improvements
…to refactor/make-a-class-to-use-the-financial-api
…refactor/make-a-class-to-use-the-financial-api
Heads up for this PR! This will allow to easily integrate with other API data providers which is needed for the project. |
…refactor/make-a-class-to-use-the-financial-api
Hi team, thanks for your patience. I'm just back from the public holiday and have now reviewed and addressed all comments, as well as merged with the latest branch. I appreciate your attention to this PR and hope you can take some time to help me review it. |
Hi @virattt , any chance for me to test the API behavior without using the API key? 🫠 I’m not sure if the minimum top-up credit will be enough for my needs. |
since you introduced |
in |
in |
check everywhare: instead of |
using |
It seems the |
…alDatasetAPI for price data retrieval
…refactor/make-a-class-to-use-the-financial-api
This pull request focuses on refactoring the codebase to use a new
FinancialDatasetAPI
class for accessing financial data, replacing individual API functions. The changes involve using this new class, removing the old API functions, and implementing a base API client class for better structure and error handling.Refactoring to use
FinancialDatasetAPI
:src/agents/market_data.py
: Replaced individual API function calls with methods from the newFinancialDatasetAPI
class. Adjusted the import statements accordingly.src/agents/risk_manager.py
,src/agents/technicals.py
,src/backtester.py
: Updated to useFinancialDatasetAPI.prices_to_df
for converting price data to a DataFrame.Removal of old API functions:
src/tools/api.py
: Removed all old API functions such asget_financial_metrics
,search_line_items
,get_insider_trades
,get_market_cap
,get_prices
, andprices_to_df
.Implementation of base API client:
src/tools/api/base.py
: Made an abstract base classBaseAPIClient
to handle common API client functionality such as making requests and handling responses.src/tools/api/config.py
: Added configuration classesBaseAPIConfig
andFinancialDatasetAPIConfig
for managing API configuration.src/tools/api/financial_dataset.py
: Created theFinancialDatasetAPI
class extendingBaseAPIClient
, implementing methods for fetching financial metrics, insider trades, market cap, and price data.