Commit Graph

352 Commits

Author SHA1 Message Date
hjoaquim
c91a8a06e3 sdk powered terminal commands with clean help messages 2023-08-09 13:59:39 +01:00
Henrique Joaquim
86f951f1b1 Argparse custom params (#5303)
* Argparse custom params POC

* small improvements to the package builder

* generation of static assets

* minor adjustments

---------

Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com>
2023-08-09 10:51:08 +01:00
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
Pratyush Shukla
aa21a87193 static files 2023-08-08 19:04:57 +05:30
Pratyush Shukla
0d95889150 changed condition to reflect standard_models 2023-08-08 18:45:27 +05:30
Pratyush Shukla
b9242894d5 renamed models to standard_models 2023-08-08 18:42:23 +05:30
Igor Radovanovic
28946b85c9 Refactor Fetcher, fix descriptions, fix bugs, cleanup... | co-author: the-praxs 2023-08-08 00:22:03 +02:00
Igor Radovanovic
6c702a3ed0 Fix some failing tests 2023-08-07 21:56:27 +02:00
Igor Radovanovic
ffc33acdf3 Merge, fix errors, and conflicts 2023-08-07 21:33:26 +02:00
montezdesousa
1165e57b40 make some provider args optional 2023-08-04 10:56:20 +01:00
montezdesousa
afbd4a69aa rename some fetcher vars 2023-08-04 10:45:28 +01:00
montezdesousa
8f0b748270 move helpers and descriptions to util.py directory 2023-08-04 10:37:54 +01:00
James Maslek
41e800ad6a Custom request for all providers (#5280)
* breakpoint 1

* breakpoint pt 1

* Finish fred request

* Add **kwargs to all fmp funcs

* Moved all fmp funcs to custom request

* benzinga requests

* add polygon requests

* remove comment

* move make_request to helpers

---------

Co-authored-by: montezdesousa <montezdesousa@gmail.com>
2023-08-04 10:06:15 +01:00
James Maslek
ce5b93ae4e Custom args to package builder (#5282) 2023-08-04 00:59:51 +01:00
montezdesousa
ed07f6ad4c 200 breaks polygon 2023-08-04 00:46:12 +01:00
montezdesousa
70f70a81b4 Hotfix/sdk py38 (#5279)
* replace unsupported Annotated, MappingProxyType, is_annotated_dc

* fix package builder
2023-08-03 12:43:55 +01:00
Diogo Sousa
61afffb1f5 typing 2023-08-02 16:56:40 +01:00
Diogo Sousa
0b3b30eccc rename exception for better localization 2023-08-02 16:51:07 +01:00
Diogo Sousa
49fe650117 update provider readme 2023-08-02 16:43:54 +01:00
Diogo Sousa
1e0a3c36c4 update provider readme 2023-08-02 16:43:19 +01:00
Diogo Sousa
9a1b4a8fba update provider readme 2023-08-02 16:42:02 +01:00
Diogo Sousa
6b93a603dc update provider readme 2023-08-02 16:37:54 +01:00
Diogo Sousa
13d95452c3 to follow the convention 2023-08-02 15:50:20 +01:00
Diogo Sousa
e3d65b502f filter 2023-08-02 14:49:19 +01:00
Diogo Sousa
cc5a334258 cleanup filters 2023-08-02 14:42:14 +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
hjoaquim
b7fecb80e8 placeholders for other repository tests 2023-08-02 06:30:39 +01:00
hjoaquim
faf4837457 tests for repository/abstract 2023-08-02 06:28:15 +01:00
hjoaquim
35dd4ec3f1 black 2023-08-01 15:44:12 +01:00
hjoaquim
a7584c8a3d ruff 2023-08-01 15:01:29 +01:00
hjoaquim
a618e325ec tests for system settings 2023-08-01 14:52:32 +01:00
hjoaquim
a6b2c1fac7 ruff 2023-08-01 14:04:25 +01:00
hjoaquim
b1ecbc75e6 add tests for command_output 2023-08-01 13:08:14 +01:00
Diogo Sousa
fe1073da09 only allow setup for allowed system fields 2023-08-01 12:29:42 +01:00
Diogo Sousa
c8f82e1f8f reorder system settings attrs 2023-08-01 12:04:16 +01:00
hjoaquim
938e126df8 some more tests and moves 2023-08-01 07:47:29 +01:00
hjoaquim
2b899b83c2 ruff 2023-08-01 06:48:22 +01:00
hjoaquim
b3f7e7f042 more tests for models 2023-08-01 06:48:08 +01:00
hjoaquim
d9b45e22ee some more tests for models 2023-08-01 06:30:57 +01:00
hjoaquim
83ed6f1675 placeholders 2023-08-01 05:29:31 +01:00
Igor Radovanovic
e2956367d3 Move 2023-07-31 18:14:55 +02:00
hjoaquim
a2d7b9f33c ruff 2023-07-31 14:58:26 +01:00
hjoaquim
89dba242bb typo 2023-07-31 14:57:42 +01:00
hjoaquim
5f66a3b19e Merge branch 'feature/unit-tests' of github.com:OpenBB-finance/OpenBBTerminal into feature/unit-tests 2023-07-31 14:54:32 +01:00
hjoaquim
59b19b3c23 adding tests for logs 2023-07-31 14:54:20 +01:00
Igor Radovanovic
cfb3045fe9 Add mock JWT token 2023-07-31 12:02:27 +02:00
Theodore Aptekarev
1db7fbea90 Merge branch 'feature/openbb-sdk-v4' into feature/unit-tests 2023-07-31 10:35:53 +03:00
James Maslek
088c9a324c Pandas doesnt work with 3.12 yet 2023-07-28 12:34:39 -04:00
James Maslek
2fe81e03d8 <= 3.12 2023-07-28 12:08:02 -04:00
Igor Radovanovic
631308bc9b Rename test files 2023-07-28 17:15:21 +02:00