Since Yahoo Finance terminated its service to download EoD prices data, I have come across the following Python script yahoo_quote_download to continue downloading the data I require. Unfortunately, I am completely new to Python, and I am struggling with using this promising tool.
I am running Python 2.7.10 on Mac OS X. Having followed the installation instructions of the script, I have not observed any error messages. The readme.md file states the following:
The CSV file downloaded through the new API has a few data and format differences from the CSV file from the original iChart source.
Most likely due to the fact that I am completely new to Python, I fail to find the syntax for the Python code to download data into a CSV-file as mentioned in the readme file.
Playing around with amongst others the test_yqd.py gives only screen output, for instance:
bash-3.2$ python test_yqd.py
('===', 'FP.PA', '===')
[u'Date,Dividends', u'2015-06-08,0.61', u'2016-06-06,0.61', u'2014-12-15,0.61', u'2014-03-24,0.59', u'2015-03-23,0.61', u'2016-03-21,0.61', u'2017-03-20,0.61', u'2014-09-23,0.61', u'2015-12-21,0.61', u'2015-09-28,0.61', u'2016-09-27,0.61', u'2016-12-21,0.61', u'2014-06-02,0.61', u'']
bash-3.2$
This is promising, because I have tested a few data sets, and I seem to get access to all of the data I require, unfortunately my attempts have failed to download a CSV file with the data.
Practically, I seek to find the syntax that invokes the Python script and downloads the data into a CSV. Subsequently, I can pick up the CSV file and update my database and perform analysis. What is the Python command I need to invoke with which arguments to download a CSV file?
Any help that leads to understanding and using the yahoo_quote_download scripts will be much appreciate.
CSV stands for "Comma Separated Values", https://en.wikipedia.org/wiki/Comma-separated_values.
So this data below you got from calling the code is the CSV.
[u'Date,Dividends', u'2015-06-08,0.61', u'2016-06-06,0.61', u'2014-12-15,0.61', u'2014-03-24,0.59', u'2015-03-23,0.61', u'2016-03-21,0.61', u'2017-03-20,0.61', u'2014-09-23,0.61', u'2015-12-21,0.61', u'2015-09-28,0.61', u'2016-09-27,0.61', u'2016-12-21,0.61', u'2014-06-02,0.61', u'']
Each of these is a line, and within each line there are two fields separated by a comma. CSV file is nothing more than the CSV data written into a file. If you need a CSV file, you just need to write this data into a file, one line at a time (i.e., you need to add a new line after each item).
It does not look like your issue is with Python coding. Hope it helps.