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.1.tar.gz (8.9 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.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fin_insight-0.1.1.tar.gz
  • Upload date:
  • Size: 8.9 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.1.tar.gz
Algorithm Hash digest
SHA256 2a0a7fcbbc006bf68073b0101269ef704c6994b1fe000f4b23478172298157c9
MD5 7ce421b36b22abf2fc0fc0bd456f5d97
BLAKE2b-256 ec8f3cf3674baa139edec04ba8e7d5684adf01bf937f1bd75468b5632cdba3e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fin_insight-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c711c6f828f7e8359c61be66c0cc0033faf0ffd89d484ffd8ee5d7a8461b0028
MD5 7b3d90ee8c081e1596329d3703ac7e28
BLAKE2b-256 2516e13941284429818461b273841512bc20a3257ea28204c0cbfd92e0b29f1f

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