A comprehensive stock analysis tool with technical and fundamental analysis capabilities
Project description
My Stock Analyser
A comprehensive stock analysis tool that provides technical and fundamental analysis of stocks with beautiful visualizations and email reporting capabilities.
Features
- Fetch historical stock data from multiple sources
- Perform technical analysis (RSI, MACD, Moving Averages, etc.)
- Generate detailed HTML reports with interactive charts
- Email reports with embedded visualizations
- Support for NIFTY 50 index analysis
- Cache system to minimize API calls
Installation
-
Clone the repository:
git clone https://github.com/yourusername/my_stock_analyser.git cd my_stock_analyser
-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the package in development mode:
pip install -e .
Configuration
-
Copy the example environment file and update it with your API keys:
cp .env.example .env
-
Edit the
.envfile with your configuration:# Alpha Vantage API (https://www.alphavantage.co/support/#api-key) ALPHA_VANTAGE_API_KEY=your-api-key-here # Email Configuration (Gmail recommended) SENDER_EMAIL=your-email@example.com SENDER_PASSWORD=your-app-passwordNote: For Gmail, you may need to generate an "App Password" if 2FA is enabled.
Usage
Command Line Interface
# Analyze top 10 BSE stocks and generate a report
stock-analyzer --top 10
# Analyze specific stocks
stock-analyzer --stocks RELIANCE.NS TCS.NS HDFCBANK.NS
# Analyze NIFTY 50 index
stock-analyzer --stocks ^NSEI
# Send report via email
stock-analyzer --stocks RELIANCE.NS --email your-email@example.com
# Set number of days for analysis (default: 365)
stock-analyzer --stocks RELIANCE.NS --days 180
Python API
from my_stock_analyser.analyzer import StockAnalyzer
# Create an analyzer instance
analyzer = StockAnalyzer()
# Analyze a stock
result = analyzer.analyze_stock("RELIANCE.NS", days=365)
# Generate a report
report_path = analyzer.generate_report([result])
# Send report via email
analyzer.send_report("your-email@example.com", [result])
Project Structure
my_stock_analyser/
├── src/ # Source code
│ ├── my_stock_analyser/ # Main package
│ │ ├── __init__.py
│ │ ├── cli.py # Command line interface
│ │ ├── data_fetcher.py # Data collection
│ │ ├── analysis.py # Analysis logic
│ │ ├── visualization.py # Chart generation
│ │ ├── report_generator.py # Report creation
│ │ └── email_sender.py # Email functionality
│ └── tests/ # Unit tests
├── data/ # Data storage
│ └── cache/ # Cached stock data
├── reports/ # Generated reports
│ └── charts/ # Chart visualizations
├── docs/ # Documentation
├── .env.example # Example environment variables
├── .gitignore # Git ignore file
├── setup.py # Package installation
└── README.md # This file
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE for more information.
Contact
Pranav Phalnikar - pranavphalnikar@gmail.com
Project Link: https://github.com/pranavp87/my_stock_analyser
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 my_stock_analyser-0.1.1.tar.gz.
File metadata
- Download URL: my_stock_analyser-0.1.1.tar.gz
- Upload date:
- Size: 45.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dff46c7e1f7fd8b9ab5ea35e63a95ae5e5f92160ddc0fddf77955f6f103d658e
|
|
| MD5 |
d45b18c11c130469228207eb04c1de08
|
|
| BLAKE2b-256 |
62ba083fd7da857597e515545c409926f9f6e8a73a55c8a61bde1a0ba13a0986
|
File details
Details for the file my_stock_analyser-0.1.1-py3-none-any.whl.
File metadata
- Download URL: my_stock_analyser-0.1.1-py3-none-any.whl
- Upload date:
- Size: 47.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85dfd73477dbebfa53a7a75ed9ea0e70866a1de9e93f74f8f8f6bfa101b430fa
|
|
| MD5 |
dfefa7de6e07c4224d4001d5011ffdc8
|
|
| BLAKE2b-256 |
2ff62c93ff50a5d0d6b4386551f1db0cf94aadead0cd535b4fa0325b37d01e5f
|