Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next release : reports on steroids #2349

Merged
merged 280 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
280 commits
Select commit Hold shift + click to select a range
3482467
fix gov tests
montezdesousa Aug 19, 2022
d5b209e
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 19, 2022
9226420
refactor insider
montezdesousa Aug 19, 2022
688a291
new virtual path extraction
montezdesousa Aug 19, 2022
042675f
removed some symbol default params as they're considered critical
hjoaquim Aug 20, 2022
a32f38c
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
hjoaquim Aug 20, 2022
df585b6
little adjustments
hjoaquim Aug 20, 2022
983e2e9
Merge branch 'main' into api_next
montezdesousa Aug 22, 2022
ce97719
Merge branch 'main' into api_next
montezdesousa Aug 23, 2022
9e62feb
portfolio refactor
soggyomelette Aug 23, 2022
5d81cf2
merge API factory
montezdesousa Aug 23, 2022
ddcb2e5
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 23, 2022
7f07f25
add helpers, stocks, crypto, forex
montezdesousa Aug 23, 2022
f824e72
minor forex changes
soggyomelette Aug 24, 2022
5577f8f
include forex api paths
montezdesousa Aug 24, 2022
3268ae6
add 2 missing forex funcs
montezdesousa Aug 24, 2022
4354859
portfolio brokers refactor
soggyomelette Aug 24, 2022
d29ef87
display help on api func call
montezdesousa Aug 24, 2022
9f11cc5
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 24, 2022
dcbaf01
add econometrics virtual paths to api
montezdesousa Aug 25, 2022
637e3af
add api unit test
montezdesousa Aug 25, 2022
c1478f7
fixed report for the new api
hjoaquim Aug 25, 2022
e49e15b
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
hjoaquim Aug 25, 2022
ce3f7e0
minor portfolio refactorings
soggyomelette Aug 25, 2022
a5b4ce5
added gdapps
soggyomelette Aug 25, 2022
ef125b9
anchor_yield path
soggyomelette Aug 25, 2022
2444397
some more crypto path fixes
soggyomelette Aug 25, 2022
3fec2c0
small change
soggyomelette Aug 25, 2022
0e3bcf4
fixed wrong param
hjoaquim Aug 25, 2022
6fb5dce
minor fixes
hjoaquim Aug 25, 2022
58a385c
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
hjoaquim Aug 25, 2022
8ae74f5
wip - inital commit for forex report
hjoaquim Aug 25, 2022
fb33706
Merge branch 'main' into api_next
minhhoang1023 Aug 25, 2022
e1e1d50
add bw as a model, we'll get better solution afterwards
montezdesousa Aug 25, 2022
af35f91
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 25, 2022
58dac79
added ema with dummy model as it adds great functionality to the report
hjoaquim Aug 25, 2022
02fd16b
minor fixes
hjoaquim Aug 25, 2022
1ef7f14
wip - added functions to forex report
hjoaquim Aug 25, 2022
8e5389a
add feedparser news path
montezdesousa Aug 26, 2022
2e9ad04
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 26, 2022
dad03a9
add new virtual paths to api
montezdesousa Aug 26, 2022
c107ce1
adding commands to equity report
soggyomelette Aug 26, 2022
b0f55ee
Merge branch 'api_next' of https://github.com/OpenBB-finance/OpenBBTe…
soggyomelette Aug 26, 2022
326e291
revert to old paths, new ones were breaking
montezdesousa Aug 26, 2022
d1f840f
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 26, 2022
919c2aa
Add in very basic ETF report
JerBouma Aug 26, 2022
0adbf8f
Merge branch 'api_next' of https://github.com/OpenBB-finance/OpenBBTe…
JerBouma Aug 26, 2022
185363a
Add candle chart to ETF report
JerBouma Aug 26, 2022
1274a43
add etf load
montezdesousa Aug 26, 2022
65956cd
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 26, 2022
3357434
allow use of candle without data
montezdesousa Aug 26, 2022
bb5f2da
add raw to candle
montezdesousa Aug 26, 2022
82b0473
added forex report
hjoaquim Aug 26, 2022
d9ed122
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
hjoaquim Aug 26, 2022
eb82270
ongoing equity report
soggyomelette Aug 26, 2022
5af355b
Merge branch 'api_next' of https://github.com/OpenBB-finance/OpenBBTe…
soggyomelette Aug 26, 2022
ef81e77
equity report change
soggyomelette Aug 26, 2022
e174b82
fix some portfolio bugs and add docstrings
montezdesousa Aug 26, 2022
d56c975
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 26, 2022
fbe94a4
include portfolio paths and coin class
montezdesousa Aug 26, 2022
c1f867e
Merge branch 'main' into api_next
montezdesousa Aug 26, 2022
33496d3
add crypto paths
montezdesousa Aug 26, 2022
b4a64b1
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 26, 2022
744f2a5
change event dates to str
montezdesousa Aug 26, 2022
f0d5aa3
starting economy report
montezdesousa Aug 26, 2022
566c6bc
window for limit
montezdesousa Aug 29, 2022
d9d1d8c
Merge branch 'main' into api_next
montezdesousa Aug 29, 2022
0d032b2
equity report and refactor newsapi
soggyomelette Aug 29, 2022
ad47b2c
Merge branches 'api_next' and 'api_next' of https://github.com/OpenBB…
soggyomelette Aug 29, 2022
8e946eb
add helper to api
montezdesousa Aug 29, 2022
e4b1a7f
update on economy report
montezdesousa Aug 29, 2022
882ffd1
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 29, 2022
12a59bb
equity report
soggyomelette Aug 29, 2022
4168f9a
Merge branch 'api_next' of https://github.com/OpenBB-finance/OpenBBTe…
soggyomelette Aug 29, 2022
60bdf3e
update economy report
montezdesousa Aug 29, 2022
5da49db
refactor some docstrings
montezdesousa Aug 29, 2022
87e3dbe
change maturities helper
montezdesousa Aug 29, 2022
558d4bd
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 29, 2022
c439129
refactor newsapi
montezdesousa Aug 29, 2022
109c5e7
refactor futures command
montezdesousa Aug 29, 2022
7aec840
add some sauce to ycrv plot
montezdesousa Aug 29, 2022
056bec4
black
montezdesousa Aug 29, 2022
18c20e0
update report
montezdesousa Aug 29, 2022
42c9d1b
refactor alphavantage
montezdesousa Aug 29, 2022
8fe46a9
refactor wsj
montezdesousa Aug 29, 2022
a2ece64
update economy report
montezdesousa Aug 29, 2022
01a599e
ycrv tenor
montezdesousa Aug 29, 2022
6f1cb65
map avaiable_indices
montezdesousa Aug 29, 2022
e69c7c0
map economy helpers
montezdesousa Aug 30, 2022
5a3064f
fix econdb docstring
montezdesousa Aug 30, 2022
d3a76eb
add plots on economy report
montezdesousa Aug 30, 2022
ca4418f
minor fixes
hjoaquim Aug 30, 2022
11958db
wip - crypto report
hjoaquim Aug 30, 2022
8c78b6c
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 30, 2022
b6a1190
update economy report
montezdesousa Aug 30, 2022
e3f680a
added same default args as view
hjoaquim Aug 30, 2022
5fcfda2
added view to explicity use chart=True when suing the api
hjoaquim Aug 30, 2022
394b476
adjustments - removed rich tables to use only df
hjoaquim Aug 30, 2022
2e0908e
final version economy report
montezdesousa Aug 30, 2022
7ad8e04
change report name
montezdesousa Aug 30, 2022
521308b
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
hjoaquim Aug 30, 2022
b34699f
equity report for review
soggyomelette Aug 30, 2022
7af1526
Merge branch 'api_next' of https://github.com/OpenBB-finance/OpenBBTe…
soggyomelette Aug 30, 2022
b78ad96
linting
soggyomelette Aug 30, 2022
0dfd21b
add etf symbols endpoint
montezdesousa Aug 30, 2022
f62c992
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Aug 30, 2022
31051f5
incorporate feedback economy report
montezdesousa Aug 30, 2022
69a38cc
Merge branch 'main' into api_next
JerBouma Aug 31, 2022
8817e71
fix reports launch by adding tag to economy report
soggyomelette Aug 31, 2022
ac64591
fix equity bug
soggyomelette Aug 31, 2022
9a5a77f
remove analyst name
soggyomelette Aug 31, 2022
44ef80f
fix
soggyomelette Aug 31, 2022
2a0fafe
fix news
soggyomelette Aug 31, 2022
f4accd3
make links hyperlinks for equity
soggyomelette Aug 31, 2022
717f044
click links
soggyomelette Aug 31, 2022
752ed1a
fixed arg name
hjoaquim Aug 30, 2022
c451319
improved news
hjoaquim Aug 31, 2022
86f6ae8
small improves
hjoaquim Aug 31, 2022
c9c04f8
Fix light terminal stylesheet that would prevent using it in notebook…
piiq Aug 31, 2022
03dfc57
improved report
hjoaquim Aug 31, 2022
2a83f68
run reports in installer
soggyomelette Sep 5, 2022
1abb812
Merge branch 'main' into api_next
soggyomelette Sep 5, 2022
c4f3102
fix #2209
soggyomelette Sep 5, 2022
874d868
minor ycrv refactoring
montezdesousa Sep 9, 2022
b8999d7
refactor portfolio/holdv virtual path
montezdesousa Sep 9, 2022
77d779b
refactor benchmark trades
montezdesousa Sep 9, 2022
4d3cd73
Merge branch 'main' into api_next
montezdesousa Sep 9, 2022
8774ce1
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Sep 9, 2022
182ba35
fix events args
montezdesousa Sep 9, 2022
a4b8896
adapt economy report to changes
montezdesousa Sep 9, 2022
bae4744
fix portfolio controller bug
montezdesousa Sep 9, 2022
839b220
Merge branch 'main' into api_next
hjoaquim Sep 11, 2022
f8b4016
holdv refactor
montezdesousa Sep 11, 2022
d698490
refactor perf command
montezdesousa Sep 11, 2022
591942d
start portfolio report
montezdesousa Sep 11, 2022
75b63f6
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Sep 11, 2022
af2005c
remove perf view
montezdesousa Sep 11, 2022
69da148
refactor holp
montezdesousa Sep 11, 2022
1d764ca
add textwrap3 to poetry (doesn't solve the error)
soggyomelette Sep 12, 2022
3bafe4f
Merge branch 'api_next' of https://github.com/OpenBB-finance/OpenBBTe…
soggyomelette Sep 12, 2022
403f757
fix equity after merge
soggyomelette Sep 12, 2022
41c589a
add some rolling commands
montezdesousa Sep 12, 2022
49fdba4
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Sep 12, 2022
09a7479
fix equity after save button
soggyomelette Sep 12, 2022
3acc546
Merge branch 'api_next' of https://github.com/OpenBB-finance/OpenBBTe…
soggyomelette Sep 12, 2022
acba54b
improved crypto report, plus minor fixes
hjoaquim Sep 12, 2022
5a73708
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
hjoaquim Sep 12, 2022
74a02de
minor fixes on the reports
hjoaquim Sep 12, 2022
fc38cb2
add maxdd and distr
montezdesousa Sep 12, 2022
8e1001b
add maxdd and distr
montezdesousa Sep 12, 2022
d0e6b19
Merge branch 'main' into api_next
minhhoang1023 Sep 12, 2022
fec7094
refactor qa
montezdesousa Sep 12, 2022
3da31d9
var command
montezdesousa Sep 12, 2022
f079165
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Sep 12, 2022
8a1d105
refactor qa expected shortfall
montezdesousa Sep 12, 2022
0654570
add es command
montezdesousa Sep 12, 2022
8185dd9
add es command
montezdesousa Sep 12, 2022
6f8202e
fix qa percentile bug
montezdesousa Sep 12, 2022
cf304a8
fix economy rendering
montezdesousa Sep 12, 2022
b3f13a9
refactor qa omega
montezdesousa Sep 12, 2022
2fa7162
add om command
montezdesousa Sep 12, 2022
e8e816c
add summary command
montezdesousa Sep 12, 2022
20b834d
add dret command
montezdesousa Sep 12, 2022
a28fb66
add mret command
montezdesousa Sep 12, 2022
1b131d0
add yret command
montezdesousa Sep 12, 2022
a467b65
add metrics
Sep 12, 2022
ff58a28
add allocs to report
montezdesousa Sep 12, 2022
36898a3
remove bro and po commands, add later
montezdesousa Sep 12, 2022
b9e119d
fixed some tests
hjoaquim Sep 13, 2022
40e6e8f
adjustments to crypto report
hjoaquim Sep 13, 2022
522c834
Merge branch 'main' into api_next
colin99d Sep 14, 2022
40f50b9
Fix docstring for VSCode
northern-64bit Sep 14, 2022
37a330c
minor adjustment
hjoaquim Sep 15, 2022
e7fca4f
remove nft calendar model virtual paths
montezdesousa Sep 15, 2022
abd7cf4
Add in Portfolio report
JerBouma Sep 15, 2022
5f48471
fix external axes portfolio view
montezdesousa Sep 15, 2022
9bbf547
Merge remote-tracking branch 'refs/remotes/origin/api_next' into api_…
montezdesousa Sep 15, 2022
e7f13e3
Update portfolio report with rolling plots
JerBouma Sep 15, 2022
35bfc34
Details for ETF and Portfolio
JerBouma Sep 15, 2022
6588b5a
Merge branch 'main' into api_next
minhhoang1023 Sep 15, 2022
476fbad
fix economy report
montezdesousa Sep 16, 2022
d87d7cb
change analyst to openbb
montezdesousa Sep 16, 2022
3ba3885
floppy
montezdesousa Sep 16, 2022
1b09130
fixed unmatched axis in reports
hjoaquim Sep 17, 2022
a617aac
Speed up tests
colin99d Sep 18, 2022
2566509
Merge branch 'main' of https://github.com/OpenBB-finance/OpenBBTerminal
colin99d Sep 18, 2022
9840590
Added fixes
colin99d Sep 19, 2022
6d4f8ee
fix file and load on po
montezdesousa Sep 19, 2022
374c750
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Sep 19, 2022
1d93ebb
get_news output
montezdesousa Sep 19, 2022
d6b294a
add some po paths
montezdesousa Sep 19, 2022
7579199
Add integration tests for Reports menu
minhhoang1023 Sep 19, 2022
f1eb007
Merge branch 'api_next' of github.com:GamestonkTerminal/GamestonkTerm…
minhhoang1023 Sep 19, 2022
71d2cbb
Merge branch 'main' into api_next
minhhoang1023 Sep 19, 2022
0776bd4
refactor maxsharpe
montezdesousa Sep 19, 2022
76d9b8d
open maxsharpe
montezdesousa Sep 19, 2022
5e08ad6
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Sep 19, 2022
544529b
open minrisk
montezdesousa Sep 19, 2022
f46bc2d
open maxutil
montezdesousa Sep 19, 2022
1eddd64
open maxret
montezdesousa Sep 19, 2022
12617bb
Added fixes
colin99d Sep 19, 2022
38165d3
Merge branch 'api_next' of https://github.com/OpenBB-finance/OpenBBTe…
colin99d Sep 19, 2022
0b66a5d
black
montezdesousa Sep 19, 2022
732280a
remove useless views
montezdesousa Sep 19, 2022
434bd40
Fixed small issue
colin99d Sep 19, 2022
940ce00
refactor ef
montezdesousa Sep 19, 2022
ea94c83
open ef api
montezdesousa Sep 19, 2022
a9daa5a
portfolio optimization report
montezdesousa Sep 19, 2022
68cc1aa
pull api_next
montezdesousa Sep 19, 2022
1e52a8d
Added fixes
colin99d Sep 19, 2022
06eea0d
Merged
colin99d Sep 19, 2022
efe97cd
unblock api loading
montezdesousa Sep 19, 2022
c553202
add more endpoints
montezdesousa Sep 19, 2022
ad1aa7d
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Sep 19, 2022
c0c40bb
update po report
montezdesousa Sep 19, 2022
aa3cd62
unblock api loading
montezdesousa Sep 19, 2022
510f0f9
update po report
montezdesousa Sep 19, 2022
90a98ab
expose herc
montezdesousa Sep 19, 2022
897bf5a
expose property endpoint
montezdesousa Sep 19, 2022
6331c35
Added fixes
colin99d Sep 19, 2022
f5a57bf
Merge branch 'api_next' of https://github.com/OpenBB-finance/OpenBBTe…
colin99d Sep 19, 2022
fc4d311
More api fixes
colin99d Sep 19, 2022
7d38dfe
flake8
montezdesousa Sep 19, 2022
633f700
Fixed some mypy
colin99d Sep 19, 2022
75c22b0
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Sep 19, 2022
6ac7740
Merge branch 'api_next' of github.com:OpenBB-finance/OpenBBTerminal i…
montezdesousa Sep 19, 2022
e90c477
news api model
montezdesousa Sep 19, 2022
c992258
flake8
montezdesousa Sep 19, 2022
1a25175
mypy fix
montezdesousa Sep 19, 2022
21269f4
mypy
montezdesousa Sep 19, 2022
da32d3e
black
montezdesousa Sep 19, 2022
2cdbc2d
pylint
montezdesousa Sep 19, 2022
a126e3c
fix tests
montezdesousa Sep 19, 2022
71fba10
markdown
montezdesousa Sep 19, 2022
51ad9ce
markdown
montezdesousa Sep 19, 2022
74e21d3
Added fixes
colin99d Sep 20, 2022
8ae0e3f
Merge branch 'api_next' of https://github.com/OpenBB-finance/OpenBBTe…
colin99d Sep 20, 2022
8fcba0a
fix economy report
montezdesousa Sep 20, 2022
399b687
merge
montezdesousa Sep 20, 2022
3bfb7d2
merge fix
montezdesousa Sep 20, 2022
dcfc196
fix economy report
montezdesousa Sep 20, 2022
ef9ae81
remove empty notebook
montezdesousa Sep 20, 2022
7eefc57
expose nco
montezdesousa Sep 20, 2022
eb7c2f0
remove jupyter notebook
montezdesousa Sep 20, 2022
0073980
expose plot endpoint
montezdesousa Sep 20, 2022
679beb3
remove po report, just used for tests
montezdesousa Sep 20, 2022
b2cd025
api v paths plot
montezdesousa Sep 20, 2022
56cc1cf
remove api_old
montezdesousa Sep 20, 2022
21bfc10
change loading msg
montezdesousa Sep 20, 2022
f340fa2
Merge branch 'main' into api_next
Chavithra Sep 20, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- run: pip install types-pytz types-requests types-termcolor types-tabulate types-PyYAML types-python-dateutil types-setuptools types-six
- run: bandit -x ./tests -r . || true
- run: black --diff --check .
- run: codespell --ignore-words-list=commun,ro,zar,zlot,ba,buil,coo,ether,hist,hsi,mape,navagation,operatio,pres,ser,yeld,shold,ist,varian,datas,ake,creat,vie,hel --quiet-level=2 --skip=./tests,.git,*.css,*.csv,*.html,*.ini,*.ipynb,*.js,*.json,*.lock,*.scss,*.txt,*.yaml,./build/pyinstaller
- run: codespell --ignore-words-list=commun,statics,ro,zar,zlot,ba,buil,coo,ether,hist,hsi,mape,navagation,operatio,pres,ser,yeld,shold,ist,varian,datas,ake,creat,vie,hel --quiet-level=2 --skip=./tests,.git,*.css,*.csv,*.html,*.ini,*.ipynb,*.js,*.json,*.lock,*.scss,*.txt,*.yaml,./build/pyinstaller
- run: flake8 . --count --ignore=E203,W503 --max-line-length=122 --show-source --statistics --exclude ./build/pyinstaller
- run: mypy --ignore-missing-imports --exclude="/setup\.py$" .
- run: shopt -s globstar && pyupgrade --py38-plus **/*.py
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ repos:
entry: codespell
args:
[
"--ignore-words-list=commun,ro,zar,vie,hel,zlot,ba,buil,coo,ether,hist,hsi,mape,navagation,operatio,pres,ser,yeld,shold,ist,varian,datas,ake,creat",
"--ignore-words-list=commun,ro,zar,vie,hel,zlot,ba,buil,coo,ether,hist,hsi,mape,navagation,operatio,pres,ser,yeld,shold,ist,varian,datas,ake,creat,statics",
"--quiet-level=2",
"--skip=./tests,.git,*.css,*.csv,*.html,*.ini,*.ipynb,*.js,*.json,*.lock,*.scss,*.txt,*.yaml,build/pyinstaller/*",
]
Expand Down
101 changes: 73 additions & 28 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,35 @@ Use your best judgment, and feel free to propose changes to this document in a p

[Development Process](#development-process)

- [How Can I Contribute?](#how-can-i-contribute)
- [Community](#community)
- [Retail Trader](#retail-trader)
- [Software Developer](#software-developer)
- [Development Process](#development-process)
- [Select Feature](#select-feature)
- [Understand Code Structure](#understand-code-structure)
- [Follow Coding Guidelines](#follow-coding-guidelines)
- [Model](#model)
- [View](#view)
- [Controller](#controller)
- [Remember Coding Style](#remember-coding-style)
- [Naming Convention](#naming-convention)
- [Docstrings](#docstrings)
- [Linters](#linters)
- [Write Code and Commit](#write-code-and-commit)
- [Pre Commit Hooks](#pre-commit-hooks)
- [Coding](#coding)
- [Git Process](#git-process)
- [Add a Test](#add-a-test)
- [Pytest](#pytest)
- [Coverage](#coverage)
- [VCR](#vcr)
- [Add Documentation](#add-documentation)
- [Add support for a new language](#add-support-for-a-new-language)
- [Open a Pull Request](#open-a-pull-request)
- [Review Process](#review-process)
- [CONTRIBUTING](#contributing)
- [How Can I Contribute?](#how-can-i-contribute)
- [Community](#community)
- [Retail Trader](#retail-trader)
- [Software Developer](#software-developer)
- [Development Process](#development-process)
- [Select Feature](#select-feature)
- [Understand Code Structure](#understand-code-structure)
- [Follow Coding Guidelines](#follow-coding-guidelines)
- [Model](#model)
- [View](#view)
- [Controller](#controller)
- [API](#api)
- [Remember Coding Style](#remember-coding-style)
- [Naming Convention](#naming-convention)
- [Docstrings](#docstrings)
- [Linters](#linters)
- [Write Code and Commit](#write-code-and-commit)
- [Pre Commit Hooks](#pre-commit-hooks)
- [Coding](#coding)
- [Git Process](#git-process)
- [Add a Test](#add-a-test)
- [Pytest](#pytest)
- [Coverage](#coverage)
- [VCR](#vcr)
- [Add Documentation](#add-documentation)
- [Add support for a new language](#add-support-for-a-new-language)
- [Open a Pull Request](#open-a-pull-request)
- [Review Process](#review-process)

## How Can I Contribute?

Expand Down Expand Up @@ -370,9 +372,52 @@ def call_shorted(self, other_args: List[str]):
num_stocks=ns_parser.num,
export=ns_parser.export,
)

```

### API

In order to add a command to the API, follow these steps:

1. Go to the `api.py` file and scroll to the `functions` dictionary, it should look like this:

```python
functions = {
"stocks.get_news": {
"model": "openbb_terminal.common.newsapi_model.get_news",
},
"stocks.load": {
"model": "openbb_terminal.stocks.stocks_helper.load",
},
"stocks.candle": {
"model": "openbb_terminal.stocks.stocks_helper.load",
"view": "openbb_terminal.stocks.stocks_helper.display_candle",
},

...
```

2. Add a new key to the dictionary, which corresponds to the way the added command shall be accessed from the api.
This is called the `virtual path`. In this case it should be `stocks.dps.shorted`.
3. Now it is time to add the value to the key. This key shall be another dictionary with a `model` key and possibly a
`view` key.
1. The model keys value should be the path from project root to the new commands model function as a string. This
case it is `openbb_terminal.stocks.dark_pool_shorts.yahoofinance_model.get_most_shorted`.
2. If and **only if** the view function of the command **displays a chart**, then the `view` key and its value is
the view functions path from the project root as a string. In this example the view function of the only prints a
table and thus this step can be ignored.
4. Done!!! The final new dictionary looks like this after the added example:

```python
functions = {
...

"stocks.dps.shorted": {
"model": "openbb_terminal.stocks.dark_pool_shorts.yahoofinance_model.get_most_shorted",
},

...
```

## Remember Coding Style

When in doubt, follow <https://www.python.org/dev/peps/pep-0008/>.
Expand Down
113 changes: 113 additions & 0 deletions openbb_terminal/API_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# OpenBB API

## Usage

The OpenBB API can simply be imported with:

```python
from openbb_terminal.api import openbb
```

This imports all the commands at once. Now you can directly begin to use it. The api function is structured
in the way that it always retrieves the underlying data. For charts add the `chart=True` parameter.

For example see:

```python
# Returns data:
openbb.stocks.ba.snews("aapl")
# Returns charts:
openbb.stocks.ba.snews("aapl", chart=True)
```

This allows easy integration to the jupyter notebook and allows you to build new applications on top of the terminal.
The api also has new functionalities that are used in the backend of the Terminal (CLI). With these backend functions
you can develop new functionalities and avoid copy-pasting the code from the repository.

**Note:**\
API keys for data fetching still have to be entered

### Jupyter Notebook Tricks

**Get matplotlib charts in the output cells**\
If you copy-paste the code below and use it as your initialization then you're matplotlib graphs will be inside
the result cell.

```python
import matplotlib.pyplot as plt
import matplotlib_inline.backend_inline
from openbb_terminal.api import openbb
%matplotlib inline
matplotlib_inline.backend_inline.set_matplotlib_formats("svg")
```

**Get function signature and docstring**\
When you press `shift + tab` in jupyter notebook while having the mouse parser in an API function, you get the
signature and docstring of the function.

### Visual Studio Code Tricks

**Get function docstring and signature**\
In order to get the docstrings and function signatures for the API when opening a Jupyter Notebook in VSCode,
you have to install the [Jupyter PowerToys
extension](https://marketplace.visualstudio.com/items?itemName=ms-toolsai.vscode-jupyter-powertoys).

## Code Examples

Just copy-paste the code examples below into a python script or jupyter notebook, and you're ready to go.

**Basic Stock Information**\
Prints general information about the selected stock (in this case Gamsetop)

```python
from openbb_terminal.api import openbb
gme_info = openbb.stocks.fa.info("gme").transpose()
print("-- Gamstop Stock --\n\n- Basic Info -")
print(f"Sector: {gme_info['Sector'].iloc[0]}")
print(f"Country: {gme_info['Country'].iloc[0]}")
print(f"Description: {gme_info['Long business summary'].iloc[0]}")
print("\n- Financial Info -")
print(f"Ebitda Margins: {gme_info['Ebitda margins'].iloc[0]}")
print(f"Profit Margins: {gme_info['Profit margins'].iloc[0]}")
print(f"Revenue growth: {gme_info['Revenue growth'].iloc[0]}")
print("\n- Target Price -")
print(f"Current price: {gme_info['Current price'].iloc[0]}")
print(f"Target mean price: {gme_info['Target mean price'].iloc[0]}")
print(f"Target high price: {gme_info['Target high price'].iloc[0]}")
print(f"Target low price: {gme_info['Target low price'].iloc[0]}")
```

**Use external axis**\
The code below utilises the `external_axes` parameter to get two axis in one chart

```python
import matplotlib.pyplot as plt
from openbb_terminal.api import openbb
fig, (ax1, ax2) = plt.subplots(nrows=2, ncols=1, figsize=(11, 5), dpi=150)
openbb.stocks.dps.dpotc(
"aapl",
external_axes=[ax1, ax2],
chart=True,
)
fig.tight_layout()
```

**Stocks Return Distribution** \
Fetches data from the OpenBB API and then plots the return distribution. This is a good example, where the data from
the API is leveraged to build a new feature on top of the API.

```python
import numpy as np
import matplotlib.pyplot as plt
from openbb_terminal.api import openbb
# Fetches data from the api
gme = openbb.stocks.load("gme")
# Calculates logarithmic returns
gme["Log Returns"] = np.log(gme["Adj Close"]/gme["Adjusted Close"].shift(1))
# Plots the return distributions
gme["Log Returns"].hist(bins=1000)
plt.thight_layout()
plt.show()
```

For more examples see the OpenBB jupyter notebook reports. They all use the API to its fullest extent!
1 change: 1 addition & 0 deletions openbb_terminal/alternative/alt_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

# Context menus
from .covid import covid_api as covid
from .oss import oss_api as oss
2 changes: 1 addition & 1 deletion openbb_terminal/alternative/covid/covid_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from openbb_terminal.alternative.covid.covid_view import display_covid_ov as ov
from openbb_terminal.alternative.covid.covid_view import display_covid_stat as stat
from openbb_terminal.alternative.covid.covid_view import (
display_country_slopes as slopes,
display_case_slopes as slopes,
)


Expand Down
2 changes: 1 addition & 1 deletion openbb_terminal/alternative/covid/covid_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def call_slopes(self, other_args: List[str]):
parser, other_args, export_allowed=EXPORT_ONLY_RAW_DATA_ALLOWED, limit=10
)
if ns_parser:
covid_view.display_country_slopes(
covid_view.display_case_slopes(
days_back=ns_parser.days,
limit=ns_parser.limit,
ascend=ns_parser.ascend,
Expand Down
83 changes: 76 additions & 7 deletions openbb_terminal/alternative/covid/covid_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pandas as pd

from openbb_terminal.decorators import log_start_end
from openbb_terminal.rich_config import console

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -80,37 +81,105 @@ def get_global_deaths(country: str) -> pd.DataFrame:


@log_start_end(log=logger)
def get_case_slopes(days_back: int = 30, threshold: int = 10000) -> pd.DataFrame:
def get_covid_ov(
country,
limit: int = 100,
) -> pd.DataFrame:
"""Get historical cases and deaths by country

Parameters
----------
country: str
Country to get data for
limit: int
Number of raw data to show
"""
cases = get_global_cases(country)
deaths = get_global_deaths(country)
data = pd.concat([cases, deaths], axis=1)
data.columns = ["Cases", "Deaths"]
data.index = [x.strftime("%Y-%m-%d") for x in data.index]
return data.tail(limit)


@log_start_end(log=logger)
def get_covid_stat(
country,
stat: str = "cases",
limit: int = 10,
) -> pd.DataFrame:
"""Show historical cases and deaths by country

Parameters
----------
country: str
Country to get data for
stat: str
Statistic to get. Either "cases", "deaths" or "rates"
limit: int
Number of raw data to show
"""
if stat == "cases":
data = get_global_cases(country)
elif stat == "deaths":
data = get_global_deaths(country)
elif stat == "rates":
cases = get_global_cases(country)
deaths = get_global_deaths(country)
data = (deaths / cases).fillna(0) * 100
else:
console.print("Invalid stat selected.\n")
return pd.DataFrame()
data.index = [x.strftime("%Y-%m-%d") for x in data.index]
return data.tail(limit)


@log_start_end(log=logger)
def get_case_slopes(
days_back: int = 30,
limit: int = 50,
threshold: int = 10000,
ascend: bool = False,
) -> pd.DataFrame:
"""Load cases and find slope over period

Parameters
----------
days_back: int
Number of historical days to consider
limit: int
Number of rows to show
threshold: int
Threshold for total number of cases
ascend: bool
Flag to sort in ascending order
Returns
-------
pd.DataFrame
Dataframe containing slopes
"""
# Ignore the pandas warning for setting a slace with a value
warnings.filterwarnings("ignore")
cases = pd.read_csv(global_cases_time_series)
cases = cases.rename(columns={"Country/Region": "Country"})
cases = (
data = pd.read_csv(global_cases_time_series)
data = data.rename(columns={"Country/Region": "Country"})
data = (
(
cases.drop(columns=["Province/State", "Lat", "Long"])
data.drop(columns=["Province/State", "Lat", "Long"])
.groupby("Country")
.agg("sum")
)
.diff()
.dropna()
)
hist = cases.iloc[:, -days_back:]
hist = data.iloc[:, -days_back:]
hist["Sum"] = hist.sum(axis=1)
hist = hist[hist.Sum > threshold].drop(columns="Sum")
hist["Slope"] = hist.apply(
lambda x: np.polyfit(np.arange(days_back), x, 1)[0], axis=1
)
return pd.DataFrame(hist["Slope"])
hist_slope = pd.DataFrame(hist["Slope"])
if ascend:
hist_slope.sort_values(by="Slope", ascending=ascend, inplace=True)
else:
hist_slope.sort_values(by="Slope", ascending=ascend, inplace=True)
return hist_slope.head(limit)
Loading