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

Here we merge all API Refactor related branches #2236

Merged
merged 104 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
43f07e1
Update api.py
Chavithra Aug 2, 2022
3d3fa17
Updated forex menu
colin99d Aug 4, 2022
d0ea930
Merge branch 'main' into api-refactor
colin99d Aug 4, 2022
922953f
refactor ycrv command
montezdesousa Aug 4, 2022
4794041
refactor ycrv command black
montezdesousa Aug 4, 2022
01fb27c
refactor ecocal command
montezdesousa Aug 4, 2022
154c17e
Minh changes
colin99d Aug 4, 2022
3296473
Adding space to test pushing
simmonsj330 Aug 5, 2022
611feaa
Merge branch 'api-refactor' of github.com:OpenBB-finance/OpenBBTermin…
montezdesousa Aug 5, 2022
575d6c4
title fix ecocal df
montezdesousa Aug 5, 2022
224bdab
get economic calendar annotation
montezdesousa Aug 5, 2022
4e0a1c4
fix investingcom tests
montezdesousa Aug 5, 2022
8fff9ee
Merge branch 'main' into api-refactor
piiq Aug 5, 2022
ca1242b
refactor index command
montezdesousa Aug 5, 2022
1505192
refactor overview command
montezdesousa Aug 5, 2022
7c273b9
give defaults to wsj view function args
montezdesousa Aug 5, 2022
d5eb50f
rename date args investincom
montezdesousa Aug 5, 2022
650cc8c
refacto bigmac command
montezdesousa Aug 5, 2022
19fcfae
fix ecocal typo
montezdesousa Aug 5, 2022
c75421a
refactor rtps command
montezdesousa Aug 5, 2022
607af48
alphavantage gdp
montezdesousa Aug 5, 2022
25ef983
alphavantage gdp per capita
montezdesousa Aug 5, 2022
1344d26
alphavantage cpi
montezdesousa Aug 5, 2022
a10cc6b
alphavantage tyld
montezdesousa Aug 5, 2022
94836e8
alphavantage inf
montezdesousa Aug 5, 2022
864af4a
Merge branch 'main' into api-refactor
minhhoang1023 Aug 5, 2022
2910bb0
refactor macro command
montezdesousa Aug 7, 2022
76ac39b
refactor macro command w helpers
montezdesousa Aug 8, 2022
cca3139
Merge branch 'api-refactor' of github.com:OpenBB-finance/OpenBBTermin…
montezdesousa Aug 8, 2022
b43b16a
refactor treasury command
montezdesousa Aug 8, 2022
adccf12
fix macro on terminal
montezdesousa Aug 8, 2022
f5317a1
treasury labels
montezdesousa Aug 8, 2022
9d15686
refactor maturities
montezdesousa Aug 8, 2022
378e016
update treasury maturities doc strings
montezdesousa Aug 8, 2022
dc0acdb
refactor get economic calendar finhub
montezdesousa Aug 8, 2022
ee0fb92
refactor map command api
montezdesousa Aug 8, 2022
94edd0c
display map filter choices
montezdesousa Aug 8, 2022
73448df
route economy api to performance map
montezdesousa Aug 8, 2022
dec0907
route economy api to performance map
montezdesousa Aug 8, 2022
82769c6
display group choices on valuation command
montezdesousa Aug 8, 2022
09c7518
refactor performance and valuation commands
montezdesousa Aug 8, 2022
12d2e6c
refactor spectrum model and view
montezdesousa Aug 8, 2022
07f9c68
add choices to spectrum controller
montezdesousa Aug 8, 2022
5062762
delete image after view
montezdesousa Aug 8, 2022
dc686c6
fix model tests finviz
montezdesousa Aug 8, 2022
368fd3d
fix finciz view tests
montezdesousa Aug 8, 2022
ed3ae04
refactor futures
montezdesousa Aug 8, 2022
b79b79f
fix some tests
montezdesousa Aug 8, 2022
51bbb39
Merge branch 'main' into api-refactor
colin99d Aug 8, 2022
9c49aa6
fix more tests
montezdesousa Aug 8, 2022
b55ce01
fix controller test
montezdesousa Aug 9, 2022
2f9d879
refactor fred series notes
montezdesousa Aug 9, 2022
e244833
update fred notes docstring
montezdesousa Aug 9, 2022
e5e961b
refacto fred series ids
montezdesousa Aug 9, 2022
cc067fa
Merge branch 'main' into api-refactor
Chavithra Aug 9, 2022
efd933c
fix pred and qa when empty datasets
montezdesousa Aug 9, 2022
8221144
refactor fred
montezdesousa Aug 9, 2022
eb20a08
uncomment stuff
montezdesousa Aug 9, 2022
f22d9d8
refacto get series data
montezdesousa Aug 9, 2022
48a848c
fix some tests
montezdesousa Aug 9, 2022
eee8f5c
set defaults on args
montezdesousa Aug 9, 2022
d5d53d2
refactor fred yield curve
montezdesousa Aug 9, 2022
3e85ba5
fix merge conflicts
montezdesousa Aug 9, 2022
fdd55d2
black
montezdesousa Aug 9, 2022
36e7a44
fix spell and remove ecocal names
montezdesousa Aug 9, 2022
5223f08
fix linting
montezdesousa Aug 9, 2022
83860a8
linting
montezdesousa Aug 9, 2022
cf205a9
Merge branch 'main' into api-refactor
colin99d Aug 9, 2022
d53613e
pylint fix
montezdesousa Aug 9, 2022
1c1489c
Merge branch 'api-refactor' of github.com:OpenBB-finance/OpenBBTermin…
montezdesousa Aug 9, 2022
4affd8d
change dangerous defaults
montezdesousa Aug 9, 2022
d7d7352
Merge branch 'main' into api-refactor
colin99d Aug 9, 2022
4740740
Merge branch 'main' into api-refactor
colin99d Aug 9, 2022
b270703
Merge branch 'main' into api-refactor
jose-donato Aug 10, 2022
ed8fdbe
Working through crypto fixes (#2256)
colin99d Aug 10, 2022
d282cf1
Merge branch 'main' into api-refactor
montezdesousa Aug 11, 2022
14ee0ca
map get groups and get ycrv countries into old api
montezdesousa Aug 11, 2022
fee5f6c
exposed econdb helper funcs
montezdesousa Aug 11, 2022
d908403
remove helpers
montezdesousa Aug 11, 2022
ed09fc2
refactor search indices
montezdesousa Aug 11, 2022
8591161
linting
montezdesousa Aug 11, 2022
e6f82cf
Merge branch 'main' of github.com:OpenBB-finance/OpenBBTerminal into …
Chavithra Aug 12, 2022
acbac1b
refactor arg currency
montezdesousa Aug 12, 2022
a1dd34f
pylint from currency
montezdesousa Aug 12, 2022
7c8c750
Started switching crpyto ascending to ascend
colin99d Aug 12, 2022
20d729e
Merging
colin99d Aug 12, 2022
1a78eb6
Merging
colin99d Aug 12, 2022
5113cd0
Portfolio model arguements, params, and docstring
simmonsj330 Aug 15, 2022
30fe24d
Refactored for etf commands (#2292)
colin99d Aug 15, 2022
02d8abf
Portfolio logic fixes
simmonsj330 Aug 16, 2022
315e118
Added econometrics (#2260)
colin99d Aug 16, 2022
032acf8
Fund refactor (#2291)
colin99d Aug 16, 2022
c5aae1e
Merge branch 'main' into api-refactor
colin99d Aug 16, 2022
63baea0
Stock menu refactoring for easier API usage (#2194)
northern-64bit Aug 17, 2022
ededf9f
fix portfolio tests
montezdesousa Aug 17, 2022
1264463
change period to window
montezdesousa Aug 17, 2022
d1e2a73
update ca docstrings
montezdesousa Aug 17, 2022
5c26ef9
refactor get_similar_companies func
montezdesousa Aug 17, 2022
07cce3a
Fixed
colin99d Aug 17, 2022
69298ed
Merge branch 'api-refactor' of https://github.com/OpenBB-finance/Open…
colin99d Aug 17, 2022
07dbee2
Update CI
Chavithra Aug 17, 2022
0f80d07
Update CI 2
Chavithra Aug 17, 2022
15d9145
Update CI 3
Chavithra Aug 17, 2022
18712ac
Update dependencies
piiq Aug 17, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ jobs:
uses: actions/cache@v2
with:
path: ~/conda_pkgs_dir
key: conda-${{ runner.os }}-v1-${{ matrix.python }}-${{ hashFiles('build/conda/conda-3-9-env.yaml') }}
key: conda-${{ runner.os }}-v1-${{ matrix.python }}-${{ hashFiles('build/conda/conda-3-9-env-full.yaml') }}

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2
Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-v1-3-9-pip-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-v1-3-9-pip-${{ hashFiles('requirements-full.txt') }}
restore-keys: |
${{ runner.os }}-v1-pip-

Expand Down
1 change: 1 addition & 0 deletions openbb_terminal/alternative/covid/covid_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
)
from openbb_terminal.rich_config import console


logger = logging.getLogger(__name__)


Expand Down
1 change: 1 addition & 0 deletions openbb_terminal/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
from .portfolio import portfolio_api as portfolio
from .reports import widget_helpers as widgets


from .config_terminal import theme
8 changes: 4 additions & 4 deletions openbb_terminal/common/behavioural_analysis/finbrain_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@


@log_start_end(log=logger)
def get_sentiment(ticker: str) -> pd.DataFrame:
def get_sentiment(symbol: str) -> pd.DataFrame:
"""Gets Sentiment analysis provided by FinBrain's API [Source: finbrain]

Parameters
----------
ticker : str
Ticker to get the sentiment analysis from
symbol : str
Ticker symbol to get the sentiment analysis from

Returns
-------
DataFrame()
Empty if there was an issue with data retrieval
"""
result = requests.get(f"https://api.finbrain.tech/v0/sentiments/{ticker}")
result = requests.get(f"https://api.finbrain.tech/v0/sentiments/{symbol}")
sentiment = pd.DataFrame()
if result.status_code == 200:
result_json = result.json()
Expand Down
16 changes: 8 additions & 8 deletions openbb_terminal/common/behavioural_analysis/finbrain_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def lambda_sentiment_coloring(val: float, last_val: float) -> str:

@log_start_end(log=logger)
def display_sentiment_analysis(
ticker: str,
symbol: str,
raw: bool = False,
export: str = "",
external_axes: Optional[List[plt.Axes]] = None,
Expand All @@ -43,16 +43,16 @@ def display_sentiment_analysis(

Parameters
----------
ticker : str
Ticker to get the sentiment analysis from
raw : False
symbol: str
Ticker symbol to get the sentiment analysis from
raw: False
Display raw table data
export : str
export: str
Format to export data
external_axes : Optional[List[plt.Axes]], optional
external_axes: Optional[List[plt.Axes]], optional
External axes (1 axis is expected in the list), by default None
"""
sentiment = finbrain_model.get_sentiment(ticker)
sentiment = finbrain_model.get_sentiment(symbol)
if sentiment.empty:
console.print("No sentiment data found.\n")
return
Expand Down Expand Up @@ -83,7 +83,7 @@ def display_sentiment_analysis(
ax.set_ylabel("Sentiment")
start_date = sentiment.index[-1].strftime("%Y/%m/%d")
ax.set_title(
f"FinBrain's Sentiment Analysis for {ticker.upper()} since {start_date}"
f"FinBrain's Sentiment Analysis for {symbol.upper()} since {start_date}"
)
ax.set_ylim([-1.1, 1.1])
senValues = np.array(pd.to_numeric(sentiment["Sentiment Analysis"].values))
Expand Down
36 changes: 18 additions & 18 deletions openbb_terminal/common/behavioural_analysis/google_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,77 +12,77 @@


@log_start_end(log=logger)
def get_mentions(ticker: str) -> pd.DataFrame:
def get_mentions(symbol: str) -> pd.DataFrame:
"""Get interest over time from google api [Source: google]

Parameters
----------
ticker : str
Stock ticker
symbol: str
Stock ticker symbol

Returns
-------
pd.DataFrame
Dataframe of interest over time
"""
pytrend = TrendReq()
pytrend.build_payload(kw_list=[ticker])
pytrend.build_payload(kw_list=[symbol])
return pytrend.interest_over_time()


@log_start_end(log=logger)
def get_regions(ticker: str) -> pd.DataFrame:
def get_regions(symbol: str) -> pd.DataFrame:
"""Get interest by region from google api [Source: google]

Parameters
----------
ticker : str
Ticker to look at
symbol: str
Ticker symbol to look at

Returns
-------
pd.DataFrame
Dataframe of interest by region
"""
pytrend = TrendReq()
pytrend.build_payload(kw_list=[ticker])
return pytrend.interest_by_region()
pytrend.build_payload(kw_list=[symbol])
return pytrend.interest_by_region().sort_values([symbol], ascending=False)


@log_start_end(log=logger)
def get_queries(ticker: str) -> pd.DataFrame:
def get_queries(symbol: str) -> pd.DataFrame:
"""Get related queries from google api [Source: google]

Parameters
----------
ticker : str
Stock ticker to compare
symbol: str
Stock ticker symbol to compare

Returns
-------
pd.DataFrame
Dataframe of related queries
"""
pytrend = TrendReq()
pytrend.build_payload(kw_list=[ticker])
pytrend.build_payload(kw_list=[symbol])
return pytrend.related_queries()


@log_start_end(log=logger)
def get_rise(ticker: str) -> pd.DataFrame:
def get_rise(symbol: str) -> pd.DataFrame:
"""Get top rising related queries with this stock's query [Source: google]

Parameters
----------
ticker : str
Stock ticker
symbol: str
Stock ticker symbol

Returns
-------
pd.DataFrame
Dataframe containing rising related queries
"""
pytrend = TrendReq()
pytrend.build_payload(kw_list=[ticker])
pytrend.build_payload(kw_list=[symbol])
df_related_queries = pytrend.related_queries()
return df_related_queries[ticker]["rising"]
return df_related_queries[symbol]["rising"]
Loading