🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

fin-insight

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fin-insight

A financial analysis tool for stock sentiment and rating

0.1.2
PyPI
Maintainers
1

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

  • Clone the repository:
git clone https://github.com/yourusername/fin_insight.git
cd fin_insight
  • Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  • Install dependencies:
pip install -r requirements.txt
  • 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

  • Fork the repository
  • Create your feature branch
  • Commit your changes
  • Push to the branch
  • 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.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts