Skip to main content

A financial analysis tool for stock sentiment and rating

Project description

Financial Insight Stock Analysis Tool

Overview

Financial Insight is a Python-based stock analysis tool that provides comprehensive insights into stock performance by combining financial data, news sentiment, and intelligent rating generation.

Features

  • Fetch real-time stock data using Yahoo Finance
  • Retrieve latest financial news articles
  • Perform sentiment analysis on news articles
  • Generate stock ratings (Buy/Sell/Hold)
  • Detailed financial highlights
  • JSON output for easy integration

Prerequisites

  • Python 3.8+
  • NewsAPI API Key

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/fin_insight.git
cd fin_insight
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up NewsAPI Key:
export NEWS_API_KEY='your_newsapi_key_here'  # On Windows use `set NEWS_API_KEY=your_key`

Usage

python fin_insight.py AAPL  # Replace AAPL with desired stock ticker

Example Output

{
    "ticker": "AAPL",
    "latest_price": 175.23,
    "sentiment_summary": "Positive sentiment in news articles",
    "financialHighlights": {
        "revenueGrowthPercentage": "12.50%",
        "earningsGrowthPercentage": "15.75%",
        "forwardPERatio": "22.30",
        "debtToEquityRatio": "1.10"
    },
    "rating": "Buy"
}

Components

  • get_stock_data(): Retrieves stock financial data
  • get_financial_news(): Fetches recent news articles
  • analyze_sentiment(): Performs sentiment analysis
  • generate_rating(): Calculates stock recommendation

Configuration

Adjust rating thresholds and weights in generate_rating() function for custom analysis.

Error Handling

  • Validates ticker symbols
  • Checks for missing API keys
  • Provides detailed error messages

Dependencies

  • yfinance: Stock data retrieval
  • requests: News article fetching
  • vaderSentiment: Sentiment analysis
  • pandas: Data manipulation

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License

Disclaimer

This tool provides financial insights for informational purposes only. Always conduct your own research and consult financial advisors before making investment decisions.

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

fin_insight-0.1.2.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fin_insight-0.1.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file fin_insight-0.1.2.tar.gz.

File metadata

  • Download URL: fin_insight-0.1.2.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for fin_insight-0.1.2.tar.gz
Algorithm Hash digest
SHA256 79624072ca1e05d231289812bf6442d163359635bf208f00f2f35c5105c410a8
MD5 891ec9623903388803311b09ac0ef967
BLAKE2b-256 a7495c348aa4d9883964515e49769adbafc696a4b70c154fb55d779a02079542

See more details on using hashes here.

File details

Details for the file fin_insight-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: fin_insight-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for fin_insight-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e5f9c53923b7311fdaa8a354ee029ba906d6301b1c488f232592e9ac83ccd5d4
MD5 04a92454157625fe80b75a515516d1e6
BLAKE2b-256 ad20ddaf19e55ed166638a45d1496f347f06d4d66f123f3529306111d3a7ac9f

See more details on using hashes here.

Supported by

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