petercerno / good-morning Goto Github PK
View Code? Open in Web Editor NEWSimple Python module for downloading fundamental financial data from financials.morningstar.com.
License: Other
Simple Python module for downloading fundamental financial data from financials.morningstar.com.
License: Other
You can get the premium data here
https://morningstar-api.herokuapp.com/analysisData?ticker=AAPL
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.
kr = gm.KeyRatiosDownloader()
kr_frames = kr.download('AAPL')
print(kr_frames)
returns
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Users\OPPENE\AppData\Local\JetBrains\Toolbox\apps\PyCharm-C\ch-0\182.3911.33\helpers\pydev\_pydev_bundle\pydev_umd.py", line 194, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "C:\Users\OPPENE\AppData\Local\JetBrains\Toolbox\apps\PyCharm-C\ch-0\182.3911.33\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/OPPENE/PyCharm/Projects/FinanceValuation/pullData.py", line 115, in <module>
kr_frames = kr.download('AAPL')
File "C:\Users\OPPENE\PyCharm\Projects\FinanceValuation\good_morning\good_morning.py", line 91, in download
raise ValueError("MorningStar cannot find the ticker symbol "
ValueError: MorningStar cannot find the ticker symbol you entered or it is INVALID. Please try again.
Checking to see if you're still around. If not, I have taken your code and made it "pip installable". Before doing a copy and update of your repo, I'd like to try and do a pull request. If not, I don't mind taking your code and pushing. I kept all your licensing and origination info to make sure you get complete credit. I was just making it so folks could pip install it. You made a great project.
I'm not able to pull data from Morningstar anymore. It seems https://github.com/petercerno/good-morning/blob/master/good_morning/good_morning.py#L62 is not returning any tables, possibly because there's no csv response?
Hello, I'm trying to download KeyRatios in this way:
import good_morning as gm
kr = gm.KeyRatiosDownloader()
kr_frames = kr.download('AAPL')
output is:
701
702 if copy:
--> 703 return arr.astype(dtype)
704 return arr.view(dtype)
705
ValueError: could not convert string to float: 'false'
Some advice? Thanks
I have done some debugging, and I wanted to leave some notes to the community.
In short, I don't think that this API can be used any more.
The main breaking change is that the API now requires some cookies with session id, which are set interactively when you visit the web page in your browser. If you try to call the api without the session id, the URL will simply return no data (204).
Secondly, the ticker now is internal Morningstar ID, so you would have to find a mapping, e.g. AAPL = 0P000000GY.
If anyone has an idea how to work around the session id, I can help make the fixes. But until then I think the library is broken.
Hey,
Thank you for the good-morning code. Do you have the code for Income Statement, Balance Sheet and Cash Flow also? If no, do you know where I can find it?
Thanks,
Rick
Income Statement
http://financials.morningstar.com/income-statement/is.html?t=AAPL®ion=usa&culture=en-US
Balance Sheet
http://financials.morningstar.com/balance-sheet/bs.html?t=AAPL®ion=usa&culture=en-US
Cash Flow
http://financials.morningstar.com/cash-flow/cf.html?t=AAPL®ion=usa&culture=en-US
I tried to use the class FinancialsDownloader() class and didnt work :(.
Code example below:
fd = gm.FinancialsDownloader()
test = fd._download('APPL', 'is')
and gives the error:
with urllib2.urlopen(url) as response:
NameError: name 'urllib2' is not defined ...
In order to fix the problem I changed the line 300
FROM with urllib2.urlopen(url) as response:
TO with urllib.request.urlopen(url) as response:
As soon as I overcomed the problem above I am getting the following error that is caused by line 302 json_data = json.loads(json_text)
:
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I am on a dead-end situation now :(
Recommend adding this instruction to the home page so people can install (assuming this will not be listed in PyPi):
To install good-morning
using pip, open a terminal and type:
pip install git+https://github.com/petercerno/good-morning.git
Based on my pull request #4 which you merged in, you could follow the instructions from this page to get this registered on pypi and installable via pip install good-morning
.
Just wanted to make the suggestion. By the stars, you see a lot of people are using this library; they like your work!!
When I use your simple 3 line code example:
import good_morning as gm
kr = gm.KeyRatiosDownloader()
kr_frames = kr.download('AAPL')
following failure appears:
$ python3 test.py
Traceback (most recent call last):
File "test.py", line 1, in
import good_morning as gm
File "/home/pi/good-morning-master/morningstar/good_morning.py", line 59
url = (ur'http://financials.morningstar.com/ajax/exportKR2CSV.html?' +
^
SyntaxError: invalid syntax
Thanks in advance.
Hello,
I need to insert my proxy detail in following code:
import good_morning as gm
proxies = {
"http": "http://USERNAME:PASSWORD@proxy:port",
"https": "http://USERNAME:PASSWORD@proxy:port",
}
kr = gm.KeyRatiosDownloader()
kr_frames = kr.download('AAPL')
Is there any chance to do that?
Thanks in advence for your help
BR
Charles
Hi Peter,
thanks a lot for your M* downloader. I was considering to download also the data under the 'Valuation' tab, and was considering to add that functionality to your downloader. Do you have any recommendations for that, i.e. recommendations how to best extend your code? Or have you possibly already started some work for downloading that page?
Thanks,
DC
I have more a question than an issue:
good_morning
is the holy grail in my search for getting data from morningstar!
I just use it for 1-5 stocks per day. And not at the same time at the moment.
But did you really use your demo of getting the data for 500 stocks of the S&P500?
Isn't there a problem with requesting so much data?
Or would you recommend adding a proxy server option?
Thanks for your opinions!
Greetings:
This is a great project; I'm wondering if it's possible to add the liquidity/Financial Health ratios from the "Financial Health" tab. This includes things like the current ratio and debt/equity. Those are core figures for value investors. I don't think the current code pulls those. I'm still trying to get the code working on my machine, but did get some output from the older Python 2.7 version of your code. Trying Python 3 version now. But, it would be great to have the current ratio and debt/equity returned in the pandas dataframe as well.
They are here: http://financials.morningstar.com/ratios/r.html?t=PFE®ion=usa&culture=en-US
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.