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

Copy paste all the sheet names #4035

Merged
merged 47 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
e4dc47b
bump
jmaslek Jan 17, 2023
5987e9a
Merge branch 'develop' of https://github.com/OpenBB-finance/OpenBBTer…
jmaslek Jan 18, 2023
337ab05
Merge branch 'develop' of https://github.com/OpenBB-finance/OpenBBTer…
jmaslek Jan 19, 2023
0cc8f2d
Merge branch 'develop' of https://github.com/OpenBB-finance/OpenBBTer…
jmaslek Jan 21, 2023
42f3e25
Merge branch 'develop' of https://github.com/OpenBB-finance/OpenBBTer…
jmaslek Jan 22, 2023
284e343
Update ALL the exports with sheet name option
Jan 23, 2023
0e217d5
Update contributing too
Jan 23, 2023
82e2455
Add in sheet name to each docstring
Jan 23, 2023
f205113
Update tests
Jan 23, 2023
df03f93
Fix the small things for tests
Jan 23, 2023
9b7bd13
Converting CONTRIBUTING.md back since I put minimal changes in and it…
Jan 23, 2023
dd7fbb0
Merge branch 'develop' into feature/sheets-copy-pasting
JerBouma Jan 23, 2023
edd0f38
Fix terminal exit after `--sort p/e` (#4013)
montezdesousa Jan 23, 2023
17f5558
fix: small typo (#4036)
jose-donato Jan 24, 2023
52bd74b
fix income comparison error (#4029)
tehcoderer Jan 24, 2023
973bf82
Update tests due to yfinance error
Jan 24, 2023
59d4bf0
Merge branch 'develop' into feature/sheets-copy-pasting
JerBouma Jan 24, 2023
4e06eb7
I broke tests and fixed them
Jan 24, 2023
c7162ab
Fix tests?
Jan 24, 2023
3667998
Missed a few sheet name additions
Jan 24, 2023
6954b99
missed one more
Jan 24, 2023
4ab0931
Fix some missing sheet_name parameters
Jan 24, 2023
3cd765c
Fix a test I broke
Jan 24, 2023
0d5d589
Update tests due to changes with sheet_name
Jan 25, 2023
23b1542
Merge branch 'develop' into feature/sheets-copy-pasting
JerBouma Jan 25, 2023
17b6206
Merge branch 'develop' of https://github.com/OpenBB-finance/OpenBBTer…
jmaslek Jan 25, 2023
19dae59
Update stocks and common
Jan 26, 2023
3c1f237
Mutual funds just because
Jan 26, 2023
5b18b97
Portfolio update
Jan 26, 2023
9b7460d
Update Forecast
Jan 26, 2023
76545b4
Update Futures
Jan 26, 2023
a722360
Update ETF
Jan 26, 2023
61608ba
Update Economy
Jan 26, 2023
147bfe7
Update Crypto
Jan 26, 2023
80c5b6e
Update others
Jan 26, 2023
6b6581b
Merge branch 'develop' into feature/sheets-copy-pasting
JerBouma Jan 26, 2023
b021eaf
Update documentation to explain --sheet-name
JerBouma Jan 26, 2023
b8ce050
It should be None test
Jan 26, 2023
bbda923
Add None for sheet_name since empty string can result in errors
Jan 26, 2023
8293a74
Formatting
Jan 26, 2023
ae944c8
Fix tests
Jan 26, 2023
ab54ec0
Update documentation
Jan 26, 2023
07cb0e2
Also update the image
JerBouma Jan 26, 2023
94703e9
Merge branch 'develop' of https://github.com/OpenBB-finance/OpenBBTer…
jmaslek Jan 26, 2023
f47261a
Merge branch 'develop' of https://github.com/OpenBB-finance/OpenBBTer…
jmaslek Jan 26, 2023
afb9bfe
merge changes
jmaslek Jan 26, 2023
f849ce6
Add back to options commands
jmaslek Jan 26, 2023
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
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion openbb_terminal/alternative/alt_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,10 @@ def call_hn(self, other_args: List[str]):
)

if ns_parser:
hackernews_view.display_stories(limit=ns_parser.limit)
hackernews_view.display_stories(
limit=ns_parser.limit,
export=ns_parser.export,
sheet_name=" ".join(ns_parser.sheet_name)
if ns_parser.sheet_name
else None,
)
16 changes: 16 additions & 0 deletions openbb_terminal/alternative/covid/covid_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ def call_ov(self, other_args: List[str]):
raw=ns_parser.raw,
limit=ns_parser.limit,
export=ns_parser.export,
sheet_name=" ".join(ns_parser.sheet_name)
if ns_parser.sheet_name
else None,
)

@log_start_end(log=logger)
Expand All @@ -150,6 +153,9 @@ def call_rates(self, other_args: List[str]):
raw=ns_parser.raw,
limit=ns_parser.limit,
export=ns_parser.export,
sheet_name=" ".join(ns_parser.sheet_name)
if ns_parser.sheet_name
else None,
)

@log_start_end(log=logger)
Expand All @@ -175,6 +181,9 @@ def call_deaths(self, other_args: List[str]):
raw=ns_parser.raw,
limit=ns_parser.limit,
export=ns_parser.export,
sheet_name=" ".join(ns_parser.sheet_name)
if ns_parser.sheet_name
else None,
)

@log_start_end(log=logger)
Expand All @@ -200,6 +209,9 @@ def call_cases(self, other_args: List[str]):
raw=ns_parser.raw,
limit=ns_parser.limit,
export=ns_parser.export,
sheet_name=" ".join(ns_parser.sheet_name)
if ns_parser.sheet_name
else None,
)

@log_start_end(log=logger)
Expand Down Expand Up @@ -251,4 +263,8 @@ def call_slopes(self, other_args: List[str]):
limit=ns_parser.limit,
ascend=ns_parser.reverse,
threshold=ns_parser.threshold,
export=ns_parser.export,
sheet_name=" ".join(ns_parser.sheet_name)
if ns_parser.sheet_name
else None,
)
25 changes: 23 additions & 2 deletions openbb_terminal/alternative/covid/covid_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def display_covid_ov(
raw: bool = False,
limit: int = 10,
export: str = "",
sheet_name: str = None,
plot: bool = True,
) -> None:
"""Prints table showing historical cases and deaths by country.
Expand All @@ -145,6 +146,8 @@ def display_covid_ov(
Flag to display raw data
limit: int
Number of raw data to show
sheet_name: str
Optionally specify the name of the sheet the data is exported to.
export: str
Format to export data
plot: bool
Expand All @@ -165,7 +168,14 @@ def display_covid_ov(
)

if export:
export_data(export, os.path.dirname(os.path.abspath(__file__)), "ov", data)
data = covid_model.get_covid_ov(country, limit)
export_data(
export,
os.path.dirname(os.path.abspath(__file__)),
"ov",
data,
sheet_name,
)


@log_start_end(log=logger)
Expand All @@ -175,6 +185,7 @@ def display_covid_stat(
raw: bool = False,
limit: int = 10,
export: str = "",
sheet_name: str = None,
plot: bool = True,
) -> None:
"""Prints table showing historical cases and deaths by country.
Expand All @@ -189,6 +200,8 @@ def display_covid_stat(
Flag to display raw data
limit: int
Number of raw data to show
sheet_name: str
Optionally specify the name of the sheet the data is exported to.
export: str
Format to export data
plot : bool
Expand All @@ -213,7 +226,13 @@ def display_covid_stat(
cols = data.columns.tolist()
cols = cols[-1:] + cols[:-1]
data = data[cols]
export_data(export, os.path.dirname(os.path.abspath(__file__)), stat, data)
export_data(
export,
os.path.dirname(os.path.abspath(__file__)),
stat,
data,
sheet_name,
)


@log_start_end(log=logger)
Expand All @@ -223,6 +242,7 @@ def display_case_slopes(
threshold: int = 10000,
ascend: bool = False,
export: str = "",
sheet_name: str = None,
) -> None:
"""Prints table showing countries with the highest case slopes.

Expand Down Expand Up @@ -253,4 +273,5 @@ def display_case_slopes(
os.path.dirname(os.path.abspath(__file__)),
f"slopes_{days_back}day",
data,
sheet_name,
)
12 changes: 10 additions & 2 deletions openbb_terminal/alternative/hackernews_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,25 @@


@log_start_end(log=logger)
def display_stories(limit: int = 10, export: str = "") -> None:
def display_stories(limit: int = 10, export: str = "", sheet_name: str = None) -> None:
"""View top stories from HackerNews.
Parameters
----------
limit: int
Number of stories to return
sheet_name: str
Optionally specify the name of the sheet the data is exported to.
export: str
Export dataframe data to csv,json,xlsx file
"""
df = get_stories(limit)
if not df.empty:
df.columns = [col.capitalize() for col in df.columns]
print_rich_table(df, title="HackerNews Top Stories")
export_data(export, os.path.dirname(os.path.abspath(__file__)), "hn", df)
export_data(
export,
os.path.dirname(os.path.abspath(__file__)),
"hn",
df,
sheet_name,
)
25 changes: 21 additions & 4 deletions openbb_terminal/alternative/oss/github_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@

@log_start_end(log=logger)
def display_star_history(
repo: str, export: str = "", external_axes: Optional[List[plt.Axes]] = None
repo: str,
export: str = "",
sheet_name: str = None,
external_axes: Optional[List[plt.Axes]] = None,
) -> None:
"""Plots repo summary [Source: https://api.github.com].

Expand Down Expand Up @@ -58,7 +61,13 @@ def display_star_history(
if external_axes is None:
theme.visualize_output()

export_data(export, os.path.dirname(os.path.abspath(__file__)), "sh", df)
export_data(
export,
os.path.dirname(os.path.abspath(__file__)),
"sh",
df,
sheet_name,
)


@log_start_end(log=logger)
Expand All @@ -67,6 +76,7 @@ def display_top_repos(
categories: str = "",
limit: int = 10,
export: str = "",
sheet_name: str = None,
external_axes: Optional[List[plt.Axes]] = None,
) -> None:
"""Plots repo summary [Source: https://api.github.com].
Expand Down Expand Up @@ -116,11 +126,17 @@ def display_top_repos(
if external_axes is None:
theme.visualize_output()

export_data(export, os.path.dirname(os.path.abspath(__file__)), "tr", df)
export_data(
export,
os.path.dirname(os.path.abspath(__file__)),
"tr",
df,
sheet_name,
)


@log_start_end(log=logger)
def display_repo_summary(repo: str, export: str = "") -> None:
def display_repo_summary(repo: str, export: str = "", sheet_name: str = None) -> None:
"""Prints table showing repo summary [Source: https://api.github.com].

Parameters
Expand All @@ -141,4 +157,5 @@ def display_repo_summary(repo: str, export: str = "") -> None:
os.path.dirname(os.path.abspath(__file__)),
"rs",
data,
sheet_name,
)
12 changes: 11 additions & 1 deletion openbb_terminal/alternative/oss/oss_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ def call_rs(self, other_args: List[str]):
if ns_parser:
if valid_repo(ns_parser.repo):
github_view.display_repo_summary(
repo=ns_parser.repo, export=ns_parser.export
repo=ns_parser.repo,
export=ns_parser.export,
sheet_name=" ".join(ns_parser.sheet_name)
if ns_parser.sheet_name
else None,
)

@log_start_end(log=logger)
Expand Down Expand Up @@ -200,6 +204,9 @@ def call_rossidx(self, other_args: List[str]):
show_growth=ns_parser.show_growth,
chart_type=ns_parser.chart_type,
export=ns_parser.export,
sheet_name=" ".join(ns_parser.sheet_name)
if ns_parser.sheet_name
else None,
)

@log_start_end(log=logger)
Expand Down Expand Up @@ -244,4 +251,7 @@ def call_tr(self, other_args: List[str]):
categories=ns_parser.categories,
limit=ns_parser.limit,
export=ns_parser.export,
sheet_name=" ".join(ns_parser.sheet_name)
if ns_parser.sheet_name
else None,
)
4 changes: 4 additions & 0 deletions openbb_terminal/alternative/oss/runa_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

logger = logging.getLogger(__name__)

# pylint: disable=too-many-arguments


@log_start_end(log=logger)
def display_rossindex(
Expand All @@ -30,6 +32,7 @@ def display_rossindex(
show_growth: bool = True,
chart_type: str = "stars",
export: str = "",
sheet_name: str = None,
external_axes: Optional[List[plt.Axes]] = None,
) -> None:
"""Plots list of startups from ross index [Source: https://runacap.com/]
Expand Down Expand Up @@ -128,4 +131,5 @@ def display_rossindex(
os.path.dirname(os.path.abspath(__file__)),
"runaidx",
df,
sheet_name,
)
9 changes: 8 additions & 1 deletion openbb_terminal/common/behavioural_analysis/finbrain_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def display_sentiment_analysis(
symbol: str,
raw: bool = False,
export: str = "",
sheet_name: str = None,
external_axes: Optional[List[plt.Axes]] = None,
):
"""Plots Sentiment analysis from FinBrain. Prints table if raw is True. [Source: FinBrain]
Expand All @@ -47,6 +48,8 @@ def display_sentiment_analysis(
Ticker symbol to get the sentiment analysis from
raw: False
Display raw table data
sheet_name: str
Optionally specify the name of the sheet the data is exported to.
export: str
Format to export data
external_axes: Optional[List[plt.Axes]], optional
Expand Down Expand Up @@ -138,5 +141,9 @@ def display_sentiment_analysis(
)

export_data(
export, os.path.dirname(os.path.abspath(__file__)), "headlines", sentiment
export,
os.path.dirname(os.path.abspath(__file__)),
"headlines",
sentiment,
sheet_name,
)
3 changes: 2 additions & 1 deletion openbb_terminal/common/behavioural_analysis/finnhub_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@log_start_end(log=logger)
@check_api_key(["API_FINNHUB_KEY"])
def display_sentiment_stats(ticker: str, export: str = ""):
def display_sentiment_stats(ticker: str, export: str = "", sheet_name: str = None):
"""
Prints Sentiment stats which displays buzz, news score, articles last week, articles weekly average,
bullish vs bearish percentages, sector average bullish percentage, and sector average news score
Expand Down Expand Up @@ -55,6 +55,7 @@ def display_sentiment_stats(ticker: str, export: str = ""):
os.path.dirname(os.path.abspath(__file__)),
"stats",
pd.DataFrame(d_stats),
sheet_name,
)

else:
Expand Down
Loading