Benny-/Yahoo-ticker-symbol-downloader

Unclear how to get csv format

Closed this issue · 2 comments

moue commented

I was confused when I saw that the output that I ended up with was a .pickle object, because the description of the package said that it outputs .json, .yaml and .xls files in addition to .csv. I ended up reading the pickle object into python and doing some data manipulation to get it out as a .csv. Is there another way to go about it?

import pandas as pd
import numpy as np

ytd = pickle.load(open('stocks.pickle', 'rb'))
names = ytd.symbols.keys()
namesarr = numpy.asarray(names)
df = pd.DataFrame(namesarr,columns=['ticker'])
df.to_csv('stocks.csv')

The script produces the different output formats once it is done running.

It takes several hours before it is done running. Because it takes so long and things might go wrong it will save the interment results in a .pickle file periodically so it can resume at a later time.

Your feedback is much appreciated! What changes do you suggest I should make? Should I change the description? Let the program output the desired formats at any time?

moue commented

Thanks for the quick response! I think you should let the program output the desired formats at any time. I'm using your package to download ~400 stock names since I'm working primarily in R. I have no need to wait until the program finishes running. It would also be helpful if you could the explanation for why the program outputs .pickle files occasionally in your readme file.