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

Put yf.info behind an exchange flag on load #3951

Merged
merged 4 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
30 changes: 23 additions & 7 deletions openbb_terminal/parent_classes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Parent Classes."""
__docformat__ = "numpy"

# pylint: disable=C0301,C0302,R0902,global-statement
# pylint: disable=C0301,C0302,R0902,global-statement,too-many-boolean-expressions

import argparse
import difflib
Expand Down Expand Up @@ -960,7 +960,7 @@ def call_load(self, other_args: List[str]):
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
prog="load",
description="Load stock ticker to perform analysis on. When the data source"
+ " is syf', an Indian ticker can be"
+ " is yf, an Indian ticker can be"
+ " loaded by using '.NS' at the end, e.g. 'SBIN.NS'. See available market in"
+ " https://help.yahoo.com/kb/exchanges-data-providers-yahoo-finance-sln2310.html.",
)
Expand Down Expand Up @@ -1039,7 +1039,20 @@ def call_load(self, other_args: List[str]):
type=str,
default="ytd",
)

parser.add_argument(
"--exchange",
dest="exchange",
action="store_true",
default=False,
help="Show exchange information.",
)
parser.add_argument(
"--performance",
dest="performance",
action="store_true",
default=False,
help="Show performance information.",
)
if other_args and "-" not in other_args[0][0]:
other_args.insert(0, "-t")

Expand Down Expand Up @@ -1088,17 +1101,20 @@ def call_load(self, other_args: List[str]):
return
if not df_stock_candidate.empty:
self.stock = df_stock_candidate
self.add_info = stocks_helper.additional_info_about_ticker(
ns_parser.ticker
)
console.print(self.add_info)
if ns_parser.exchange:
self.add_info = stocks_helper.additional_info_about_ticker(
ns_parser.ticker
)
console.print(self.add_info)
if (
ns_parser.interval == 1440
and not ns_parser.weekly
and not ns_parser.monthly
and ns_parser.filepath is None
and self.PATH == "/stocks/"
and ns_parser.performance
):
console.print()
stocks_helper.show_quick_performance(self.stock, ns_parser.ticker)
if "." in ns_parser.ticker:
self.ticker, self.suffix = ns_parser.ticker.upper().split(".")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1 @@
date,Open,High,Low,Close,Adj Close,Volume
2019-12-01,66.81749725341797,73.49250030517578,64.07250213623047,73.4124984741211,71.92059326171875,2388794800.0
2020-01-01,74.05999755859375,81.9625015258789,73.1875,77.37750244140625,75.80500030517578,2934370400.0
2020-02-01,76.07499694824219,81.80500030517578,64.09249877929688,68.33999633789062,66.95115661621094,3019279200.0
2020-03-01,70.56999969482422,76.0,53.15250015258789,63.5724983215332,62.4283561706543,6280072400.0
2020-04-01,61.625,73.63249969482422,59.224998474121094,73.44999694824219,72.12808227539062,3265299200.0
2020-05-01,71.5625,81.05999755859375,71.4625015258789,79.48500061035156,78.05447387695312,2805936000.0
2020-06-01,79.4375,93.09500122070312,79.30249786376953,91.19999694824219,89.80106353759766,3243375600.0
2020-07-01,91.27999877929688,106.41500091552734,89.1449966430664,106.26000213623047,104.63007354736328,3020283200.0
2020-08-01,108.19999694824219,131.0,107.89250183105469,129.0399932861328,127.06062316894531,4070061100.0
2020-09-01,132.75999450683594,137.97999572753906,103.0999984741211,115.80999755859375,114.23916625976562,3885245100.0
2020-10-01,117.63999938964844,125.38999938964844,107.72000122070312,108.86000061035156,107.38343811035156,2894666500.0
2020-11-01,109.11000061035156,121.98999786376953,107.31999969482422,119.05000305175781,117.43522644042969,2123077300.0
2020-12-01,121.01000213623047,138.7899932861328,120.01000213623047,132.69000244140625,131.11605834960938,2322189600.0
2021-01-01,133.52000427246094,145.08999633789062,126.37999725341797,131.9600067138672,130.39471435546875,2240262000.0
2021-02-01,133.75,137.8800048828125,118.38999938964844,121.26000213623047,119.82160949707031,1833855600.0
2021-03-01,123.75,128.72000122070312,116.20999908447266,122.1500015258789,120.88142395019531,2650418200.0
2021-04-01,123.66000366210938,137.07000732421875,122.48999786376953,131.4600067138672,130.09475708007812,1889857500.0
2021-05-01,132.0399932861328,134.07000732421875,122.25,124.61000061035156,123.31587219238281,1711934900.0
2021-06-01,125.08000183105469,137.41000366210938,123.12999725341797,136.9600067138672,135.76783752441406,1606590000.0
2021-07-01,136.60000610351562,150.0,135.75999450683594,145.86000061035156,144.59036254882812,1919035100.0
2021-08-01,146.36000061035156,153.49000549316406,144.5,151.8300018310547,150.50840759277344,1461542800.0
2021-09-01,152.8300018310547,157.25999450683594,141.27000427246094,141.5,140.47848510742188,1797835100.0
2021-10-01,141.89999389648438,153.1699981689453,138.27000427246094,149.8000030517578,148.7185516357422,1565079200.0
2021-11-01,148.99000549316406,165.6999969482422,147.47999572753906,165.3000030517578,164.10667419433594,1691029000.0
2021-12-01,167.47999572753906,182.1300048828125,157.8000030517578,177.57000732421875,176.54537963867188,2444766700.0
""
Original file line number Diff line number Diff line change
@@ -1,106 +1 @@
date,Open,High,Low,Close,Adj Close,Volume
2019-12-02,66.81749725341797,67.75,64.07250213623047,67.67749786376953,66.30211639404297,456599200.0
2019-12-09,67.5,68.82499694824219,66.22750091552734,68.7874984741211,67.38957214355469,568117600.0
2019-12-16,69.25,70.6624984741211,69.24500274658203,69.86000061035156,68.4402847290039,732720000.0
2019-12-23,70.13249969482422,73.49250030517578,70.09249877929688,72.44999694824219,70.97765350341797,386438000.0
2019-12-30,72.36499786376953,75.1500015258789,71.30500030517578,74.35749816894531,72.84637451171875,526723200.0
2020-01-06,73.44750213623047,78.1675033569336,73.1875,77.5824966430664,76.00582885742188,670091600.0
2020-01-13,77.91000366210938,79.68499755859375,77.38749694824219,79.68250274658203,78.06316375732422,652055600.0
2020-01-20,79.29750061035156,80.8324966430664,78.9124984741211,79.57749938964844,77.9603042602539,463685200.0
2020-01-27,77.51499938964844,81.9625015258789,76.22000122070312,77.37750244140625,75.80499267578125,866734800.0
2020-02-03,76.07499694824219,81.30500030517578,75.55500030517578,80.00749969482422,78.38155364990234,652341200.0
2020-02-10,78.54499816894531,81.80500030517578,78.4625015258789,81.23750305175781,79.77542114257812,492263600.0
2020-02-17,78.83999633789062,81.1624984741211,77.625,78.26249694824219,76.85396575927734,476635200.0
2020-02-24,74.31500244140625,76.04499816894531,64.09249877929688,68.33999633789062,67.11003875732422,1398039200.0
2020-03-02,70.56999969482422,76.0,69.43000030517578,72.25749969482422,70.95704650878906,1293800800.0
2020-03-09,65.9375,71.61000061035156,62.0,69.49250030517578,68.24181365966797,1616839600.0
2020-03-16,60.48749923706055,64.7699966430664,57.0,57.310001373291016,56.278568267822266,1620263600.0
2020-03-23,57.02000045776367,64.66999816894531,53.15250015258789,61.935001373291016,60.82033157348633,1384190000.0
2020-03-30,62.685001373291016,65.62249755859375,59.224998474121094,60.352500915527344,59.26631164550781,837010800.0
2020-04-06,62.724998474121094,67.92500305175781,62.345001220703125,66.99749755859375,65.79170989990234,735437600.0
2020-04-13,67.07749938964844,72.0625,66.4574966430664,70.69999694824219,69.42758178710938,829547200.0
2020-04-20,69.48750305175781,70.75250244140625,66.35749816894531,70.74250030517578,69.46931457519531,678844800.0
2020-04-27,70.44999694824219,74.75,69.55000305175781,72.26750183105469,70.96686553955078,790054000.0
2020-05-04,72.2925033569336,77.5875015258789,71.58000183105469,77.53250122070312,76.13710021972656,672706400.0
2020-05-11,77.0250015258789,79.92250061035156,75.05249786376953,76.92749786376953,75.74749755859375,834147600.0
2020-05-18,78.2925033569336,80.22250366210938,77.58000183105469,79.72250366210938,78.49964141845703,532904800.0
2020-05-25,80.875,81.05999755859375,78.27249908447266,79.48500061035156,78.2657699584961,525560400.0
2020-06-01,79.4375,82.9375,79.30249786376953,82.875,81.60376739501953,497736000.0
2020-06-08,82.5625,88.69249725341797,81.83000183105469,84.69999694824219,83.40077209472656,811826800.0
2020-06-15,83.3125,89.13999938964844,83.1449966430664,87.43000030517578,86.08889770507812,779940400.0
2020-06-22,87.83499908447266,93.09500122070312,87.7874984741211,88.40750122070312,87.05142974853516,883003200.0
2020-06-29,88.3125,92.61750030517578,87.81999969482422,91.02749633789062,89.6312026977539,495648000.0
2020-07-06,92.5,96.31749725341797,92.46749877929688,95.91999816894531,94.44866180419922,564072000.0
2020-07-13,97.26499938964844,99.95500183105469,93.87750244140625,96.32749938964844,94.84992218017578,718600800.0
2020-07-20,96.4175033569336,99.25,89.1449966430664,92.61499786376953,91.1943588256836,665196000.0
2020-07-27,93.70999908447266,106.41500091552734,93.24749755859375,106.26000213623047,104.63007354736328,847635600.0
2020-08-03,108.19999694824219,114.4124984741211,107.89250183105469,111.11250305175781,109.40812683105469,1003474000.0
2020-08-10,112.5999984741211,116.0425033569336,109.10749816894531,114.90750122070312,113.34890747070312,941551200.0
2020-08-17,116.0625,124.86750030517578,113.9625015258789,124.37000274658203,122.68306732177734,835695200.0
2020-08-24,128.69749450683594,128.78500366210938,123.05249786376953,124.80750274658203,123.11463165283203,1063638000.0
2020-08-31,127.58000183105469,137.97999572753906,110.88999938964844,120.95999908447266,119.3193130493164,1167976600.0
2020-09-07,113.94999694824219,120.5,110.0,112.0,110.4808578491211,771441800.0
2020-09-14,114.72000122070312,118.83000183105469,106.08999633789062,106.83999633789062,105.39083099365234,944587000.0
2020-09-21,104.54000091552734,112.86000061035156,103.0999984741211,112.27999877929688,110.7570571899414,847212600.0
2020-09-28,115.01000213623047,117.72000122070312,112.22000122070312,113.0199966430664,111.48702239990234,640562200.0
2020-10-05,113.91000366210938,117.0,112.25,116.97000122070312,115.38343811035156,548575100.0
2020-10-12,120.05999755859375,125.38999938964844,118.1500015258789,119.0199966430664,117.40563201904297,881222300.0
2020-10-19,119.95999908447266,120.41999816894531,114.27999877929688,115.04000091552734,113.47960662841797,519569600.0
2020-10-26,114.01000213623047,117.27999877929688,107.72000122070312,108.86000061035156,107.38345336914062,684467100.0
2020-11-02,109.11000061035156,119.62000274658203,107.31999969482422,118.69000244140625,117.08011627197266,609571800.0
2020-11-09,120.5,121.98999786376953,114.12999725341797,119.26000213623047,117.84534454345703,589577900.0
2020-11-16,118.91999816894531,120.98999786376953,116.80999755859375,117.33999633789062,115.94810485839844,389493400.0
2020-11-23,117.18000030517578,117.62000274658203,112.58999633789062,116.58999633789062,115.2070083618164,365024000.0
2020-11-30,116.97000122070312,123.77999877929688,116.80999755859375,122.25,120.79986572265625,543370600.0
2020-12-07,122.30999755859375,125.94999694824219,120.1500015258789,122.41000366210938,120.95797729492188,452278700.0
2020-12-14,122.5999984741211,129.5800018310547,121.54000091552734,126.66000366210938,125.15756225585938,621538100.0
2020-12-21,125.0199966430664,134.41000366210938,123.44999694824219,131.97000122070312,130.40457153320312,433310200.0
2020-12-28,133.99000549316406,138.7899932861328,131.72000122070312,132.69000244140625,131.11602783203125,441102200.0
2021-01-04,133.52000427246094,133.61000061035156,126.37999725341797,132.0500030517578,130.48362731933594,610791200.0
2021-01-11,129.19000244140625,131.4499969482422,126.86000061035156,127.13999938964844,125.63187408447266,482792700.0
2021-01-18,127.77999877929688,139.85000610351562,126.94000244140625,139.07000732421875,137.42037963867188,429687100.0
2021-01-25,143.07000732421875,145.08999633789062,130.2100067138672,131.9600067138672,130.3946990966797,716991000.0
2021-02-01,133.75,137.4199981689453,130.92999267578125,136.75999450683594,135.1377716064453,439303000.0
2021-02-08,136.02999877929688,137.8800048828125,133.69000244140625,135.3699951171875,133.96412658691406,345543100.0
2021-02-15,135.49000549316406,136.00999450683594,127.41000366210938,129.8699951171875,128.521240234375,363020300.0
2021-02-22,128.00999450683594,129.72000122070312,118.38999938964844,121.26000213623047,120.00067901611328,685989200.0
2021-03-01,123.75,128.72000122070312,117.56999969482422,121.41999816894531,120.15900421142578,663456700.0
2021-03-08,120.93000030517578,123.20999908447266,116.20999908447266,121.02999877929688,119.7730712890625,586977300.0
2021-03-15,121.41000366210938,127.22000122070312,119.68000030517578,119.98999786376953,118.74386596679688,626343500.0
2021-03-22,120.33000183105469,124.23999786376953,118.91999816894531,121.20999908447266,119.95118713378906,488825800.0
2021-03-29,121.6500015258789,124.18000030517578,118.86000061035156,123.0,121.72260284423828,359904000.0
2021-04-05,123.87000274658203,133.0399932861328,123.06999969482422,133.0,131.61874389648438,447820500.0
2021-04-12,132.52000427246094,135.0,130.6300048828125,134.16000366210938,132.76669311523438,444178800.0
2021-04-19,133.50999450683594,135.52999877929688,131.3000030517578,134.32000732421875,132.925048828125,421147600.0
2021-04-26,134.8300018310547,137.07000732421875,131.07000732421875,131.4600067138672,130.09474182128906,501621500.0
2021-05-03,132.0399932861328,134.07000732421875,126.69999694824219,130.2100067138672,128.85772705078125,453802300.0
2021-05-10,129.41000366210938,129.5399932861328,122.25,127.44999694824219,126.34062194824219,514165600.0
2021-05-17,126.81999969482422,128.0,122.86000061035156,125.43000030517578,124.33820343017578,386352000.0
2021-05-24,126.01000213623047,128.32000732421875,124.55000305175781,124.61000061035156,123.52533721923828,357615000.0
2021-05-31,125.08000183105469,126.16000366210938,123.12999725341797,125.88999938964844,124.79420471191406,278314500.0
2021-06-07,126.16999816894531,128.4600067138672,124.83000183105469,127.3499984741211,126.24148559570312,327048100.0
2021-06-14,127.81999969482422,132.5500030517578,127.06999969482422,130.4600067138672,129.3244171142578,457142800.0
2021-06-21,130.3000030517578,134.63999938964844,129.2100067138672,133.11000061035156,131.95135498046875,354155800.0
2021-06-28,133.41000366210938,140.0,133.35000610351562,139.9600067138672,138.74172973632812,321267200.0
2021-07-05,140.07000732421875,145.64999389648438,140.07000732421875,145.11000061035156,143.84689331054688,418559700.0
2021-07-12,146.2100067138672,150.0,143.6300048828125,146.38999938964844,145.11573791503906,504249300.0
2021-07-19,143.75,148.72000122070312,141.6699981689453,148.55999755859375,147.26687622070312,441563700.0
2021-07-26,148.27000427246094,149.8300018310547,142.5399932861328,145.86000061035156,144.59036254882812,423324000.0
2021-08-02,146.36000061035156,148.0399932861328,145.17999267578125,146.13999938964844,144.86795043945312,284559400.0
2021-08-09,146.1999969482422,149.44000244140625,145.3000030517578,149.10000610351562,148.02362060546875,298082900.0
2021-08-16,148.5399932861328,151.67999267578125,144.5,148.19000244140625,147.12017822265625,429361600.0
2021-08-23,148.30999755859375,150.86000061035156,146.8300018310547,148.60000610351562,147.5272216796875,272129100.0
2021-08-30,149.0,154.97999572753906,148.61000061035156,154.3000030517578,153.18606567382812,386647700.0
2021-09-06,154.97000122070312,157.25999450683594,148.6999969482422,148.97000122070312,147.89453125,354897400.0
2021-09-13,150.6300048828125,151.4199981689453,145.75999450683594,146.05999755859375,145.0055694580078,492884800.0
2021-09-20,143.8000030517578,147.47000122070312,141.27000427246094,146.9199981689453,145.85934448242188,394033300.0
2021-09-27,145.47000122070312,145.9600067138672,139.11000061035156,142.64999389648438,141.6201629638672,441421300.0
2021-10-04,141.75999450683594,144.22000122070312,138.27000427246094,142.89999389648438,141.86837768554688,382910100.0
2021-10-11,142.27000427246094,144.89999389648438,139.1999969482422,144.83999633789062,143.79437255859375,354098200.0
2021-10-18,143.4499969482422,150.17999267578125,143.16000366210938,148.69000244140625,147.6165771484375,340691300.0
2021-10-25,148.67999267578125,153.1699981689453,146.41000366210938,149.8000030517578,148.7185516357422,392740000.0
2021-11-01,148.99000549316406,152.42999267578125,147.8000030517578,151.27999877929688,150.18788146972656,324080300.0
2021-11-08,151.41000366210938,151.57000732421875,147.47999572753906,149.99000549316406,149.12452697753906,281799900.0
2021-11-15,150.3699951171875,161.02000427246094,149.33999633789062,160.5500030517578,159.62359619140625,462419300.0
2021-11-22,161.67999267578125,165.6999969482422,156.36000061035156,156.80999755859375,155.90516662597656,359933200.0
2021-11-29,159.3699951171875,170.3000030517578,157.8000030517578,163.75999450683594,162.8150634765625,551588000.0
""
Original file line number Diff line number Diff line change
@@ -1,26 +1 @@
date,Open,High,Low,Close,Adj Close,Volume
2019-12-01,66.81749725341797,73.49250030517578,64.07250213623047,73.4124984741211,71.92057800292969,2388794800.0
2020-01-01,74.05999755859375,81.9625015258789,73.1875,77.37750244140625,75.80500030517578,2934370400.0
2020-02-01,76.07499694824219,81.80500030517578,64.09249877929688,68.33999633789062,66.9511489868164,3019279200.0
2020-03-01,70.56999969482422,76.0,53.15250015258789,63.5724983215332,62.4283561706543,6280072400.0
2020-04-01,61.625,73.63249969482422,59.224998474121094,73.44999694824219,72.12810516357422,3265299200.0
2020-05-01,71.5625,81.05999755859375,71.4625015258789,79.48500061035156,78.05447387695312,2805936000.0
2020-06-01,79.4375,93.09500122070312,79.30249786376953,91.19999694824219,89.80106353759766,3243375600.0
2020-07-01,91.27999877929688,106.41500091552734,89.1449966430664,106.26000213623047,104.63006591796875,3020283200.0
2020-08-01,108.19999694824219,131.0,107.89250183105469,129.0399932861328,127.06061553955078,4070061100.0
2020-09-01,132.75999450683594,137.97999572753906,103.0999984741211,115.80999755859375,114.23917388916016,3885245100.0
2020-10-01,117.63999938964844,125.38999938964844,107.72000122070312,108.86000061035156,107.3834457397461,2894666500.0
2020-11-01,109.11000061035156,121.98999786376953,107.31999969482422,119.05000305175781,117.43523406982422,2123077300.0
2020-12-01,121.01000213623047,138.7899932861328,120.01000213623047,132.69000244140625,131.11602783203125,2322189600.0
2021-01-01,133.52000427246094,145.08999633789062,126.37999725341797,131.9600067138672,130.3946990966797,2240262000.0
2021-02-01,133.75,137.8800048828125,118.38999938964844,121.26000213623047,119.82161712646484,1833855600.0
2021-03-01,123.75,128.72000122070312,116.20999908447266,122.1500015258789,120.88143157958984,2650418200.0
2021-04-01,123.66000366210938,137.07000732421875,122.48999786376953,131.4600067138672,130.09474182128906,1889857500.0
2021-05-01,132.0399932861328,134.07000732421875,122.25,124.61000061035156,123.31587219238281,1711934900.0
2021-06-01,125.08000183105469,137.41000366210938,123.12999725341797,136.9600067138672,135.76783752441406,1606590000.0
2021-07-01,136.60000610351562,150.0,135.75999450683594,145.86000061035156,144.59036254882812,1919035100.0
2021-08-01,146.36000061035156,153.49000549316406,144.5,151.8300018310547,150.50840759277344,1461542800.0
2021-09-01,152.8300018310547,157.25999450683594,141.27000427246094,141.5,140.47848510742188,1797835100.0
2021-10-01,141.89999389648438,153.1699981689453,138.27000427246094,149.8000030517578,148.71856689453125,1565079200.0
2021-11-01,148.99000549316406,165.6999969482422,147.47999572753906,165.3000030517578,164.10667419433594,1691029000.0
2021-12-01,167.47999572753906,182.1300048828125,157.8000030517578,177.57000732421875,176.5453643798828,2444766700.0
""
Loading