{"id":13480418,"url":"https://github.com/astro30/valinvest","last_synced_at":"2025-04-07T07:08:22.363Z","repository":{"id":40526092,"uuid":"238962338","full_name":"astro30/valinvest","owner":"astro30","description":"A value investing tool based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts","archived":false,"fork":false,"pushed_at":"2023-07-25T21:13:06.000Z","size":76,"stargazers_count":148,"open_issues_count":4,"forks_count":28,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-03-25T07:02:22.126Z","etag":null,"topics":["buffett","graham","investing","investment","numpy","pandas","piotroski","python","value-investing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astro30.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-02-07T15:49:10.000Z","updated_at":"2024-04-14T21:44:26.583Z","dependencies_parsed_at":"2024-04-14T21:44:25.104Z","dependency_job_id":"e146581e-432b-4729-baf2-df3cdbdf77f4","html_url":"https://github.com/astro30/valinvest","commit_stats":{"total_commits":55,"total_committers":3,"mean_commits":"18.333333333333332","dds":0.07272727272727275,"last_synced_commit":"a67f28a60d6a880f08526bfd374aaeef9769cabd"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro30%2Fvalinvest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro30%2Fvalinvest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro30%2Fvalinvest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astro30%2Fvalinvest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astro30","download_url":"https://codeload.github.com/astro30/valinvest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608151,"owners_count":20965952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["buffett","graham","investing","investment","numpy","pandas","piotroski","python","value-investing"],"created_at":"2024-07-31T17:00:39.024Z","updated_at":"2025-04-07T07:08:22.344Z","avatar_url":"https://github.com/astro30.png","language":"Python","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003cstrong\u003eValinvest\u003c/strong\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"https://imgs.xkcd.com/comics/technical_analysis_2x.png\" /\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eA value investing tool based on Warren Buffett, Joseph Piotroski and Benjamin Graham thoughts\u003c/h4\u003e\n\n# Welcome to Valinvest \u003c!-- omit in toc --\u003e\n## 🔥 Important update 🔥 \u003c!-- omit in toc --\u003e\nThe 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 ;)\n\n## ✨tl;dr ✨ \u003c!-- omit in toc --\u003e\nFor 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.\n1. Install it\n```bash\npip install valinvest\n```\n\n2. Calculate score\n```python\n\u003e\u003e\u003e import valinvest\n\u003e\u003e\u003e aapl = valinvest.Fundamental('AAPL', YOUR_API_KEY)\n\u003e\u003e\u003e aapl.fscore()\n6.8\n```\n\n\n## Table of contents :books: \u003c!-- omit in toc --\u003e\n\n- [Introduction](#introduction)\n- [Methodology description](#methodology-description)\n    - [Growth](#growth)\n    - [Profitability](#profitability)\n    - [Debts](#debts)\n    - [Market sensibility](#market-sensibility)\n    - [Investment](#investment)\n- [Installation](#installation)\n- [Examples](#examples)\n  - [Starbucks Corporation (SBUX)](#starbucks-corporation-sbux)\n  - [Apple Inc. (AAPL)](#apple-inc-aapl)\n- [License](#license)\n- [Credits](#credits)\n\n## Introduction\n\nThe 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.\n\n## Methodology description\n\nThe scoring methodology is based on Joseph Piotroski's study ([Value Investing: The Use of Historical Financial Statement Information to Separate Winners from Losers](http://www.chicagobooth.edu/~/media/FE874EE65F624AAEBD0166B1974FD74D.pdf)). The F-Score is used to help financial investment decisions by finding the best value stocks on the market.\u003cbr\u003e\n\n\u003e The Piostroski score is calculated based on 9 criteria divided into 3 groups:\n\u003e \n\u003e #### Profitability\n\u003e\n\u003e - Return on Assets (1 point if it is positive in the current year, 0 otherwise)\n\u003e - Operating Cash Flow (1 point if it is positive in the current year, 0 otherwise)\n\u003e - Change in Return of Assets (ROA) (1 point if ROA is higher in the current year compared to the previous one, 0 otherwise)\n\u003e - Accruals (1 point if Operating Cash Flow/Total Assets is higher than ROA in the current year, 0 otherwise)\n\u003e\n\u003e #### Leverage, Liquidity and Source of Funds\n\u003e\n\u003e - Change in Leverage (long-term) ratio (1 point if the ratio is lower this year compared to the previous one, 0 otherwise)\n\u003e - Change in Current ratio (1 point if it is higher in the current year compared to the previous one, 0 otherwise)\n\u003e - Change in the number of shares (1 point if no new shares were issued during the last year)\n\u003e\n\u003e #### Operating Efficiency\n\u003e\n\u003e - Change in Gross Margin (1 point if it is higher in the current year compared to the previous one, 0 otherwise)\n\u003e - Change in Asset Turnover ratio (1 point if it is higher in the current year compared to the previous one, 0 otherwise)\n\u003e \n\nThis software calculates an alternate version of the F-Score as follows:\n#### Growth\n- Net Revenue\n- EBITDA\n- Earnings per share (EPS)\n\n#### Profitability\n- CROIC\n- ROIC\n\n#### Debts\n- EBITDA cover ratio\n- Debt coverage\n\n#### Market sensibility\n- Beta\n\n#### Investment\n- Equity buyback\n\n## Installation\n\n\u003e `pip install valinvest`\n\n## Examples\n\n### Starbucks Corporation (SBUX)\n\n|              | 2009 | 2010 | 2011 | 2012 | 2013 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | Score |\n| ------------ | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----- |\n| REV_G        |      | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1     |\n| EBT_G        |      | 1    | 1    | 1    | 0    | 1    | 1    | 1    | 0    | 0    | 1    | 0.7   |\n| EPS_G        |      | 1    | 1    | 1    | 0    | 1    | 0    | 1    | 1    | 1    | 0    | 0.7   |\n| ROIC         | 0    | 0    | 1    | 0    | 0    | 0    | 0    | 0    | 0    | 0    | 0    | 0.1   |\n| CROIC        | 1    | 1    | 1    | 1    | 1    | 0    | 1    | 1    | 1    | 1    | 1    | 0.9   |\n| 5YRS_BETA    |      |      |      |      |      |      |      |      |      |      |      | 1     |\n| EBITDA_COVER | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1     |\n| DEBT_COST    | 0    | 0    | 0    | 0    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 0.7   |\n| EQ_BUYBACK   |      | 1    | 0    | 0    | 1    | 0    | 0    | 1    | 1    | 1    | 1    | 0.6   |\n| F-SCORE      |      |      |      |      |      |      |      |      |      |      |      | 6.7   |\n\n```python\n\u003e\u003e\u003e import valinvest\n\u003e\u003e\u003e sbux = valinvest.Fundamental('SBUX')\n\u003e\u003e\u003e sbux.fscore()\n6.7\n```\n\n### Apple Inc. (AAPL)\n\n|              | 2009 | 2010 | 2011 | 2012 | 2013 | 2014 | 2015 | 2016 | 2017 | 2018 | 2019 | Score |\n| ------------ | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ----- |\n| REV_G        |      | 1    | 1    | 1    | 1    | 1    | 1    | 0    | 1    | 1    | 0    | 0.8   |\n| EBT_G        |      | 1    | 1    | 1    | 0    | 1    | 1    | 0    | 1    | 1    | 0    | 0.7   |\n| EPS_G        |      | 1    | 1    | 1    | 0    | 0    | 1    | 0    | 1    | 1    | 0    | 0.6   |\n| ROIC         | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1     |\n| CROIC        | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1     |\n| 5YRS_BETA    |      |      |      |      |      |      |      |      |      |      |      | 0     |\n| EBITDA_COVER | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1     |\n| DEBT_COST    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1    | 1     |\n| EQ_BUYBACK   |      | 1    | 0    | 0    | 1    | 0    | 1    | 1    | 1    | 1    | 1    | 0.7   |\n| F-SCORE      |      |      |      |      |      |      |      |      |      |      |      | 6.8   |\n\n```python\n\u003e\u003e\u003e import valinvest\n\u003e\u003e\u003e aapl = valinvest.Fundamental('AAPL')\n\u003e\u003e\u003e aapl.fscore()\n6.8\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](https://github.com/astro30/valinvest/blob/master/LICENSE) file for details\n\n## Credits\n\nThis software uses code from several open source packages:\n\n- [pandas](http://pandas.pydata.org)\n- [numpy](http://numpy.pydata.org)\n- [requests](https://requests.readthedocs.io/en/master/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastro30%2Fvalinvest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastro30%2Fvalinvest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastro30%2Fvalinvest/lists"}