Open vmwoods opened 6 years ago
You can just change the url request in _download from period=12 to period=3. It'll still give you 5 periods back though, so 15 months of financials.
So to be clear the line
url = (r'http://financials.morningstar.com/ajax/' +
r'ReportProcess4HtmlAjax.html?&t=' + ticker +
r'®ion=usa&culture=en-US&cur=USD' +
r'&reportType=' + report_type + r'&period=12' +
r'&dataType=A&order=asc&columnYear=5&rounding=3&view=raw')
Becomes
url = (r'http://financials.morningstar.com/ajax/' +
r'ReportProcess4HtmlAjax.html?&t=' + ticker +
r'®ion=usa&culture=en-US&cur=USD' +
r'&reportType=' + report_type + r'&period=3' +
r'&dataType=A&order=asc&columnYear=5&rounding=3&view=raw')
Edit:
Sorry, I'd missed a portion of the download, which would give the wrong date column.
To fix this inside of FinancialsDownloader:_parse the line
freq = pd.tseries.offsets.YearEnd(month=period_month))
Becomes
freq = 'Q'
Now I'm sure that there are more elegant ways of getting the frequency of the column, but for a quick solution this works.
You also have to change the column names in _get_db_replace_values()
if you want to save the results in a DB.
Hello, I have been using your module good morning to pull financial data. I have been using your class FinancialsDownloader to get the annual financial statements from morningstar. I was wondering if there is anyway to get the quarterly financial statements from morningstar as well using FinancialsDownloader? Do you know how to change your code to get the quarterly financial statements rather than yearly? If you could please help me, it would be greatly appreciated. Your module is amazing and has helped me out a lot. All I need is the quarterly financial statements from morningstar then my project will be complete.