https://github.com/jcaperella29/stock_evaluation_python
A Python script to classify companies based on financial metrics like Piotroski F-Score and Stock Valuation, using CSV financial data for analysis and output.
https://github.com/jcaperella29/stock_evaluation_python
ai-in-finance artificial-intelligence classification csv-processing data-analysis expert-system finance financial-analysis financial-analysis-tools piotroski-f-score python quantitative-analysis rule-based-classifier stock-analysis stock-valuation
Last synced: 3 months ago
JSON representation
A Python script to classify companies based on financial metrics like Piotroski F-Score and Stock Valuation, using CSV financial data for analysis and output.
- Host: GitHub
- URL: https://github.com/jcaperella29/stock_evaluation_python
- Owner: jcaperella29
- Created: 2025-02-07T19:51:57.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-02-07T19:57:56.000Z (3 months ago)
- Last Synced: 2025-02-07T20:33:18.860Z (3 months ago)
- Topics: ai-in-finance, artificial-intelligence, classification, csv-processing, data-analysis, expert-system, finance, financial-analysis, financial-analysis-tools, piotroski-f-score, python, quantitative-analysis, rule-based-classifier, stock-analysis, stock-valuation
- Language: Python
- Homepage:
- Size: 0 Bytes
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Stock_evaluation_Python 🏦📊
A Python script to classify companies based on financial metrics like the **Piotroski F-Score** and **Stock Valuation**. It processes CSV financial data for multiple companies and outputs a classification (`Strong`, `Medium`, or `Weak`) for each company.
---
## Features 🚀
- Computes **Piotroski F-Score** based on profitability, leverage, and efficiency metrics.
- Calculates **Stock Valuation** using **P/E Ratio** and **P/B Ratio**.
- Classifies companies into `Strong`, `Medium`, or `Weak` based on their metrics.
- Handles missing or invalid financial data gracefully.
- Saves the results as a CSV file.---
## How It Works 🛠️
1. Loads financial data from CSV files for specified company tickers.
2. Computes the following metrics:
- **Piotroski F-Score**: Combines 9 financial metrics to score financial health.
- **Stock Valuation**: The sum of P/E Ratio and P/B Ratio.
3. Classifies companies based on the metrics:
- `Strong`: F-Score ≥ 7 and Valuation < 20
- `Medium`: F-Score ≥ 4 and Valuation < 30
- `Weak`: All others
4. Outputs a CSV file with the results.---
## Usage 🖥️
### **1. Install Dependencies**
Ensure you have **Python 3.7+** and the following Python libraries installed:
```bash
pip install pandas
. Directory Setup
Organize your data in the following structure:Copy
Edit
financial_data/
│
├── GM_ratios.csv
├── GM_cash_flow.csv
├── GM_balance_sheet.csv
├── GM_income_statement.csv
├── TSLA_ratios.csv
├── TSLA_cash_flow.csv
├── TSLA_balance_sheet.csv
├── TSLA_income_statement.csv
├── AAPL_ratios.csv
├── AAPL_cash_flow.csv
├── AAPL_balance_sheet.csv
├── AAPL_income_statement.csv
3. Run the Script
Save the script as stock_picker.py, and execute it: