openbb-core 1.2.2__tar.gz → 1.2.3__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.3}/PKG-INFO +4 -5
- openbb_core-1.2.3/openbb_core/api/app_loader.py +40 -0
- openbb_core-1.2.3/openbb_core/api/exception_handlers.py +69 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/api/rest_api.py +4 -37
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/command_runner.py +7 -11
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/logs/logging_service.py +5 -8
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/api_settings.py +1 -1
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/credentials.py +5 -1
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/router.py +1 -1
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/service/user_service.py +0 -9
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/static/account.py +5 -7
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/static/coverage.py +7 -10
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/static/package_builder.py +7 -5
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/static/utils/decorators.py +20 -28
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/registry.py +1 -1
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/balance_of_payments.py +79 -0
- openbb_core-1.2.3/openbb_core/provider/standard_models/compare_company_facts.py +56 -0
- openbb_core-1.2.3/openbb_core/provider/standard_models/forward_ebitda_estimates.py +75 -0
- openbb_core-1.2.3/openbb_core/provider/standard_models/yield_curve.py +37 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/utils/errors.py +3 -1
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/utils/helpers.py +1 -1
- {openbb_core-1.2.2 → openbb_core-1.2.3}/pyproject.toml +4 -11
- openbb_core-1.2.2/openbb_core/api/app_loader.py +0 -36
- openbb_core-1.2.2/openbb_core/provider/standard_models/etf_holdings_performance.py +0 -14
- {openbb_core-1.2.2 → openbb_core-1.2.3}/README.md +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/api/auth/user.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/api/dependency/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/api/dependency/coverage.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/api/dependency/system.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/api/router/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/api/router/commands.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/api/router/coverage.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/api/router/helpers/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/api/router/helpers/coverage_helpers.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/api/router/system.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/api/router/user.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/constants.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/deprecation.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/extension_loader.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/logs/formatters/formatter_with_exceptions.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/logs/handlers/path_tracking_file_handler.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/logs/handlers/posthog_handler.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/logs/handlers_manager.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/logs/models/logging_settings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/logs/utils/expired_files.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/logs/utils/utils.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/abstract/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/abstract/error.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/abstract/results.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/abstract/singleton.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/abstract/tagged.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/abstract/warning.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/charts/chart.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/charts/charting_settings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/command_context.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/defaults.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/example.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/extension.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/field.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/hub/hub_session.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/hub/hub_user_settings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/metadata.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/obbject.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/preferences.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/profile.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/python_settings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/results/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/results/empty.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/system_settings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/model/user_settings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/provider_interface.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/query.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/service/auth_service.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/service/hub_service.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/service/system_service.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/static/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/static/app_factory.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/static/container.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/static/reference_loader.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/static/utils/console.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/static/utils/filters.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/static/utils/linters.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/utils.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/app/version.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/env.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/abstract/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/abstract/annotated_result.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/abstract/data.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/abstract/fetcher.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/abstract/provider.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/abstract/query_params.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/py.typed +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/query_executor.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/registry_map.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/ameribor_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/analyst_estimates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/analyst_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/available_indicators.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/available_indices.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/balance_sheet.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/balance_sheet_growth.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/bond_prices.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/bond_reference.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/bond_trades.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/calendar_dividend.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/calendar_earnings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/calendar_ipo.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/calendar_splits.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/cash_flow.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/cash_flow_growth.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/cik_map.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/company_filings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/company_news.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/company_overview.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/compare_groups.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/composite_leading_indicator.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/cot.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/cot_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/country_profile.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/cp.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/cpi.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/crypto_historical.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/crypto_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/currency_historical.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/currency_pairs.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/currency_reference_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/currency_snapshots.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/discovery_filings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/dwpcr_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/earnings_call_transcript.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/ecb_interest_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/economic_calendar.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/economic_indicators.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/equity_ftd.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/equity_historical.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/equity_info.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/equity_nbbo.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/equity_ownership.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/equity_peers.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/equity_performance.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/equity_quote.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/equity_screener.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/equity_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/equity_short_interest.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/equity_valuation_multiples.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/esg_risk_rating.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/esg_score.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/esg_sector.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/estr_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/etf_countries.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/etf_equity_exposure.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/etf_historical.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/etf_historical_nav.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/etf_holdings.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/etf_holdings_date.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/etf_info.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/etf_performance.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/etf_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/etf_sectors.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/eu_yield_curve.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/executive_compensation.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/fed_projections.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/fed_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/ffrmc.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/financial_attributes.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/financial_ratios.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/form_13FHR.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/forward_eps_estimates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/forward_pe_estimates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/forward_sales_estimates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/fred_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/fred_series.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/futures_curve.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/futures_historical.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/gdp_forecast.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/gdp_nominal.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/gdp_real.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/historical_attributes.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/historical_dividends.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/historical_employees.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/historical_eps.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/historical_splits.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/hqm.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/ice_bofa.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/income_statement.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/income_statement_growth.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/index_constituents.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/index_historical.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/index_info.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/index_search.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/index_sectors.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/index_snapshots.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/industry_pe.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/insider_trading.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/institutional_ownership.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/iorb_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/key_executives.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/key_metrics.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/latest_attributes.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/lbma_fixing.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/long_term_interest_rate.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/market_indices.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/market_movers.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/market_snapshots.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/money_measures.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/moody.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/options_chains.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/options_unusual.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/otc_aggregate.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/price_target.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/price_target_consensus.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/recent_performance.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/reported_financials.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/revenue_business_line.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/revenue_geographic.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/risk_premium.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/search_attributes.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/search_financial_attributes.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/sector_pe.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/sector_performance.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/share_statistics.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/short_term_interest_rate.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/short_volume.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/sofr_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/sonia_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/sp500_multiples.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/spot.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/symbol_map.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/tbffr.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/tmc.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/top_retail.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/trailing_dividend_yield.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/treasury_auctions.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/treasury_prices.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/treasury_rates.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/unemployment.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/upcoming_release_days.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/us_yield_curve.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/world_news.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/utils/__init__.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/utils/client.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/utils/descriptions.py +0 -0
- {openbb_core-1.2.2 → openbb_core-1.2.3}/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.3
|
|
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,<=0.4.4)
|
|
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)
|
|
@@ -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__":
|
|
@@ -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."""
|
|
@@ -134,7 +134,7 @@ class ParametersBuilder:
|
|
|
134
134
|
|
|
135
135
|
def _has_provider(kwargs: Dict[str, Any]) -> bool:
|
|
136
136
|
"""Check if the kwargs already have a provider."""
|
|
137
|
-
provider_choices = kwargs.get("provider_choices"
|
|
137
|
+
provider_choices = kwargs.get("provider_choices")
|
|
138
138
|
|
|
139
139
|
if isinstance(provider_choices, dict): # when in python
|
|
140
140
|
return provider_choices.get("provider", None) is not None
|
|
@@ -156,7 +156,7 @@ class ParametersBuilder:
|
|
|
156
156
|
|
|
157
157
|
Either pick it from the user defaults or from the command coverage.
|
|
158
158
|
"""
|
|
159
|
-
cmd_cov_given_route = command_coverage.get(route
|
|
159
|
+
cmd_cov_given_route = command_coverage.get(route)
|
|
160
160
|
command_cov_provider = (
|
|
161
161
|
cmd_cov_given_route[0] if cmd_cov_given_route else None
|
|
162
162
|
)
|
|
@@ -229,7 +229,8 @@ class ParametersBuilder:
|
|
|
229
229
|
}
|
|
230
230
|
# We allow extra fields to return with model with 'cc: CommandContext'
|
|
231
231
|
config = ConfigDict(extra="allow", arbitrary_types_allowed=True)
|
|
232
|
-
|
|
232
|
+
# pylint: disable=C0103
|
|
233
|
+
ValidationModel = create_model(func.__name__, __config__=config, **fields) # type: ignore
|
|
233
234
|
# Validate and coerce
|
|
234
235
|
model = ValidationModel(**kwargs)
|
|
235
236
|
ParametersBuilder._warn_kwargs(
|
|
@@ -292,9 +293,7 @@ class StaticCommandRunner:
|
|
|
292
293
|
) -> OBBject:
|
|
293
294
|
"""Run a command and return the output."""
|
|
294
295
|
obbject = await maybe_coroutine(func, **kwargs)
|
|
295
|
-
obbject.provider = getattr(
|
|
296
|
-
kwargs.get("provider_choices", None), "provider", None
|
|
297
|
-
)
|
|
296
|
+
obbject.provider = getattr(kwargs.get("provider_choices"), "provider", None)
|
|
298
297
|
return obbject
|
|
299
298
|
|
|
300
299
|
@classmethod
|
|
@@ -331,7 +330,7 @@ class StaticCommandRunner:
|
|
|
331
330
|
|
|
332
331
|
if chart_params:
|
|
333
332
|
kwargs.update(chart_params)
|
|
334
|
-
obbject.charting.show(render=False, **kwargs)
|
|
333
|
+
obbject.charting.show(render=False, **kwargs) # type: ignore[attr-defined]
|
|
335
334
|
except Exception as e: # pylint: disable=broad-exception-caught
|
|
336
335
|
if Env().DEBUG_MODE:
|
|
337
336
|
raise OpenBBError(e) from e
|
|
@@ -386,9 +385,6 @@ class StaticCommandRunner:
|
|
|
386
385
|
obbject._standard_params = kwargs.get("standard_params", None)
|
|
387
386
|
if chart and obbject.results:
|
|
388
387
|
cls._chart(obbject, **kwargs)
|
|
389
|
-
|
|
390
|
-
except Exception as e:
|
|
391
|
-
raise OpenBBError(e) from e
|
|
392
388
|
finally:
|
|
393
389
|
ls = LoggingService(system_settings, user_settings)
|
|
394
390
|
ls.log(
|
|
@@ -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__},
|
|
@@ -31,7 +31,7 @@ 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"
|
|
@@ -61,7 +61,7 @@ class CredentialsLoader:
|
|
|
61
61
|
def from_obbject(self) -> None:
|
|
62
62
|
"""Load credentials from OBBject extensions."""
|
|
63
63
|
self.credentials["obbject"] = set()
|
|
64
|
-
for name, entry in ExtensionLoader().obbject_objects.items():
|
|
64
|
+
for name, entry in ExtensionLoader().obbject_objects.items(): # type: ignore[attr-defined]
|
|
65
65
|
try:
|
|
66
66
|
for c in entry.credentials:
|
|
67
67
|
self.credentials["obbject"].add(c)
|
|
@@ -116,3 +116,7 @@ class Credentials(_Credentials): # type: ignore
|
|
|
116
116
|
[f"{k}: {v}" for k, v in sorted(self.model_dump(mode="json").items())]
|
|
117
117
|
)
|
|
118
118
|
)
|
|
119
|
+
|
|
120
|
+
def update(self, incoming: "Credentials"):
|
|
121
|
+
"""Update current credentials."""
|
|
122
|
+
self.__dict__.update(incoming.model_dump(exclude_none=True))
|
|
@@ -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."""
|
|
@@ -18,7 +18,7 @@ if TYPE_CHECKING:
|
|
|
18
18
|
from openbb_core.app.static.app_factory import BaseApp
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
class Account:
|
|
21
|
+
class Account: # noqa: D205, D400
|
|
22
22
|
"""/account
|
|
23
23
|
login
|
|
24
24
|
logout
|
|
@@ -123,8 +123,8 @@ class Account:
|
|
|
123
123
|
"""
|
|
124
124
|
self._hub_service = self._create_hub_service(email, password, pat)
|
|
125
125
|
incoming = self._hub_service.pull()
|
|
126
|
-
|
|
127
|
-
self._base_app.
|
|
126
|
+
self._base_app.user.profile = incoming.profile
|
|
127
|
+
self._base_app.user.credentials.update(incoming.credentials)
|
|
128
128
|
if remember_me:
|
|
129
129
|
Path(self._openbb_directory).mkdir(parents=False, exist_ok=True)
|
|
130
130
|
session_file = Path(self._openbb_directory, self.SESSION_FILE)
|
|
@@ -185,10 +185,8 @@ class Account:
|
|
|
185
185
|
)
|
|
186
186
|
else:
|
|
187
187
|
incoming = self._hub_service.pull()
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
self._base_app._command_runner.user_settings = updated
|
|
191
|
-
|
|
188
|
+
self._base_app.user.profile = incoming.profile
|
|
189
|
+
self._base_app.user.credentials.update(incoming.credentials)
|
|
192
190
|
if return_settings:
|
|
193
191
|
return self._base_app._command_runner.user_settings
|
|
194
192
|
return None
|
|
@@ -11,16 +11,13 @@ if TYPE_CHECKING:
|
|
|
11
11
|
from openbb_core.app.static.app_factory import BaseApp
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
class Coverage:
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
command_model
|
|
22
|
-
command_schemas
|
|
23
|
-
reference
|
|
14
|
+
class Coverage: # noqa: D205, D400
|
|
15
|
+
"""/coverage
|
|
16
|
+
providers
|
|
17
|
+
commands
|
|
18
|
+
command_model
|
|
19
|
+
command_schemas
|
|
20
|
+
reference
|
|
24
21
|
"""
|
|
25
22
|
|
|
26
23
|
def __init__(self, app: "BaseApp"):
|
|
@@ -190,7 +190,7 @@ class PackageBuilder:
|
|
|
190
190
|
"openbb": VERSION.replace("dev", ""),
|
|
191
191
|
"info": {
|
|
192
192
|
"title": "OpenBB Platform (Python)",
|
|
193
|
-
"description": "
|
|
193
|
+
"description": "Investment research for everyone, anywhere.",
|
|
194
194
|
"core": CORE_VERSION.replace("dev", ""),
|
|
195
195
|
"extensions": ext_map,
|
|
196
196
|
},
|
|
@@ -1048,7 +1048,7 @@ class DocstringGenerator:
|
|
|
1048
1048
|
cls,
|
|
1049
1049
|
model_name: str,
|
|
1050
1050
|
summary: str,
|
|
1051
|
-
explicit_params:
|
|
1051
|
+
explicit_params: Dict[str, Parameter],
|
|
1052
1052
|
kwarg_params: dict,
|
|
1053
1053
|
returns: Dict[str, FieldInfo],
|
|
1054
1054
|
results_type: str,
|
|
@@ -1071,8 +1071,10 @@ class DocstringGenerator:
|
|
|
1071
1071
|
description = description.replace("\n", f"\n{create_indent(2)}")
|
|
1072
1072
|
return description
|
|
1073
1073
|
|
|
1074
|
-
def get_param_info(parameter: Parameter) -> Tuple[str, str]:
|
|
1074
|
+
def get_param_info(parameter: Optional[Parameter]) -> Tuple[str, str]:
|
|
1075
1075
|
"""Get the parameter info."""
|
|
1076
|
+
if not parameter:
|
|
1077
|
+
return "", ""
|
|
1076
1078
|
annotation = getattr(parameter, "_annotation", None)
|
|
1077
1079
|
if isinstance(annotation, _AnnotatedAlias):
|
|
1078
1080
|
args = getattr(annotation, "__args__", []) if annotation else []
|
|
@@ -1123,7 +1125,7 @@ class DocstringGenerator:
|
|
|
1123
1125
|
docstring += "\n"
|
|
1124
1126
|
docstring += f"{create_indent(2)}Returns\n"
|
|
1125
1127
|
docstring += f"{create_indent(2)}-------\n"
|
|
1126
|
-
providers, _ = get_param_info(explicit_params.get("provider"
|
|
1128
|
+
providers, _ = get_param_info(explicit_params.get("provider"))
|
|
1127
1129
|
docstring += cls.get_OBBject_description(results_type, providers)
|
|
1128
1130
|
|
|
1129
1131
|
# Schema
|
|
@@ -1300,7 +1302,7 @@ class PathHandler:
|
|
|
1300
1302
|
@staticmethod
|
|
1301
1303
|
def get_route(path: str, route_map: Dict[str, BaseRoute]):
|
|
1302
1304
|
"""Get the route from the path."""
|
|
1303
|
-
return route_map.get(path
|
|
1305
|
+
return route_map.get(path)
|
|
1304
1306
|
|
|
1305
1307
|
@staticmethod
|
|
1306
1308
|
def get_child_path_list(path: str, path_list: List[str]) -> List[str]:
|
|
@@ -47,8 +47,7 @@ def exception_handler(func: Callable[P, R]) -> Callable[P, R]:
|
|
|
47
47
|
def wrapper(*f_args, **f_kwargs):
|
|
48
48
|
try:
|
|
49
49
|
return func(*f_args, **f_kwargs)
|
|
50
|
-
except (ValidationError, Exception) as e:
|
|
51
|
-
# If the DEBUG_MODE is enabled, raise the exception with complete traceback
|
|
50
|
+
except (ValidationError, OpenBBError, Exception) as e:
|
|
52
51
|
if Env().DEBUG_MODE:
|
|
53
52
|
raise
|
|
54
53
|
|
|
@@ -60,34 +59,27 @@ def exception_handler(func: Callable[P, R]) -> Callable[P, R]:
|
|
|
60
59
|
|
|
61
60
|
if isinstance(e, ValidationError):
|
|
62
61
|
error_list = []
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
f"input_type={type(error['input']).__name__}, "
|
|
72
|
-
f"input_value={error['input']}]\n"
|
|
73
|
-
)
|
|
74
|
-
url = error.get("url")
|
|
75
|
-
error_info = (
|
|
76
|
-
f" For further information visit {url}\n" if url else ""
|
|
62
|
+
validation_error = f"{e.error_count()} validations error(s)"
|
|
63
|
+
for err in e.errors(include_url=False):
|
|
64
|
+
loc = ".".join(
|
|
65
|
+
[
|
|
66
|
+
str(i)
|
|
67
|
+
for i in err.get("loc", ())
|
|
68
|
+
if i not in ("standard_params", "extra_params")
|
|
69
|
+
]
|
|
77
70
|
)
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
_input = err.get("input", "")
|
|
72
|
+
msg = err.get("msg", "")
|
|
73
|
+
error_list.append(f"[Arg] {loc} -> input: {_input} -> {msg}")
|
|
80
74
|
error_list.insert(0, validation_error)
|
|
81
75
|
error_str = "\n".join(error_list)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
f"\nType -> {error_type}\n\nDetail -> {str(e)}"
|
|
91
|
-
).with_traceback(tb) from None
|
|
76
|
+
raise OpenBBError(f"\n[Error] -> {error_str}").with_traceback(
|
|
77
|
+
tb
|
|
78
|
+
) from None
|
|
79
|
+
if isinstance(e, OpenBBError):
|
|
80
|
+
raise OpenBBError(f"\n[Error] -> {str(e)}").with_traceback(tb) from None
|
|
81
|
+
raise OpenBBError("\n[Error] -> Unexpected error.").with_traceback(
|
|
82
|
+
tb
|
|
83
|
+
) from None
|
|
92
84
|
|
|
93
85
|
return wrapper
|
|
@@ -41,7 +41,7 @@ class RegistryLoader:
|
|
|
41
41
|
"""Load providers from entry points."""
|
|
42
42
|
registry = Registry()
|
|
43
43
|
|
|
44
|
-
for name, entry in ExtensionLoader().provider_objects.items():
|
|
44
|
+
for name, entry in ExtensionLoader().provider_objects.items(): # type: ignore[attr-defined]
|
|
45
45
|
try:
|
|
46
46
|
registry.include_provider(provider=entry)
|
|
47
47
|
except Exception as e:
|
{openbb_core-1.2.2 → openbb_core-1.2.3}/openbb_core/provider/standard_models/balance_of_payments.py
RENAMED
|
@@ -15,6 +15,85 @@ class BalanceOfPaymentsQueryParams(QueryParams):
|
|
|
15
15
|
"""Balance Of Payments Query."""
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
class BP6BopUsdData(Data):
|
|
19
|
+
"""OECD BP6 Balance of Payments Items, in USD."""
|
|
20
|
+
|
|
21
|
+
period: dateType = Field(
|
|
22
|
+
default=None,
|
|
23
|
+
description="The date representing the beginning of the reporting period.",
|
|
24
|
+
)
|
|
25
|
+
balance_percent_of_gdp: Optional[float] = Field(
|
|
26
|
+
default=None,
|
|
27
|
+
description="Current Account Balance as Percent of GDP",
|
|
28
|
+
json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100},
|
|
29
|
+
)
|
|
30
|
+
balance_total: Optional[float] = Field(
|
|
31
|
+
default=None, description="Current Account Total Balance (USD)"
|
|
32
|
+
)
|
|
33
|
+
balance_total_services: Optional[float] = Field(
|
|
34
|
+
default=None, description="Current Account Total Services Balance (USD)"
|
|
35
|
+
)
|
|
36
|
+
balance_total_secondary_income: Optional[float] = Field(
|
|
37
|
+
default=None, description="Current Account Total Secondary Income Balance (USD)"
|
|
38
|
+
)
|
|
39
|
+
balance_total_goods: Optional[float] = Field(
|
|
40
|
+
default=None, description="Current Account Total Goods Balance (USD)"
|
|
41
|
+
)
|
|
42
|
+
balance_total_primary_income: Optional[float] = Field(
|
|
43
|
+
default=None, description="Current Account Total Primary Income Balance (USD)"
|
|
44
|
+
)
|
|
45
|
+
credits_services_percent_of_goods_and_services: Optional[float] = Field(
|
|
46
|
+
default=None,
|
|
47
|
+
description="Current Account Credits Services as Percent of Goods and Services",
|
|
48
|
+
json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100},
|
|
49
|
+
)
|
|
50
|
+
credits_services_percent_of_current_account: Optional[float] = Field(
|
|
51
|
+
default=None,
|
|
52
|
+
description="Current Account Credits Services as Percent of Current Account",
|
|
53
|
+
json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100},
|
|
54
|
+
)
|
|
55
|
+
credits_total_services: Optional[float] = Field(
|
|
56
|
+
default=None, description="Current Account Credits Total Services (USD)"
|
|
57
|
+
)
|
|
58
|
+
credits_total_goods: Optional[float] = Field(
|
|
59
|
+
default=None, description="Current Account Credits Total Goods (USD)"
|
|
60
|
+
)
|
|
61
|
+
credits_total_primary_income: Optional[float] = Field(
|
|
62
|
+
default=None, description="Current Account Credits Total Primary Income (USD)"
|
|
63
|
+
)
|
|
64
|
+
credits_total_secondary_income: Optional[float] = Field(
|
|
65
|
+
default=None, description="Current Account Credits Total Secondary Income (USD)"
|
|
66
|
+
)
|
|
67
|
+
credits_total: Optional[float] = Field(
|
|
68
|
+
default=None, description="Current Account Credits Total (USD)"
|
|
69
|
+
)
|
|
70
|
+
debits_services_percent_of_goods_and_services: Optional[float] = Field(
|
|
71
|
+
default=None,
|
|
72
|
+
description="Current Account Debits Services as Percent of Goods and Services",
|
|
73
|
+
json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100},
|
|
74
|
+
)
|
|
75
|
+
debits_services_percent_of_current_account: Optional[float] = Field(
|
|
76
|
+
default=None,
|
|
77
|
+
description="Current Account Debits Services as Percent of Current Account",
|
|
78
|
+
json_schema_extra={"x-unit_measurement": "percent", "x-frontend_multiply": 100},
|
|
79
|
+
)
|
|
80
|
+
debits_total_services: Optional[float] = Field(
|
|
81
|
+
default=None, description="Current Account Debits Total Services (USD)"
|
|
82
|
+
)
|
|
83
|
+
debits_total_goods: Optional[float] = Field(
|
|
84
|
+
default=None, description="Current Account Debits Total Goods (USD)"
|
|
85
|
+
)
|
|
86
|
+
debits_total_primary_income: Optional[float] = Field(
|
|
87
|
+
default=None, description="Current Account Debits Total Primary Income (USD)"
|
|
88
|
+
)
|
|
89
|
+
debits_total: Optional[float] = Field(
|
|
90
|
+
default=None, description="Current Account Debits Total (USD)"
|
|
91
|
+
)
|
|
92
|
+
debits_total_secondary_income: Optional[float] = Field(
|
|
93
|
+
default=None, description="Current Account Debits Total Secondary Income (USD)"
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
|
|
18
97
|
class ECBMain(Data):
|
|
19
98
|
"""ECB Main Balance of Payments Items."""
|
|
20
99
|
|