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.0.tar.gz (4.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.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fin_insight-0.1.0.tar.gz
  • Upload date:
  • Size: 4.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.0.tar.gz
Algorithm Hash digest
SHA256 170092efa3276dbcd770f35d2dabc7c01861c68e345ed799b9fde2890d3536b8
MD5 30aaa6d5e1ac217a0209662354bd1e00
BLAKE2b-256 9d13cc8e8504fc3b652605c6a93bcd909a6cc11205c75a17019295278c1e9b33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fin_insight-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca71ce5b64824283c43ded4a76f8d002200e48b8abfb1d90833143ea79faef4d
MD5 f4527ec78a85802ee69a3829374a5e24
BLAKE2b-256 f95615c759826e6cfa10bdcbf67192de964372954a0681ff9f3c051ead3d1f72

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