Feb-12-2021, 01:20 AM
(This post was last modified: Feb-12-2021, 01:20 AM by detlefschmitt.)
Thanks for the reply. I ran your program and understand the output. That is not what I was asking for.
In the Yahoo_fin script I posted above the script line below imports stock_info. The subsequent script then extracts various information from the imported stock_info and exports them. More specifically it exports for each ticker the values of 59 stat types to csv.
What I am looking for is a script that exports the ticker symbols only from the imported stock_info. Exports all tickers symbols in Stock_info, without having to enter the ticker names in the script. I would like to have a script that results in the below csv output. I only list a few tickers to illustrate. Presumably the output will contain several hundred tickers. So, I want to dump all tickers symbols in stock_info to csv.
http://theautomatic.net/yahoo_fin-documentation/
Look at explanation for tickers_nasdaq(), tickers_dow(), tickers_nifty50(), tickers_other(), tickers_sp500()
I manually extracted the ticker symbols from these websites, compiled them to one list in Excel and compared them to my own ticker list. That way I was able to find the tickers that are no longer listed and not contained in stock_info. Tickers that are not in stock_info cause the above yahoo_fin script to return an error message. I ran into this problem when I ran the above yahoo_fin script with my several hundred tickers. After I had the unlisted tickers removed from my my ticker list I did not get an error message any longer and was able to export the stats for several hundred tickers at once.
Exporting the ticker symbols manually from several websites is a workaround to solve my problem. However, easier would be if I could just dump the ticker symbols from stock_info. I don't know if that can be done.
Maybe the tickers can be exported using tickers_nasdaq(), tickers_dow(), tickers_nifty50(), tickers_other(), tickers_sp500(). I don't know. I am a newbie to yahoo_fin.
In the Yahoo_fin script I posted above the script line below imports stock_info. The subsequent script then extracts various information from the imported stock_info and exports them. More specifically it exports for each ticker the values of 59 stat types to csv.
from yahoo_fin import stock_info as siSo far so good. That is working fine and is very useful.
What I am looking for is a script that exports the ticker symbols only from the imported stock_info. Exports all tickers symbols in Stock_info, without having to enter the ticker names in the script. I would like to have a script that results in the below csv output. I only list a few tickers to illustrate. Presumably the output will contain several hundred tickers. So, I want to dump all tickers symbols in stock_info to csv.
Output:AACG
AACQU
AACQW
AAL
AAME
AAOI
AAON
AAPL
AAWW
AAXJ
On the Yahoo_fin documentation page, see link below, I found links to the websites that have the ticker symbols.http://theautomatic.net/yahoo_fin-documentation/
Look at explanation for tickers_nasdaq(), tickers_dow(), tickers_nifty50(), tickers_other(), tickers_sp500()
I manually extracted the ticker symbols from these websites, compiled them to one list in Excel and compared them to my own ticker list. That way I was able to find the tickers that are no longer listed and not contained in stock_info. Tickers that are not in stock_info cause the above yahoo_fin script to return an error message. I ran into this problem when I ran the above yahoo_fin script with my several hundred tickers. After I had the unlisted tickers removed from my my ticker list I did not get an error message any longer and was able to export the stats for several hundred tickers at once.
Exporting the ticker symbols manually from several websites is a workaround to solve my problem. However, easier would be if I could just dump the ticker symbols from stock_info. I don't know if that can be done.
Maybe the tickers can be exported using tickers_nasdaq(), tickers_dow(), tickers_nifty50(), tickers_other(), tickers_sp500(). I don't know. I am a newbie to yahoo_fin.