openbb-core 1.2.2__tar.gz → 1.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openbb_core-1.2.2 → openbb_core-1.2.4}/PKG-INFO +6 -7
- {openbb_core-1.2.2 → openbb_core-1.2.4}/README.md +2 -2
- openbb_core-1.2.4/openbb_core/api/app_loader.py +40 -0
- openbb_core-1.2.4/openbb_core/api/exception_handlers.py +69 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/api/rest_api.py +4 -37
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/command_runner.py +6 -82
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/logs/handlers/path_tracking_file_handler.py +1 -1
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/logs/logging_service.py +5 -8
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/api_settings.py +3 -3
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/credentials.py +32 -26
- openbb_core-1.2.4/openbb_core/app/model/defaults.py +46 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/provider_interface.py +2 -2
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/router.py +1 -1
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/service/user_service.py +0 -9
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/static/account.py +5 -7
- openbb_core-1.2.4/openbb_core/app/static/container.py +82 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/static/coverage.py +7 -10
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/static/package_builder.py +22 -19
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/static/utils/decorators.py +28 -27
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/registry.py +1 -1
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/registry_map.py +7 -9
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/balance_of_payments.py +79 -0
- openbb_core-1.2.4/openbb_core/provider/standard_models/balance_sheet_growth.py +47 -0
- openbb_core-1.2.4/openbb_core/provider/standard_models/cash_flow_growth.py +47 -0
- openbb_core-1.2.4/openbb_core/provider/standard_models/central_bank_holdings.py +30 -0
- openbb_core-1.2.4/openbb_core/provider/standard_models/compare_company_facts.py +56 -0
- openbb_core-1.2.4/openbb_core/provider/standard_models/consumer_price_index.py +56 -0
- openbb_core-1.2.4/openbb_core/provider/standard_models/forward_ebitda_estimates.py +75 -0
- openbb_core-1.2.4/openbb_core/provider/standard_models/house_price_index.py +55 -0
- openbb_core-1.2.4/openbb_core/provider/standard_models/immediate_interest_rate.py +45 -0
- openbb_core-1.2.4/openbb_core/provider/standard_models/income_statement_growth.py +47 -0
- openbb_core-1.2.4/openbb_core/provider/standard_models/retail_prices.py +56 -0
- openbb_core-1.2.4/openbb_core/provider/standard_models/share_price_index.py +49 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/unemployment.py +15 -5
- openbb_core-1.2.4/openbb_core/provider/standard_models/yield_curve.py +37 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/utils/errors.py +3 -1
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/utils/helpers.py +1 -1
- {openbb_core-1.2.2 → openbb_core-1.2.4}/pyproject.toml +4 -11
- openbb_core-1.2.2/openbb_core/api/app_loader.py +0 -36
- openbb_core-1.2.2/openbb_core/app/model/defaults.py +0 -19
- openbb_core-1.2.2/openbb_core/app/static/container.py +0 -41
- openbb_core-1.2.2/openbb_core/provider/standard_models/balance_sheet_growth.py +0 -137
- openbb_core-1.2.2/openbb_core/provider/standard_models/cash_flow_growth.py +0 -124
- openbb_core-1.2.2/openbb_core/provider/standard_models/cpi.py +0 -128
- openbb_core-1.2.2/openbb_core/provider/standard_models/etf_holdings_performance.py +0 -14
- openbb_core-1.2.2/openbb_core/provider/standard_models/income_statement_growth.py +0 -123
- openbb_core-1.2.2/openbb_core/provider/standard_models/upcoming_release_days.py +0 -23
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/api/auth/user.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/api/dependency/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/api/dependency/coverage.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/api/dependency/system.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/api/router/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/api/router/commands.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/api/router/coverage.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/api/router/helpers/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/api/router/helpers/coverage_helpers.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/api/router/system.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/api/router/user.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/constants.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/deprecation.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/extension_loader.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/logs/formatters/formatter_with_exceptions.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/logs/handlers/posthog_handler.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/logs/handlers_manager.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/logs/models/logging_settings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/logs/utils/expired_files.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/logs/utils/utils.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/abstract/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/abstract/error.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/abstract/results.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/abstract/singleton.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/abstract/tagged.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/abstract/warning.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/charts/chart.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/charts/charting_settings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/command_context.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/example.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/extension.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/field.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/hub/hub_session.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/hub/hub_user_settings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/metadata.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/obbject.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/preferences.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/profile.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/python_settings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/results/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/results/empty.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/system_settings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/model/user_settings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/query.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/service/auth_service.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/service/hub_service.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/service/system_service.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/static/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/static/app_factory.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/static/reference_loader.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/static/utils/console.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/static/utils/filters.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/static/utils/linters.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/utils.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/version.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/env.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/abstract/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/abstract/annotated_result.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/abstract/data.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/abstract/fetcher.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/abstract/provider.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/abstract/query_params.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/py.typed +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/query_executor.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/ameribor_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/analyst_estimates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/analyst_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/available_indicators.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/available_indices.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/balance_sheet.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/bond_prices.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/bond_reference.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/bond_trades.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/calendar_dividend.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/calendar_earnings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/calendar_ipo.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/calendar_splits.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/cash_flow.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/cik_map.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/company_filings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/company_news.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/company_overview.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/compare_groups.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/composite_leading_indicator.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/cot.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/cot_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/country_profile.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/cp.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/crypto_historical.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/crypto_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/currency_historical.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/currency_pairs.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/currency_reference_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/currency_snapshots.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/discovery_filings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/dwpcr_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/earnings_call_transcript.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/ecb_interest_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/economic_calendar.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/economic_indicators.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/equity_ftd.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/equity_historical.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/equity_info.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/equity_nbbo.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/equity_ownership.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/equity_peers.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/equity_performance.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/equity_quote.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/equity_screener.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/equity_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/equity_short_interest.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/equity_valuation_multiples.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/esg_risk_rating.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/esg_score.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/esg_sector.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/estr_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/etf_countries.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/etf_equity_exposure.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/etf_historical.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/etf_historical_nav.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/etf_holdings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/etf_holdings_date.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/etf_info.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/etf_performance.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/etf_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/etf_sectors.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/eu_yield_curve.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/executive_compensation.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/fed_projections.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/fed_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/ffrmc.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/financial_attributes.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/financial_ratios.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/form_13FHR.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/forward_eps_estimates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/forward_pe_estimates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/forward_sales_estimates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/fred_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/fred_series.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/futures_curve.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/futures_historical.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/gdp_forecast.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/gdp_nominal.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/gdp_real.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/historical_attributes.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/historical_dividends.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/historical_employees.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/historical_eps.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/historical_splits.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/hqm.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/ice_bofa.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/income_statement.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/index_constituents.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/index_historical.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/index_info.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/index_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/index_sectors.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/index_snapshots.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/industry_pe.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/insider_trading.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/institutional_ownership.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/iorb_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/key_executives.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/key_metrics.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/latest_attributes.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/lbma_fixing.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/long_term_interest_rate.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/market_indices.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/market_movers.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/market_snapshots.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/money_measures.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/moody.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/options_chains.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/options_unusual.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/otc_aggregate.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/price_target.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/price_target_consensus.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/recent_performance.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/reported_financials.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/revenue_business_line.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/revenue_geographic.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/risk_premium.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/search_attributes.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/search_financial_attributes.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/sector_pe.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/sector_performance.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/share_statistics.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/short_term_interest_rate.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/short_volume.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/sofr_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/sonia_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/sp500_multiples.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/spot.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/symbol_map.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/tbffr.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/tmc.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/top_retail.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/trailing_dividend_yield.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/treasury_auctions.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/treasury_prices.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/treasury_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/us_yield_curve.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/standard_models/world_news.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/utils/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/utils/client.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/provider/utils/descriptions.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/py.typed +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: openbb-core
|
|
3
|
-
Version: 1.2.
|
|
4
|
-
Summary: OpenBB package with core functionality
|
|
3
|
+
Version: 1.2.4
|
|
4
|
+
Summary: OpenBB package with core functionality.
|
|
5
5
|
License: AGPL-3.0-only
|
|
6
6
|
Author: OpenBB Team
|
|
7
7
|
Author-email: hello@openbb.co
|
|
@@ -14,7 +14,6 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Requires-Dist: aiohttp (>=3.9.5,<4.0.0)
|
|
17
|
-
Requires-Dist: anyio (>=3.7.0,<4.0.0)
|
|
18
17
|
Requires-Dist: fastapi (>=0.111.0,<0.112.0)
|
|
19
18
|
Requires-Dist: html5lib (>=1.1,<2.0)
|
|
20
19
|
Requires-Dist: importlib-metadata (>=6.8.0,<7.0.0)
|
|
@@ -24,8 +23,8 @@ Requires-Dist: pydantic (>=2.5.1,<3.0.0)
|
|
|
24
23
|
Requires-Dist: pyjwt (>=2.8.0,<3.0.0)
|
|
25
24
|
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
|
|
26
25
|
Requires-Dist: python-multipart (>=0.0.7,<0.0.8)
|
|
27
|
-
Requires-Dist: requests (>=2.
|
|
28
|
-
Requires-Dist: ruff (>=0.1.6
|
|
26
|
+
Requires-Dist: requests (>=2.32.1,<3.0.0)
|
|
27
|
+
Requires-Dist: ruff (>=0.1.6)
|
|
29
28
|
Requires-Dist: uuid7 (>=0.1.0,<0.2.0)
|
|
30
29
|
Requires-Dist: uvicorn (>=0.24,<0.25)
|
|
31
30
|
Requires-Dist: websockets (>=12.0,<13.0)
|
|
@@ -75,7 +74,7 @@ We welcome contributions! If you're looking to contribute, please:
|
|
|
75
74
|
- Ensure your code does not negatively impact performance.
|
|
76
75
|
- Test your contributions thoroughly.
|
|
77
76
|
|
|
78
|
-
Please refer to our [Contributing Guidelines](https://docs.openbb.co/platform/
|
|
77
|
+
Please refer to our [Contributing Guidelines](https://docs.openbb.co/platform/developer_guide/contributing).
|
|
79
78
|
|
|
80
79
|
### Collaboration
|
|
81
80
|
|
|
@@ -83,7 +82,7 @@ Engage with the development team and the community. Be open to feedback and coll
|
|
|
83
82
|
|
|
84
83
|
### Support
|
|
85
84
|
|
|
86
|
-
For support, questions, or more information, please visit [OpenBB Platform Documentation](https://docs.openbb.co/platform
|
|
85
|
+
For support, questions, or more information, please visit [OpenBB Platform Documentation](https://docs.openbb.co/platform).
|
|
87
86
|
|
|
88
87
|
### License
|
|
89
88
|
|
|
@@ -42,7 +42,7 @@ We welcome contributions! If you're looking to contribute, please:
|
|
|
42
42
|
- Ensure your code does not negatively impact performance.
|
|
43
43
|
- Test your contributions thoroughly.
|
|
44
44
|
|
|
45
|
-
Please refer to our [Contributing Guidelines](https://docs.openbb.co/platform/
|
|
45
|
+
Please refer to our [Contributing Guidelines](https://docs.openbb.co/platform/developer_guide/contributing).
|
|
46
46
|
|
|
47
47
|
### Collaboration
|
|
48
48
|
|
|
@@ -50,7 +50,7 @@ Engage with the development team and the community. Be open to feedback and coll
|
|
|
50
50
|
|
|
51
51
|
### Support
|
|
52
52
|
|
|
53
|
-
For support, questions, or more information, please visit [OpenBB Platform Documentation](https://docs.openbb.co/platform
|
|
53
|
+
For support, questions, or more information, please visit [OpenBB Platform Documentation](https://docs.openbb.co/platform).
|
|
54
54
|
|
|
55
55
|
### License
|
|
56
56
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""App loader module."""
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
|
|
5
|
+
from fastapi import APIRouter, FastAPI
|
|
6
|
+
from openbb_core.api.exception_handlers import ExceptionHandlers
|
|
7
|
+
from openbb_core.app.model.abstract.error import OpenBBError
|
|
8
|
+
from openbb_core.app.router import RouterLoader
|
|
9
|
+
from pydantic import ValidationError
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AppLoader:
|
|
13
|
+
"""App loader."""
|
|
14
|
+
|
|
15
|
+
@staticmethod
|
|
16
|
+
def add_routers(app: FastAPI, routers: List[Optional[APIRouter]], prefix: str):
|
|
17
|
+
"""Add routers."""
|
|
18
|
+
for router in routers:
|
|
19
|
+
if router:
|
|
20
|
+
app.include_router(router=router, prefix=prefix)
|
|
21
|
+
|
|
22
|
+
@staticmethod
|
|
23
|
+
def add_openapi_tags(app: FastAPI):
|
|
24
|
+
"""Add openapi tags."""
|
|
25
|
+
main_router = RouterLoader.from_extensions()
|
|
26
|
+
# Add tag data for each router in the main router
|
|
27
|
+
app.openapi_tags = [
|
|
28
|
+
{
|
|
29
|
+
"name": r,
|
|
30
|
+
"description": main_router.get_attr(r, "description"),
|
|
31
|
+
}
|
|
32
|
+
for r in main_router.routers
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
@staticmethod
|
|
36
|
+
def add_exception_handlers(app: FastAPI):
|
|
37
|
+
"""Add exception handlers."""
|
|
38
|
+
app.exception_handlers[Exception] = ExceptionHandlers.exception
|
|
39
|
+
app.exception_handlers[ValidationError] = ExceptionHandlers.validation
|
|
40
|
+
app.exception_handlers[OpenBBError] = ExceptionHandlers.openbb
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"""Exception handlers module."""
|
|
2
|
+
|
|
3
|
+
import logging
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from fastapi import Request
|
|
7
|
+
from fastapi.responses import JSONResponse
|
|
8
|
+
from openbb_core.app.model.abstract.error import OpenBBError
|
|
9
|
+
from openbb_core.env import Env
|
|
10
|
+
from pydantic import ValidationError
|
|
11
|
+
|
|
12
|
+
logger = logging.getLogger("uvicorn.error")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ExceptionHandlers:
|
|
16
|
+
"""Exception handlers."""
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
async def _handle(exception: Exception, status_code: int, detail: Any):
|
|
20
|
+
"""Exception handler."""
|
|
21
|
+
if Env().DEBUG_MODE:
|
|
22
|
+
raise exception
|
|
23
|
+
logger.error(exception)
|
|
24
|
+
return JSONResponse(
|
|
25
|
+
status_code=status_code,
|
|
26
|
+
content={
|
|
27
|
+
"detail": detail,
|
|
28
|
+
},
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
@staticmethod
|
|
32
|
+
async def exception(_: Request, error: Exception) -> JSONResponse:
|
|
33
|
+
"""Exception handler for Base Exception."""
|
|
34
|
+
return await ExceptionHandlers._handle(
|
|
35
|
+
exception=error,
|
|
36
|
+
status_code=500,
|
|
37
|
+
detail="Unexpected error.",
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
@staticmethod
|
|
41
|
+
async def validation(request: Request, error: ValidationError):
|
|
42
|
+
"""Exception handler for ValidationError."""
|
|
43
|
+
# Some validation is performed at Fetcher level.
|
|
44
|
+
# So we check if the validation error comes from a QueryParams class.
|
|
45
|
+
# And that it is in the request query params.
|
|
46
|
+
# If yes, we update the error location with query.
|
|
47
|
+
# If not, we handle it as a base Exception error.
|
|
48
|
+
query_params = dict(request.query_params)
|
|
49
|
+
errors = error.errors(include_url=False)
|
|
50
|
+
all_in_query = all(
|
|
51
|
+
loc in query_params for err in errors for loc in err.get("loc", ())
|
|
52
|
+
)
|
|
53
|
+
if "QueryParams" in error.title and all_in_query:
|
|
54
|
+
detail = [{**err, "loc": ("query",) + err.get("loc", ())} for err in errors]
|
|
55
|
+
return await ExceptionHandlers._handle(
|
|
56
|
+
exception=error,
|
|
57
|
+
status_code=422,
|
|
58
|
+
detail=detail,
|
|
59
|
+
)
|
|
60
|
+
return await ExceptionHandlers.exception(request, error)
|
|
61
|
+
|
|
62
|
+
@staticmethod
|
|
63
|
+
async def openbb(_: Request, error: OpenBBError):
|
|
64
|
+
"""Exception handler for OpenBBError."""
|
|
65
|
+
return await ExceptionHandlers._handle(
|
|
66
|
+
exception=error,
|
|
67
|
+
status_code=400,
|
|
68
|
+
detail=str(error.original),
|
|
69
|
+
)
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
import logging
|
|
4
4
|
from contextlib import asynccontextmanager
|
|
5
5
|
|
|
6
|
-
from fastapi import FastAPI
|
|
6
|
+
from fastapi import FastAPI
|
|
7
7
|
from fastapi.middleware.cors import CORSMiddleware
|
|
8
|
-
from fastapi.responses import JSONResponse
|
|
9
8
|
from openbb_core.api.app_loader import AppLoader
|
|
10
9
|
from openbb_core.api.router.commands import router as router_commands
|
|
11
10
|
from openbb_core.api.router.coverage import router as router_coverage
|
|
12
11
|
from openbb_core.api.router.system import router as router_system
|
|
13
|
-
from openbb_core.app.model.abstract.error import OpenBBError
|
|
14
12
|
from openbb_core.app.service.auth_service import AuthService
|
|
15
13
|
from openbb_core.app.service.system_service import SystemService
|
|
16
14
|
from openbb_core.env import Env
|
|
@@ -73,8 +71,7 @@ app.add_middleware(
|
|
|
73
71
|
allow_methods=system.api_settings.cors.allow_methods,
|
|
74
72
|
allow_headers=system.api_settings.cors.allow_headers,
|
|
75
73
|
)
|
|
76
|
-
|
|
77
|
-
AppLoader.from_routers(
|
|
74
|
+
AppLoader.add_routers(
|
|
78
75
|
app=app,
|
|
79
76
|
routers=(
|
|
80
77
|
[AuthService().router, router_system, router_coverage, router_commands]
|
|
@@ -83,38 +80,8 @@ AppLoader.from_routers(
|
|
|
83
80
|
),
|
|
84
81
|
prefix=system.api_settings.prefix,
|
|
85
82
|
)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
@app.exception_handler(Exception)
|
|
89
|
-
async def api_exception_handler(_: Request, exc: Exception):
|
|
90
|
-
"""Exception handler for all other exceptions."""
|
|
91
|
-
if Env().DEBUG_MODE:
|
|
92
|
-
raise exc
|
|
93
|
-
logger.error(exc)
|
|
94
|
-
return JSONResponse(
|
|
95
|
-
status_code=404,
|
|
96
|
-
content={
|
|
97
|
-
"detail": str(exc),
|
|
98
|
-
"error_kind": exc.__class__.__name__,
|
|
99
|
-
},
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
@app.exception_handler(OpenBBError)
|
|
104
|
-
async def openbb_exception_handler(_: Request, exc: OpenBBError):
|
|
105
|
-
"""Exception handler for OpenBB errors."""
|
|
106
|
-
if Env().DEBUG_MODE:
|
|
107
|
-
raise exc
|
|
108
|
-
logger.error(exc.original)
|
|
109
|
-
openbb_error = exc.original
|
|
110
|
-
status_code = 400 if "No results" in str(openbb_error) else 500
|
|
111
|
-
return JSONResponse(
|
|
112
|
-
status_code=status_code,
|
|
113
|
-
content={
|
|
114
|
-
"detail": str(openbb_error),
|
|
115
|
-
"error_kind": openbb_error.__class__.__name__,
|
|
116
|
-
},
|
|
117
|
-
)
|
|
83
|
+
AppLoader.add_openapi_tags(app)
|
|
84
|
+
AppLoader.add_exception_handlers(app)
|
|
118
85
|
|
|
119
86
|
|
|
120
87
|
if __name__ == "__main__":
|
|
@@ -21,7 +21,7 @@ from openbb_core.app.model.metadata import Metadata
|
|
|
21
21
|
from openbb_core.app.model.obbject import OBBject
|
|
22
22
|
from openbb_core.app.model.system_settings import SystemSettings
|
|
23
23
|
from openbb_core.app.model.user_settings import UserSettings
|
|
24
|
-
from openbb_core.app.provider_interface import ExtraParams
|
|
24
|
+
from openbb_core.app.provider_interface import ExtraParams
|
|
25
25
|
from openbb_core.app.router import CommandMap
|
|
26
26
|
from openbb_core.app.service.system_service import SystemService
|
|
27
27
|
from openbb_core.app.service.user_service import UserService
|
|
@@ -79,7 +79,7 @@ class ParametersBuilder:
|
|
|
79
79
|
def merge_args_and_kwargs(
|
|
80
80
|
cls,
|
|
81
81
|
func: Callable,
|
|
82
|
-
args: Tuple[Any],
|
|
82
|
+
args: Tuple[Any, ...],
|
|
83
83
|
kwargs: Dict[str, Any],
|
|
84
84
|
) -> Dict[str, Any]:
|
|
85
85
|
"""Merge args and kwargs into a single dict."""
|
|
@@ -117,68 +117,6 @@ class ParametersBuilder:
|
|
|
117
117
|
|
|
118
118
|
return kwargs
|
|
119
119
|
|
|
120
|
-
@staticmethod
|
|
121
|
-
def update_provider_choices(
|
|
122
|
-
func: Callable,
|
|
123
|
-
command_coverage: Dict[str, List[str]],
|
|
124
|
-
route: str,
|
|
125
|
-
kwargs: Dict[str, Any],
|
|
126
|
-
route_default: Optional[Dict[str, Optional[str]]],
|
|
127
|
-
) -> Dict[str, Any]:
|
|
128
|
-
"""Update the provider choices with the available providers and set default provider."""
|
|
129
|
-
|
|
130
|
-
def _needs_provider(func: Callable) -> bool:
|
|
131
|
-
"""Check if the function needs a provider."""
|
|
132
|
-
parameters = signature(func).parameters.keys()
|
|
133
|
-
return "provider_choices" in parameters
|
|
134
|
-
|
|
135
|
-
def _has_provider(kwargs: Dict[str, Any]) -> bool:
|
|
136
|
-
"""Check if the kwargs already have a provider."""
|
|
137
|
-
provider_choices = kwargs.get("provider_choices", None)
|
|
138
|
-
|
|
139
|
-
if isinstance(provider_choices, dict): # when in python
|
|
140
|
-
return provider_choices.get("provider", None) is not None
|
|
141
|
-
if isinstance(provider_choices, object): # when running as fastapi
|
|
142
|
-
return getattr(provider_choices, "provider", None) is not None
|
|
143
|
-
return False
|
|
144
|
-
|
|
145
|
-
def _get_first_provider() -> Optional[str]:
|
|
146
|
-
"""Get the first available provider."""
|
|
147
|
-
available_providers = ProviderInterface().available_providers
|
|
148
|
-
return available_providers[0] if available_providers else None
|
|
149
|
-
|
|
150
|
-
def _get_default_provider(
|
|
151
|
-
command_coverage: Dict[str, List[str]],
|
|
152
|
-
route_default: Optional[Dict[str, Optional[str]]],
|
|
153
|
-
) -> Optional[str]:
|
|
154
|
-
"""
|
|
155
|
-
Get the default provider for the given route.
|
|
156
|
-
|
|
157
|
-
Either pick it from the user defaults or from the command coverage.
|
|
158
|
-
"""
|
|
159
|
-
cmd_cov_given_route = command_coverage.get(route, None)
|
|
160
|
-
command_cov_provider = (
|
|
161
|
-
cmd_cov_given_route[0] if cmd_cov_given_route else None
|
|
162
|
-
)
|
|
163
|
-
|
|
164
|
-
if route_default:
|
|
165
|
-
return route_default.get("provider", None) or command_cov_provider # type: ignore
|
|
166
|
-
|
|
167
|
-
return command_cov_provider
|
|
168
|
-
|
|
169
|
-
if not _has_provider(kwargs) and _needs_provider(func):
|
|
170
|
-
provider = (
|
|
171
|
-
_get_default_provider(
|
|
172
|
-
command_coverage,
|
|
173
|
-
route_default,
|
|
174
|
-
)
|
|
175
|
-
if route in command_coverage
|
|
176
|
-
else _get_first_provider()
|
|
177
|
-
)
|
|
178
|
-
kwargs["provider_choices"] = {"provider": provider}
|
|
179
|
-
|
|
180
|
-
return kwargs
|
|
181
|
-
|
|
182
120
|
@staticmethod
|
|
183
121
|
def _warn_kwargs(
|
|
184
122
|
extra_params: Dict[str, Any],
|
|
@@ -229,7 +167,8 @@ class ParametersBuilder:
|
|
|
229
167
|
}
|
|
230
168
|
# We allow extra fields to return with model with 'cc: CommandContext'
|
|
231
169
|
config = ConfigDict(extra="allow", arbitrary_types_allowed=True)
|
|
232
|
-
|
|
170
|
+
# pylint: disable=C0103
|
|
171
|
+
ValidationModel = create_model(func.__name__, __config__=config, **fields) # type: ignore
|
|
233
172
|
# Validate and coerce
|
|
234
173
|
model = ValidationModel(**kwargs)
|
|
235
174
|
ParametersBuilder._warn_kwargs(
|
|
@@ -245,14 +184,12 @@ class ParametersBuilder:
|
|
|
245
184
|
args: Tuple[Any, ...],
|
|
246
185
|
execution_context: ExecutionContext,
|
|
247
186
|
func: Callable,
|
|
248
|
-
route: str,
|
|
249
187
|
kwargs: Dict[str, Any],
|
|
250
188
|
) -> Dict[str, Any]:
|
|
251
189
|
"""Build the parameters for a function."""
|
|
252
190
|
func = cls.get_polished_func(func=func)
|
|
253
191
|
system_settings = execution_context.system_settings
|
|
254
192
|
user_settings = execution_context.user_settings
|
|
255
|
-
command_map = execution_context.command_map
|
|
256
193
|
|
|
257
194
|
kwargs = cls.merge_args_and_kwargs(
|
|
258
195
|
func=func,
|
|
@@ -265,13 +202,6 @@ class ParametersBuilder:
|
|
|
265
202
|
system_settings=system_settings,
|
|
266
203
|
user_settings=user_settings,
|
|
267
204
|
)
|
|
268
|
-
kwargs = cls.update_provider_choices(
|
|
269
|
-
func=func,
|
|
270
|
-
command_coverage=command_map.command_coverage,
|
|
271
|
-
route=route,
|
|
272
|
-
kwargs=kwargs,
|
|
273
|
-
route_default=user_settings.defaults.routes.get(route, None),
|
|
274
|
-
)
|
|
275
205
|
kwargs = cls.validate_kwargs(
|
|
276
206
|
func=func,
|
|
277
207
|
kwargs=kwargs,
|
|
@@ -292,9 +222,7 @@ class StaticCommandRunner:
|
|
|
292
222
|
) -> OBBject:
|
|
293
223
|
"""Run a command and return the output."""
|
|
294
224
|
obbject = await maybe_coroutine(func, **kwargs)
|
|
295
|
-
obbject.provider = getattr(
|
|
296
|
-
kwargs.get("provider_choices", None), "provider", None
|
|
297
|
-
)
|
|
225
|
+
obbject.provider = getattr(kwargs.get("provider_choices"), "provider", None)
|
|
298
226
|
return obbject
|
|
299
227
|
|
|
300
228
|
@classmethod
|
|
@@ -331,7 +259,7 @@ class StaticCommandRunner:
|
|
|
331
259
|
|
|
332
260
|
if chart_params:
|
|
333
261
|
kwargs.update(chart_params)
|
|
334
|
-
obbject.charting.show(render=False, **kwargs)
|
|
262
|
+
obbject.charting.show(render=False, **kwargs) # type: ignore[attr-defined]
|
|
335
263
|
except Exception as e: # pylint: disable=broad-exception-caught
|
|
336
264
|
if Env().DEBUG_MODE:
|
|
337
265
|
raise OpenBBError(e) from e
|
|
@@ -365,7 +293,6 @@ class StaticCommandRunner:
|
|
|
365
293
|
args=args,
|
|
366
294
|
execution_context=execution_context,
|
|
367
295
|
func=func,
|
|
368
|
-
route=route,
|
|
369
296
|
kwargs=kwargs,
|
|
370
297
|
)
|
|
371
298
|
|
|
@@ -386,9 +313,6 @@ class StaticCommandRunner:
|
|
|
386
313
|
obbject._standard_params = kwargs.get("standard_params", None)
|
|
387
314
|
if chart and obbject.results:
|
|
388
315
|
cls._chart(obbject, **kwargs)
|
|
389
|
-
|
|
390
|
-
except Exception as e:
|
|
391
|
-
raise OpenBBError(e) from e
|
|
392
316
|
finally:
|
|
393
317
|
ls = LoggingService(system_settings, user_settings)
|
|
394
318
|
ls.log(
|
{openbb_core-1.2.2 → openbb_core-1.2.4}/openbb_core/app/logs/handlers/path_tracking_file_handler.py
RENAMED
|
@@ -5,7 +5,7 @@ from copy import deepcopy
|
|
|
5
5
|
from logging.handlers import TimedRotatingFileHandler
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
|
-
# IMPORTATION
|
|
8
|
+
# IMPORTATION THIRD PARTY
|
|
9
9
|
# IMPORTATION INTERNAL
|
|
10
10
|
from openbb_core.app.logs.models.logging_settings import LoggingSettings
|
|
11
11
|
from openbb_core.app.logs.utils.expired_files import (
|
|
@@ -4,14 +4,13 @@ import json
|
|
|
4
4
|
import logging
|
|
5
5
|
from enum import Enum
|
|
6
6
|
from types import TracebackType
|
|
7
|
-
from typing import Any, Callable, Dict, Optional, Tuple, Type, Union
|
|
7
|
+
from typing import Any, Callable, Dict, Optional, Tuple, Type, Union
|
|
8
8
|
|
|
9
9
|
from openbb_core.app.logs.formatters.formatter_with_exceptions import (
|
|
10
10
|
FormatterWithExceptions,
|
|
11
11
|
)
|
|
12
12
|
from openbb_core.app.logs.handlers_manager import HandlersManager
|
|
13
13
|
from openbb_core.app.logs.models.logging_settings import LoggingSettings
|
|
14
|
-
from openbb_core.app.model.abstract.error import OpenBBError
|
|
15
14
|
from openbb_core.app.model.abstract.singleton import SingletonMeta
|
|
16
15
|
from openbb_core.app.model.system_settings import SystemSettings
|
|
17
16
|
from openbb_core.app.model.user_settings import UserSettings
|
|
@@ -224,24 +223,22 @@ class LoggingService(metaclass=SingletonMeta):
|
|
|
224
223
|
kwargs = {k: str(v)[:100] for k, v in kwargs.items()}
|
|
225
224
|
|
|
226
225
|
# Get execution info
|
|
227
|
-
|
|
228
|
-
Optional[OpenBBError], exec_info[1] if exec_info else None
|
|
229
|
-
)
|
|
226
|
+
error = str(exec_info[1]) if exec_info and len(exec_info) > 1 else None
|
|
230
227
|
|
|
231
228
|
# Construct message
|
|
232
|
-
message_label = "ERROR" if
|
|
229
|
+
message_label = "ERROR" if error else "CMD"
|
|
233
230
|
log_message = json.dumps(
|
|
234
231
|
{
|
|
235
232
|
"route": route,
|
|
236
233
|
"input": kwargs,
|
|
237
|
-
"error":
|
|
234
|
+
"error": error,
|
|
238
235
|
"custom_headers": custom_headers,
|
|
239
236
|
},
|
|
240
237
|
default=to_jsonable_python,
|
|
241
238
|
)
|
|
242
239
|
log_message = f"{message_label}: {log_message}"
|
|
243
240
|
|
|
244
|
-
log_level = logger.error if
|
|
241
|
+
log_level = logger.error if error else logger.info
|
|
245
242
|
log_level(
|
|
246
243
|
log_message,
|
|
247
244
|
extra={"func_name_override": func.__name__},
|
|
@@ -20,7 +20,7 @@ class Servers(BaseModel):
|
|
|
20
20
|
|
|
21
21
|
model_config = ConfigDict(frozen=True)
|
|
22
22
|
|
|
23
|
-
url: str = "
|
|
23
|
+
url: str = ""
|
|
24
24
|
description: str = "Local OpenBB development server"
|
|
25
25
|
|
|
26
26
|
|
|
@@ -31,12 +31,12 @@ class APISettings(BaseModel):
|
|
|
31
31
|
|
|
32
32
|
version: str = "1"
|
|
33
33
|
title: str = "OpenBB Platform API"
|
|
34
|
-
description: str = "
|
|
34
|
+
description: str = "Investment research for everyone, anywhere."
|
|
35
35
|
terms_of_service: str = "http://example.com/terms/"
|
|
36
36
|
contact_name: str = "OpenBB Team"
|
|
37
37
|
contact_url: str = "https://openbb.co"
|
|
38
38
|
contact_email: str = "hello@openbb.co"
|
|
39
|
-
license_name: str = "
|
|
39
|
+
license_name: str = "AGPLv3"
|
|
40
40
|
license_url: str = (
|
|
41
41
|
"https://github.com/OpenBB-finance/OpenBBTerminal/blob/develop/LICENSE"
|
|
42
42
|
)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import traceback
|
|
4
4
|
import warnings
|
|
5
|
-
from typing import Dict,
|
|
5
|
+
from typing import Dict, List, Optional, Tuple
|
|
6
6
|
|
|
7
7
|
from pydantic import (
|
|
8
8
|
BaseModel,
|
|
@@ -36,37 +36,39 @@ OBBSecretStr = Annotated[
|
|
|
36
36
|
class CredentialsLoader:
|
|
37
37
|
"""Here we create the Credentials model."""
|
|
38
38
|
|
|
39
|
-
credentials: Dict[str,
|
|
39
|
+
credentials: Dict[str, List[str]] = {}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
def prepare(
|
|
43
|
-
credentials: Dict[str, Set[str]],
|
|
44
|
-
) -> Dict[str, Tuple[object, None]]:
|
|
41
|
+
def format_credentials(self) -> Dict[str, Tuple[object, None]]:
|
|
45
42
|
"""Prepare credentials map to be used in the Credentials model."""
|
|
46
43
|
formatted: Dict[str, Tuple[object, None]] = {}
|
|
47
|
-
for
|
|
48
|
-
for
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
for c_origin, c_list in self.credentials.items():
|
|
45
|
+
for c_name in c_list:
|
|
46
|
+
if c_name in formatted:
|
|
47
|
+
warnings.warn(
|
|
48
|
+
message=f"Skipping '{c_name}', credential already in use.",
|
|
49
|
+
category=OpenBBWarning,
|
|
50
|
+
)
|
|
51
|
+
continue
|
|
52
|
+
formatted[c_name] = (
|
|
53
53
|
Optional[OBBSecretStr],
|
|
54
|
-
Field(
|
|
55
|
-
default=None, description=origin, alias=c.upper()
|
|
56
|
-
), # register the credential origin (obbject, providers)
|
|
54
|
+
Field(default=None, description=c_origin, alias=c_name.upper()),
|
|
57
55
|
)
|
|
58
56
|
|
|
59
|
-
return formatted
|
|
57
|
+
return dict(sorted(formatted.items()))
|
|
60
58
|
|
|
61
59
|
def from_obbject(self) -> None:
|
|
62
60
|
"""Load credentials from OBBject extensions."""
|
|
63
|
-
|
|
64
|
-
for name, entry in ExtensionLoader().obbject_objects.items():
|
|
61
|
+
for ext_name, ext in ExtensionLoader().obbject_objects.items(): # type: ignore[attr-defined]
|
|
65
62
|
try:
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
if ext_name in self.credentials:
|
|
64
|
+
warnings.warn(
|
|
65
|
+
message=f"Skipping '{ext_name}', name already in user.",
|
|
66
|
+
category=OpenBBWarning,
|
|
67
|
+
)
|
|
68
|
+
continue
|
|
69
|
+
self.credentials[ext_name] = ext.credentials
|
|
68
70
|
except Exception as e:
|
|
69
|
-
msg = f"Error loading extension: {
|
|
71
|
+
msg = f"Error loading extension: {ext_name}\n"
|
|
70
72
|
if Env().DEBUG_MODE:
|
|
71
73
|
traceback.print_exception(type(e), e, e.__traceback__)
|
|
72
74
|
raise LoadingError(msg + f"\033[91m{e}\033[0m") from e
|
|
@@ -77,20 +79,20 @@ class CredentialsLoader:
|
|
|
77
79
|
|
|
78
80
|
def from_providers(self) -> None:
|
|
79
81
|
"""Load credentials from providers."""
|
|
80
|
-
self.credentials
|
|
81
|
-
for c in ProviderInterface().credentials:
|
|
82
|
-
self.credentials["providers"].add(c)
|
|
82
|
+
self.credentials = ProviderInterface().credentials
|
|
83
83
|
|
|
84
84
|
def load(self) -> BaseModel:
|
|
85
85
|
"""Load credentials from providers."""
|
|
86
86
|
# We load providers first to give them priority choosing credential names
|
|
87
87
|
self.from_providers()
|
|
88
88
|
self.from_obbject()
|
|
89
|
-
|
|
89
|
+
model = create_model( # type: ignore
|
|
90
90
|
"Credentials",
|
|
91
91
|
__config__=ConfigDict(validate_assignment=True, populate_by_name=True),
|
|
92
|
-
**self.
|
|
92
|
+
**self.format_credentials(),
|
|
93
93
|
)
|
|
94
|
+
model.origins = self.credentials
|
|
95
|
+
return model
|
|
94
96
|
|
|
95
97
|
|
|
96
98
|
_Credentials = CredentialsLoader().load()
|
|
@@ -116,3 +118,7 @@ class Credentials(_Credentials): # type: ignore
|
|
|
116
118
|
[f"{k}: {v}" for k, v in sorted(self.model_dump(mode="json").items())]
|
|
117
119
|
)
|
|
118
120
|
)
|
|
121
|
+
|
|
122
|
+
def update(self, incoming: "Credentials"):
|
|
123
|
+
"""Update current credentials."""
|
|
124
|
+
self.__dict__.update(incoming.model_dump(exclude_none=True))
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Defaults model."""
|
|
2
|
+
|
|
3
|
+
from typing import Dict, List, Optional
|
|
4
|
+
from warnings import warn
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, ConfigDict, Field, model_validator
|
|
7
|
+
|
|
8
|
+
from openbb_core.app.model.abstract.warning import OpenBBWarning
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Defaults(BaseModel):
|
|
12
|
+
"""Defaults."""
|
|
13
|
+
|
|
14
|
+
model_config = ConfigDict(validate_assignment=True, populate_by_name=True)
|
|
15
|
+
|
|
16
|
+
commands: Dict[str, Dict[str, Optional[List[str]]]] = Field(
|
|
17
|
+
default_factory=dict,
|
|
18
|
+
alias="routes",
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
def __repr__(self) -> str:
|
|
22
|
+
"""Return string representation."""
|
|
23
|
+
return f"{self.__class__.__name__}\n\n" + "\n".join(
|
|
24
|
+
f"{k}: {v}" for k, v in self.model_dump().items()
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
@model_validator(mode="before")
|
|
28
|
+
@classmethod
|
|
29
|
+
def validate_before(cls, values: dict) -> dict:
|
|
30
|
+
"""Validate model (before)."""
|
|
31
|
+
key = "commands"
|
|
32
|
+
if "routes" in values:
|
|
33
|
+
warn(
|
|
34
|
+
message="'routes' is deprecated. Use 'commands' instead.",
|
|
35
|
+
category=OpenBBWarning,
|
|
36
|
+
)
|
|
37
|
+
key = "routes"
|
|
38
|
+
|
|
39
|
+
new_values: Dict[str, Dict[str, Optional[List[str]]]] = {"commands": {}}
|
|
40
|
+
for k, v in values.get(key, {}).items():
|
|
41
|
+
clean_k = k.strip("/").replace("/", ".")
|
|
42
|
+
provider = v.get("provider") if v else None
|
|
43
|
+
if isinstance(provider, str):
|
|
44
|
+
v["provider"] = [provider]
|
|
45
|
+
new_values["commands"][clean_k] = v
|
|
46
|
+
return new_values
|
|
@@ -126,8 +126,8 @@ class ProviderInterface(metaclass=SingletonMeta):
|
|
|
126
126
|
return self._map
|
|
127
127
|
|
|
128
128
|
@property
|
|
129
|
-
def credentials(self) -> List[str]:
|
|
130
|
-
"""
|
|
129
|
+
def credentials(self) -> Dict[str, List[str]]:
|
|
130
|
+
"""Map providers to credentials."""
|
|
131
131
|
return self._registry_map.credentials
|
|
132
132
|
|
|
133
133
|
@property
|
|
@@ -644,7 +644,7 @@ class RouterLoader:
|
|
|
644
644
|
"""Load routes from extensions."""
|
|
645
645
|
router = Router()
|
|
646
646
|
|
|
647
|
-
for name, entry in ExtensionLoader().core_objects.items():
|
|
647
|
+
for name, entry in ExtensionLoader().core_objects.items(): # type: ignore[attr-defined]
|
|
648
648
|
try:
|
|
649
649
|
router.include_router(router=entry, prefix=f"/{name}")
|
|
650
650
|
except Exception as e:
|
|
@@ -50,15 +50,6 @@ class UserService(metaclass=SingletonMeta):
|
|
|
50
50
|
)
|
|
51
51
|
path.write_text(user_settings_json, encoding="utf-8")
|
|
52
52
|
|
|
53
|
-
@classmethod
|
|
54
|
-
def update_default(cls, user_settings: UserSettings) -> UserSettings:
|
|
55
|
-
"""Update default user settings."""
|
|
56
|
-
d1 = cls.read_default_user_settings().model_dump()
|
|
57
|
-
d2 = user_settings.model_dump() if user_settings else {}
|
|
58
|
-
updated = cls._merge_dicts([d1, d2])
|
|
59
|
-
|
|
60
|
-
return UserSettings.model_validate(updated)
|
|
61
|
-
|
|
62
53
|
@staticmethod
|
|
63
54
|
def _merge_dicts(list_of_dicts: List[Dict[str, Any]]) -> Dict[str, Any]:
|
|
64
55
|
"""Merge a list of dictionaries."""
|