Coder Social home page Coder Social logo

tobigs / mfinancials Goto Github PK

View Code? Open in Web Editor NEW
14.0 5.0 7.0 28 KB

Simple module for downloading financial statements and estimates from financials.morningstar.com

License: MIT License

Python 100.00%
python pandas morningstar-financials stock-data financial-data financial-statements morningstar fundamentals fundamental-data estimates

mfinancials's Introduction

mfinancials

Simple module for downloading financial statements and estimates from financials.morningstar.com

Setup

Install using pip:

pip install mfinancials

or install from source:

git clone https://github.com/tobigs/mfinancials.git
cd mfinancials
python setup.py install

Usage

Basic usage

import mfinancials as mf

# Apple, Inc.
aapl = mf.Ticker("aapl")

# financials from http://financials.morningstar.com/ratios/r.html?t=aapl
aapl.financials

# key ratios from from http://financials.morningstar.com/ratios/r.html?t=aapl
aapl.keyRatios

# estimates from financials.morningstar.com/valuation/earnings-estimates.html?t=aapl
aapl.estimates

# display like morningstar website
aapl.financials.T
aapl.keyRatios.T
aapl.estimates.T

# get urls to view data on morningstar website
aapl.url_estimates
aapl.url_financials

Non-US stocks

Stocks not listed in the USA require either country or Market Identifier Code (MIC).
It is generally advised to use country, mic only for not supported countries.

# LVMH Moët Hennessy – Louis Vuitton SE
lvmh = mf.Ticker("mc", mic="XPAR")

# Samsung Electronics Co., Ltd.
smsng = mf.Ticker("005930", country="South Korea")

# list supported countries
smsng.countries

Some estimate data is in a different currency than the financials currency. To convert estimates use:

# Alibaba Group Holding Limited
baba = mf.Ticker("baba")
baba.financials
baba.estimates
baba.estimatesConv

# access currencies
baba.currency_estimates
baba.currency_financials

mfinancials's People

Contributors

tobigs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mfinancials's Issues

Stocks with missing estimates

mdp = mf.Ticker("mdp")
mdp.estimates

Some stocks have estimates only for one year:

High Low Mean Median 30 Days Ago 60 Days Ago 90 Days Ago Number of Estimates
('06/2021', 'Earnings Per Share USD') nan nan nan nan 2.85 2.85 nan 1
('06/2021', 'Growth %') nan nan nan nan -127.4 -127.4 nan 1
('06/2021', 'Earnings Per Share USD') 4.18 4.18 4.18 4.18 2.85 2.85 nan 1
('06/2021', 'Growth %') nan nan nan nan 0 0 nan 1

Some don't have estimates at all. (aag= mf.Ticker("aag", country="Germany"), 10.03.2021).
Estimate should have the same structure and always consist of two years regardless of available data.

Package stopped working

Hi,

Since a week or so the package has stopped working. I think the issue is that it is unable to retrieve data from the morningstar website.

The code that i'm running is as follow, for example for adobe stock:

adbe = mf.Ticker('adbe')
adbe_ratios = adbe.keyRatios.T
adbe = adbe.financials.T

error:
AttributeError: 'NoneType' object has no attribute 'T'

The following statements are printed:
Unable to get keyRatios data for adbe
Check http://financials.morningstar.com/ratios/r.html?t=adbe

Kind regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.