Skip to main content

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

  1. Clone the repository:

    git clone https://github.com/yourusername/my_stock_analyser.git
    cd my_stock_analyser
    
  2. Create a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    
  3. Install the package in development mode:

    pip install -e .
    

Configuration

  1. Copy the example environment file and update it with your API keys:

    cp .env.example .env
    
  2. Edit the .env file 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-password
    

    Note: 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.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

my_stock_analyser-0.1.1.tar.gz (45.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

my_stock_analyser-0.1.1-py3-none-any.whl (47.3 kB view details)

Uploaded Python 3

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

Hashes for my_stock_analyser-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dff46c7e1f7fd8b9ab5ea35e63a95ae5e5f92160ddc0fddf77955f6f103d658e
MD5 d45b18c11c130469228207eb04c1de08
BLAKE2b-256 62ba083fd7da857597e515545c409926f9f6e8a73a55c8a61bde1a0ba13a0986

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for my_stock_analyser-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 85dfd73477dbebfa53a7a75ed9ea0e70866a1de9e93f74f8f8f6bfa101b430fa
MD5 dfefa7de6e07c4224d4001d5011ffdc8
BLAKE2b-256 2ff62c93ff50a5d0d6b4386551f1db0cf94aadead0cd535b4fa0325b37d01e5f

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