Skip to content

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.

Notifications You must be signed in to change notification settings

jcaperella29/Stock_evaluation_python

Repository files navigation

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:

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:




Releases

No releases published

Packages

No packages published

Languages