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
- 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 dataget_financial_news(): Fetches recent news articlesanalyze_sentiment(): Performs sentiment analysisgenerate_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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79624072ca1e05d231289812bf6442d163359635bf208f00f2f35c5105c410a8
|
|
| MD5 |
891ec9623903388803311b09ac0ef967
|
|
| BLAKE2b-256 |
a7495c348aa4d9883964515e49769adbafc696a4b70c154fb55d779a02079542
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5f9c53923b7311fdaa8a354ee029ba906d6301b1c488f232592e9ac83ccd5d4
|
|
| MD5 |
04a92454157625fe80b75a515516d1e6
|
|
| BLAKE2b-256 |
ad20ddaf19e55ed166638a45d1496f347f06d4d66f123f3529306111d3a7ac9f
|