SPYDIR

Python Package for Stock Analysis

Finance
Python
Published

July 20, 2025

Goal

Build a standardized backend for financial programming projects that works across the Python ecosystem, including Jupyter notebooks, Django apps, and scripts. This package standardizes data access from multiple sources and implements caching to prevent redundant requests. Build this package as a backend for my existing stock analysis projects, such as in Excel (data retrieval and Excel output), automated PDF report generation, and easy Django integration for using tools like Django caching and Redis.

Description

A Python package for conducting financial analysis. Quickly gather financial model inputs on a stock, its peers, or the market as a whole. Designed as a starting point for deeper research, this package equips users with relevant data and sources for further research. It supports export to Excel for efficient and flexible analysis.

Categories

Performance

  • Historical data
  • Trend analysis
  • Moving averages

Financials

  • Key ratios
  • Financial statements
  • Model inputs (e.g., CAPM components, DCF inputs)

Markets

  • Live interest rates
  • Currency exchange rates

News

  • Company-related articles
  • Press releases
  • Analyst reports

ESG

  • Company officers
  • ESG scores

Analyst Opinion

  • Ratings
  • Analyst commentary

Output Formats

Excel

  • Stock.create_excel() generates a spreadsheet with:
    • Financials
    • Ratios
    • Peer metrics
    • Optional: Price history and company profile info
  • Built-in helpers for loading data into Excel for further analysis

PDF

  • Stock.create_report() generates a detailed PDF report including:
    • Financial statements
    • Ratios
    • Peer comparisons
    • Analyst opinions and price targets
  • Includes support for logo/branding

Progress

  1. View Demo Post
  2. View On Github

Working on:

  • Automated DCF model generation
    • Support for Canadian stocks
  • Company classification
    • Map stocks to GICS sector, industry, and country
    • Use industry-specific margins, growth rates, beta, and ERP to calculate WACC
  • Earnings calendar integration