Skip to main content

A value investing tool based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts

Project description


Valinvest

A value investing tool based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts

Welcome to Valinvest

🔥 Important update 🔥

The Financial API used by valinvest to get financial data has been rewritten and now requires a API Key in order to make request. So, the first step now is to register on https://financialmodelingprep.com/login and get an API key. Keep it, you will need it to use valinvest ;)

✨tl;dr ✨

For a given stock ticker, valinvest calculates a score from 0 to 9. The higher the score, the better the company is according to the scoring methodology.

  1. Install it
pip install valinvest
  1. Calculate score
>>> import valinvest
>>> aapl = valinvest.Fundamental('AAPL', YOUR_API_KEY)
>>> aapl.fscore()
6.8

Table of contents :books:

Introduction

The aim of the package is to evaluate a stock according to his fundamentals by setting a score and identify buy and sells opportunies through technical indicators.

Methodology description

The scoring methodology is based on Joseph Piotroski's study (Value Investing: The Use of Historical Financial Statement Information to Separate Winners from Losers). The F-Score is used to help financial investment decisions by finding the best value stocks on the market.

The Piostroski score is calculated based on 9 criteria divided into 3 groups:

Profitability

  • Return on Assets (1 point if it is positive in the current year, 0 otherwise)
  • Operating Cash Flow (1 point if it is positive in the current year, 0 otherwise)
  • Change in Return of Assets (ROA) (1 point if ROA is higher in the current year compared to the previous one, 0 otherwise)
  • Accruals (1 point if Operating Cash Flow/Total Assets is higher than ROA in the current year, 0 otherwise)

Leverage, Liquidity and Source of Funds

  • Change in Leverage (long-term) ratio (1 point if the ratio is lower this year compared to the previous one, 0 otherwise)
  • Change in Current ratio (1 point if it is higher in the current year compared to the previous one, 0 otherwise)
  • Change in the number of shares (1 point if no new shares were issued during the last year)

Operating Efficiency

  • Change in Gross Margin (1 point if it is higher in the current year compared to the previous one, 0 otherwise)
  • Change in Asset Turnover ratio (1 point if it is higher in the current year compared to the previous one, 0 otherwise)

This software calculates an alternate version of the F-Score as follows:

Growth

  • Net Revenue
  • EBITDA
  • Earnings per share (EPS)

Profitability

  • CROIC
  • ROIC

Debts

  • EBITDA cover ratio
  • Debt coverage

Market sensibility

  • Beta

Investment

  • Equity buyback

Installation

pip install valinvest

Examples

Starbucks Corporation (SBUX)

2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 Score
REV_G 1 1 1 1 1 1 1 1 1 1 1
EBT_G 1 1 1 0 1 1 1 0 0 1 0.7
EPS_G 1 1 1 0 1 0 1 1 1 0 0.7
ROIC 0 0 1 0 0 0 0 0 0 0 0 0.1
CROIC 1 1 1 1 1 0 1 1 1 1 1 0.9
5YRS_BETA 1
EBITDA_COVER 1 1 1 1 1 1 1 1 1 1 1 1
DEBT_COST 0 0 0 0 1 1 1 1 1 1 1 0.7
EQ_BUYBACK 1 0 0 1 0 0 1 1 1 1 0.6
F-SCORE 6.7
>>> import valinvest
>>> sbux = valinvest.Fundamental('SBUX')
>>> sbux.fscore()
6.7

Apple Inc. (AAPL)

2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 Score
REV_G 1 1 1 1 1 1 0 1 1 0 0.8
EBT_G 1 1 1 0 1 1 0 1 1 0 0.7
EPS_G 1 1 1 0 0 1 0 1 1 0 0.6
ROIC 1 1 1 1 1 1 1 1 1 1 1 1
CROIC 1 1 1 1 1 1 1 1 1 1 1 1
5YRS_BETA 0
EBITDA_COVER 1 1 1 1 1 1 1 1 1 1 1 1
DEBT_COST 1 1 1 1 1 1 1 1 1 1 1 1
EQ_BUYBACK 1 0 0 1 0 1 1 1 1 1 0.7
F-SCORE 6.8
>>> import valinvest
>>> aapl = valinvest.Fundamental('AAPL')
>>> aapl.fscore()
6.8

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Credits

This software uses code from several open source packages:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

valinvest-0.0.2.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

valinvest-0.0.2-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file valinvest-0.0.2.tar.gz.

File metadata

  • Download URL: valinvest-0.0.2.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.5

File hashes

Hashes for valinvest-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9614aaf8019e015c20ea48867ede8a6ea10e1c6410e787314066d7b2e5aeb7dc
MD5 7aec2a07619cdac3bb44bae4ddd57e25
BLAKE2b-256 627fa023d11df31080c9e890a0376513cf6a2e49066403385d10481a4331be1d

See more details on using hashes here.

File details

Details for the file valinvest-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: valinvest-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.5

File hashes

Hashes for valinvest-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37fadaf30c69e0487fed8d9cc93bb792ca8cf36fed0839e0e755a84738166ab9
MD5 0f2271e32500240f789eeb945976b5a0
BLAKE2b-256 0bbd489b7e37e3b01cb023c4c9f3773d03a7ac6a2b1899f133c5cd401e91d0d0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page