How ranaroussi/quantstats works
Project type and purpose
• QuantStats is a Python library (not a standalone web app) that provides portfolio analytics and reporting.
• Its goal is to let quants and portfolio managers calculate statistics (Sharpe, drawdowns, etc.), produce visualizations (snapshots, drawdown charts), and generate HTML “tear sheet” reports.
File structure
• Top-level packaging/config:
• setup.py, setup.cfg, MANIFEST.in, requirements.txt, meta.yaml (for conda)
• .github/* and .travis.yml (CI/CD pipelines)
• Documentation: docs/ (includes an HTML tear sheet and supporting material)
• Core package: quantstats/
• stats.py – core performance-metric functions
• plots.py – high-level plotting functions
• reports.py – orchestration for metrics + plots to produce HTML reports
• utils.py – helper functions (e.g. data download via yfinance)
• _plotting/ – low-level plotting engine (core.py, wrappers.py)
• version.py – package version
README insights
• Confirms 3 main modules: stats, plots, reports
• Shows dependencies: pandas, numpy, scipy, matplotlib, seaborn, tabulate, yfinance, optional plotly
• Illustrates user flow: import qs → qs.extend_pandas() → download data via utils → call stats/plots/reports APIs → produce visual output or HTML