Commit Graph

18 Commits

Author SHA1 Message Date
Igor Radovanovic
bc28dff7cc Linting 2023-08-31 12:14:41 +02:00
Igor Radovanovic
9bc4924320 Fix futures curve 2023-08-29 12:20:54 +02:00
Henrique Joaquim
379cb0bf11 changing posthog project key (#5362) 2023-08-22 10:26:17 +01:00
montezdesousa
cd2d7f21a3 Hotfix/squeeze import (#5358)
* remove commit_hash and branch references

* lazy load stats, scipy, pandas_ta

* black & ruff

* adding commithash back to log prefix

* fix test

---------

Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>
2023-08-21 21:53:11 +01:00
Igor Radovanovic
c38e3908a8 Fix more mypy warnings 2023-08-18 14:48:13 +02:00
Igor Radovanovic
fb8872ea09 Fix chart-related mypy errors. Co-Author: ’hjoaquim’ 2023-08-18 14:02:22 +02:00
Igor Radovanovic
374dd96aed Feature/fetcher cleanup (#5330)
* Linting

* added extra params and file cleanup in yfinance

* `yfinance` Fetcher refactored

* `cboe` Fetcher refactored, pydocstyle pass and cleanup

* `yfinance` Fetcher cleanup and pydocstyle pass

* `cboe` Fetcher cleanup

* ruff + black

* Linting

* Fetcher cleanup and typing, bug fixes

Co-authored-by: montezdesousa

* Fix CPI

* Fix CBOE typing

* Fix yfinance typing

* MyPy improvements

* remove pass

* property reorder

* update get_data_many to return raw data and refactor treasury rates

* refactor stocksplits

* stockquote

* change data one and stock peers

* stock ownership

* stock news

* stock multiples

* insider trading

* stock eod

* share stats

* sec fillings

* risk premium

* revenue business line

* revenue geographic

* price target

* black

* treasury rates descriptions

* more descriptions

* remove The from descriptions

* remove The from descriptions

* price target consensus

* polygon forex pairs

* fix `Annotated is not defined` in static files

* cboe Fetcher relisted data and pyproject cleanup

* major indices eod

* yfinance relisted data

* major indixes const

* key metrics

* key executive

* institutional ownership

* forgot futures curve

* income statement

* income statement growth

* remove unecessary var

* black

* rename var

* change generic var names

* rename abstract fetcher inner properties

* remove unused provider helpers

* add class description

* import from ParamSpec regardless of version

* specific imports hub service & ruff

* remove useless inspect import

* update comment

* remove mypy comment

* fmp Fetcher refactor, pydocstyle pass and cleanup

* ruff

* query.Dict to query.dict and set dates to 1 year diff

* polygon date interval is 1 year

* typing

* mypy

---------

Co-authored-by: Pratyush Shukla <ps4534@nyu.edu>
Co-authored-by: Diogo Sousa <montezdesousa@gmail.com>
2023-08-18 10:59:20 +01:00
tehcoderer
b9fa67deb2 cleanup 2023-08-14 14:08:46 -04:00
Pratyush Shukla
a16cc4d9fa obbjected but now its obbviously OBBject 2023-08-12 01:23:24 +05:30
tehcoderer
4dfaa173d9 financial_ratios multi symbols 2023-08-11 14:13:25 -04:00
Pratyush Shukla
aee320d9b1 CommandOutput to Obbject 2023-08-11 20:35:51 +05:30
Henrique Joaquim
9348f098a5 [SDK v4] General improvements related with the charting extension (#5283)
* introducing fig on the chart model

* charting manager to expect fig and content. also, adding a 1st example of its usage for stocks/load route

* leveraging fig.show on command output

* introducing the render_chart function

* using render_chart() on the command output

* drop to_plotly_json function

* a way of removing fields from the api only

* remove references to to_plotly_json

* fix charting_router to use new convention on returning fig and content

* adjustments on the builder script

* ruff and black

* typo

* stocks_news chart implementation

* repr on chart model

* adding table style config

* removing to_plotly_json from the charting manager

* typo and a little change on the way to_table behaves so we can leverage inheritance

* introducing OpenBBFigureTable as a workarround to have tables on the sdk

* renaming to to_chart

* multiples implementation

* black
2023-08-08 15:18:57 +01:00
montezdesousa
be864d01f3 Feature/provider refactoring (#5266)
* remove comment

* replace registry description

* black and add some todos

* remove unused var

* allow description and move provider to title

* fix the data field descriptions

* refactor globalnews

* added `"limit"` to metadata descriptions

* fix cpi command and refactor

* refactored `AnalystEstimates`

* add concat param

* refactored `AvailableIndices` for `economy.available_indices`

* sort and set index to date

* place it inside exception

* move literals to core

* rename descriptions dict

* add descriptions to cpi data

* change description

* black

* refactored `CompanyOverview` for `stocks.fa.overview`

* Updated `DATA_DESCRIPTIONS` in provider metadata

* Updated `symbol` description in `DATA_DESCRIPTIONS`

* fix stock_news alias

* pass standard limit

* fix stock news

* fix to datframe

* rebuild python interface

* refactored `CryptoEOD` for `crypto.load`

* added Field descriptions

* fix polygon stock_news

* fix stock_news data

* ruff

* refactored `DividendCalendar` for `stocks.fa.cal`

* refactored `EarningsCalendar` for `stocks.fa.cal`

* refactored `EarningsCallTranscript` for `stocks.fa.transcript`

* refactored `ExecutiveCompensation` for `stocks.fa.comp`

* first round, refactor registry, executor, map

* ruff

* Allow alias in the provider models for provider specific params

* Updated stock news to use alias in query

* small fixes

* fix interface bug

* black

* exceptions and typing

* ruff

* fix docstring

* sort providers

* push static assets without docstrings

* date Field and optional dates params in `CryptoEOD` for fmp and polygon

* refactored `ForexEOD` for `forex.load`

* add comment

* refactored `ForexPairs` and added Polygon provider

* removed `_price` models from fmp and polygon

* Updated `economy.index` to use `MajorIndicesEOD`

* removed `_price` from sdk models

* refactored `MajorIndicesEOD` for `economy.index`

* refactored `StockEOD` for `stocks.load`

* regenerate sdk

* ruff

* fix bug with global_news

* typing

* add docstrings to registry map

* update docstrings

* add executor query arg

* follow convention

* docstring

* inject provider interface instead

* doc

* safer this way

* docs

* add abstractmethod decorator

* add explicit fetcher property model_name

* remove mode_name prop

* get model name from query params

* force extra params or data to be optional

* replace fetcher list by fetcher dict and black

* explicit depps in prov interface

* explicit depps in prov interface

* no formatted creds

* no formatted creds

* dep injection

* dep injection

* private methods

* just verify credentials

* docstring

* typing and cut doc

* typing

* typing

* typing

* no overkill

* ruff

* don't block if model not found, just warn

* don't block if model not found, just warn

* don't block if model not found, just warn

* empty list if creds None

* check creds before request

* just return the data

* typing

* move query params

* ruff

* move queryparams

* move queryparams

* move queryparams

* fix a bunch o polygon models

* ruff

* partial fix fmp models

* ruff

* refactor more fmps

* create dict by alias

* refactor more fmp endpoints

* bug

* add params to transform query

* ruff

* fix fmp bugs

* has to be annotation

* rewrite static

* typing

* append return type to map

* support return for generic data type

* remove return type for openbb provider

* add todo

* fix small fred typing error

* add more return type info

* better message

* handle multiple types of data (the fetcher should declare them later)

* add comment

* ruff

* handle returns with generic for now (check juan solution)

* fix bug with generic

* fix fmp fetchr dict

* fill return type in the provider lib for docstrings

* polygon stock news

* Update economy_router.py (#5254)

* remove return type stuff

* adapt cpi and overview

* rewrite python interface

* fix to_dataframe

* limit stocks eod output

* rename method

* mypy

* mypy

* mypy chart style

* mypy provider

* mypy ignores

* mypy credentials

* Added Statements Growth endpoints from FMP

* account mypy fix

* privatize account method

* one more mypy

* remove mypy ignore

* rename private method

* Linting

* Docstring generation

* Linting

* move provider.py into __init__.py

* add default to required_credentials -> None

* refactored `KeyExecutives` for `stocks.fa.mgmt`

* refactored `HistoricalEmployees` for `stocks.fa.emp`

* provider docstring

* docstring

* refactored `HistoricalStockSplits` for `stocks.fa.split`

* standardised date in stockeod

* refactored ``InstitutionalOwnership` for `stocks.fa.own`

* removed unused imports

* add `check_fields=False` in `@validator`

* historical dividens

* remove unused helper

* move single used helpers to where they are used

* move single used helpers to where they are used

* move single used helpers to where they are used

* standardise date, vwap in crypto eod and forex eod

* rename __commands__ to __extensions__

* change coverage separator

* the map cannot change sep

* sry

* sry again

* remove comment

* refactored `MajorIndicesConstituents` for `economy.const`

* add some descriptions about provider

* refactored `PriceTargetConsensus` for `stocks.fa.pt`

* refactored `PriceTarget` for `stocks.fa.pta`

* refactored `RevenueBusinessLine` for `stocks.fa.revseg`

* change metadata file name

* docstring

* remove unecessary arg

* ruff & black

* refactored `RevenueGeographic` for `stocks.fa.revgeo`

* refactored `RiskPremium` for `economy.risk`

* refactored `SECFilings` for `stocks.dd.sec`

* refactored `ShareStatistics` for `stocks.fa.shrs`

* refactored `StockInsiderTrading` for `stocks.fa.ins`

* peers

* stock splits

* refactored `KeyMetrics` for `stocks.fa.metrics`

* refactored `StockMultiples` for `stocks.multiples`

* refactor income statement

* rebuild

* fmp balance

* added `StocksOwnership` to `stocks.fa.own`

* added `InstitutionalOwnership` to `stocks.fa.ins_own`

* refactored `StocksOwnership` for `stocks.fa.own`

* cleanup

* refactored `TreasuryRates` for `fixedincome.treasury`

* reorder balance items

* fix polygon bs

* refactored `IncomeStatement` for `stocks.fa.balance`

* refactored base and types

* added static files

* cleanup

* cleanup

* refactored `CashFlowStatement` for `stocks.fa.cash`

* added `stocks/fa` static file

* black and ruff

---------

Co-authored-by: Pratyush Shukla <ps4534@nyu.edu>
Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
2023-08-02 18:47:20 +05:30
Henrique Joaquim
beefeed8ce Feature/improving to plotly (#5238)
* introducing singleton abstract class

* changing charting manager to be a singleton and introducing the to_plotly_json methon on the charting manager level: which should be a proxy for the actual implementation on the charting extension module level

* exposing to_plotly_json method on a module level for the openbb_charint extension

* changing the logging manager to be a singleton

* forcing both managers (logging and charting) to update on each run

* expanding the to_plotly_json functionality on the CommandOutput level

* fix readme typo

* fix indicators anchored to left

* ruff

* removing unnecesary change

* improved docstrings

* black

* ruff
2023-07-24 17:19:19 +01:00
montezdesousa
3018be889d add some charts PR stuff into the main repo (#5224)
* add some charts PR stuff into the main repo

* add charting method working for jupyter

* dont raise

* renamed router

* cleaner

* ruff

* remove print, add todo

* minor readme adjustment on url

* adding pandas-ta

* add pandas-ta to deps

* remove optional content

* settings env file

* Use import relative to the package instead of REPO

* using openbb_directory const instead

* optional content

* optional content

* optional content

* black

* added user styles for console

* initializing backend in the charting manager and moving things - working version

* pyling

* add defaults

* ruff

* fixing circular import

* fix backend creation

* cmd location on the args instead

* considering charting settings on ta class

* cleaning ta extension

* adding missing dependency on ta

* charts on window

* misplaced import

* rename file no_import to dummy_backend

* redirect import

* introducing debug_mode and cleaning todos on ta_class

* rename backend folder to core

* move charts inside app folder and allocate models

* move logs folder into app folder

* fixing paths

* fixing todos on openbb_figure

* setting dummy backend to warn and open in browser if pywry missing

* ruff

* write msg inside exception

* refactor the use of the theme

* change package builder module names

* removing all references to theme as global variable

* ajudsting the usage of kwargs on the charting_router

* removing references to rich style and console things

* dinamically import the backend functions on the charting manager

* add comment

* fix backend funcs import

* read debug_mode from env

* no need to fix manager, but ignore ruff inside __init__

* break command_runner __execute_func into smaller functions

* don't raise unless debug mode

* replace some errors by OpenBBError

* raise provider error if failure

* add timedelta minus 7 for eods

* 5 is better

* print chart error if any

* same print for warnings

* fixing the broken indicators and removing clutter

* warn warnings in debug mode

* fix path

* fixes on the ta examples

* bringing back the utils functions

* add error handling messages and sync debug mode

* rename base_filter to call_filter

* fix chart on api

* complete comment

* add runtime debug_mode in the static version

* removing comment

* working with dataframes in the package

* ruff

* ruff

* ruff

* readme

* ruff

---------

Co-authored-by: hjoaquim <h.joaquim@campus.fct.unl.pt>
2023-07-21 09:40:04 +01:00
Diogo Sousa
4c65add171 redeuce some code and rename from_plugins to from_extensions 2023-07-17 18:02:19 +01:00
Diogo Sousa
efa8370963 mypy 2023-07-17 12:07:18 +01:00
Theodore Aptekarev
e5a9a7f427 Update folder structure for the SDK v4 (#5212)
* Move openbb_provider

* Add lock file for provider core

* Move sdk core

* Move openbb-provider readme text to the correct location

* Move data providers code

* Remove decoupling leftovers

* Lower the supported python version to 3.8

* Move sdk extensions

* Rename provider imports

* Update openbb pyproject toml

* Fix import statements after the move

* Update lock files

* Change ignored path for the static assets

* Add obb mascot

* Fix providers not being available in the openbb package

* Remove providers extension in favor of the coverage router in sdk core

* username is optional

* linting

* Change openbb_sdk_core to openbb_core

* Bump ruff pre-commit to latest version

* Bump ruff to latest in github actions

* Make ruff and pylint lint only the code in diff in GHA

* Attempt to fix broken linting action

* Attempt to fix the broken linting action II

* Lint code with pre-commit

* Revert all changes to github actions

* Revert to using ruff 0.0.256

* Use dot for local imports

* Re-commit lost forex pairs

* Fix fmp's typo that made it to the openbb data points

* Add other_investing_activities field that has a typo in fmp's api

---------

Co-authored-by: montezdesousa <montezdesousa@gmail.com>
Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
2023-07-12 18:43:30 +02:00