How shashankvemuri/finance works
Project type and purpose
• This is an open-source Python toolkit for financial data gathering, analysis, modeling, and strategy simulation.
• No UI or web frontend; each script is a standalone CLI program.
• Key use-cases: ingest stock data, compute indicators, screen stocks, run statistical analyses, build simple ML models, backtest strategies.
File structure
• Top-level directories represent functional layers:
• stock_data – data ingestion layer (web scraping, API clients)
• technical_indicators – pure functions for computing indicators
• find_stocks – screener layer (filters, ratings, signals)
• stock_analysis – statistical and ratio analyses, visualization tools
• machine_learning – prediction/classification models and evaluation
• portfolio_strategies – backtesting and portfolio simulations
• Root files: configuration (requirements.txt), static CSV tickers, helper modules (ta_functions.py, tickers.py).
• No build or deployment scripts—everything runs as a Python script.
README for insights
• It documents the six major sections listed above.
a. Main components
• User/CLI layer – entry point for running scripts
• Data Ingestion – stock_data directory, external services (Yahoo Finance API, Finviz web-scraping, Twitter, TradingView, IBD, etc.)
• Indicator Library – technical_indicators directory
• Screening Layer – find_stocks directory
• Analysis Layer – stock_analysis directory
• Modeling Layer – machine_learning directory
• Strategy Layer – portfolio_strategies directory
• Shared Utilities – ta_functions.py, tickers.csv files
b. Relationships and interactions
• Data flows from Data Ingestion into Indicator Library or directly into Screening/Analysis
• Screening/Analysis consume data and indicator outputs
• Analysis layer feeds cleaned data into the Modeling layer
• Modeling outputs (predictions, signals) can feed into Strategy layer
• Strategy layer optionally requests fresh data and indicators, then produces backtest results
c. Architectural patterns and principles
• Layered architecture: each directory is a logical layer with a clear purpose
• Shared library of pure functions (technical_indicators) avoids duplication
• Loose coupling: scripts import only the modules they need
• Extensibility: new scrapers, indicators, models, or strategies plug into their respective layer
d. Key technologies
• Python 3.x, standard modules (requests, pandas, numpy)
• Web-scraping (autoscraper, BeautifulSoup)
• APIs: yfinance, Twilio, Twitter
• ML frameworks: scikit-learn, Keras/TensorFlow, Prophet, ARIMA
• Backtesting: backtrader or custom routines
Additional notes
• Shared CSV files and helper modules as a “Utilities” block.
• Maintain readability: group similar modules but document that each script is a standalone entry point.