Files
learn-trading/run_notebook.sh
T
tomatocream 4e5af95272 feat: add defeatbeta-api integration with comprehensive comparison tools
- Add defeatbeta-api as primary financial data source (replaces yfinance for analysis)
- Add comprehensive Jupyter notebook tutorial (defeatbeta_tutorial.ipynb)
- Add API comparison script (compare_apis.py)
- Add data exploration script (explore_data.py)
- Add basic test script (test_defeatbeta.py)
- Add notebook runner script (run_notebook.sh)
- Add org-mode mapping documentation (docs/defeatbeta_mapping.org)
- Update pyproject.toml with defeatbeta-api dependency
- Add defeatbeta-api as git submodule for reference

DefeatBeta Advantages:
- No rate limits (HuggingFace hosted)
- Historical financial ratios (ROE, ROIC, WACC time series)
- Earnings call transcripts access
- Revenue segmentation by product/geography
- Automated DCF valuation with Excel output
- DuckDB-powered fast queries

Note: .envrc, .jupyter_checkpoints/, __marimo__/, AAPL.xlsx, tearsheet.html
and other generated files intentionally excluded
2026-04-25 17:56:10 +08:00

45 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Run the DefeatBeta tutorial notebook with proper environment
echo "📚 DefeatBeta-API Tutorial Notebook"
echo "===================================="
echo ""
echo "This script will open the tutorial notebook with proper uv environment."
echo ""
# Check if jupyter is available
if ! command -v jupyter &> /dev/null; then
echo "❌ Jupyter not found. Installing..."
uv add jupyter
fi
# Check if the notebook exists
if [ ! -f "defeatbeta_tutorial.ipynb" ]; then
echo "❌ Notebook not found: defeatbeta_tutorial.ipynb"
exit 1
fi
echo "✅ Environment ready"
echo ""
echo "Starting Jupyter notebook..."
echo ""
echo "📝 Contents:"
echo " 1. Quick Performance Test"
echo " 2. Price Data Comparison"
echo " 3. Valuation Metrics"
echo " 4. Financial Statements"
echo " 5. Financial Ratios"
echo " 6. Growth & Margin Metrics"
echo " 7. Earnings Transcripts (Unique!)"
echo " 8. Revenue Breakdown (Unique!)"
echo " 9. DCF Valuation (Unique!)"
echo " 10. Interactive Stock Analysis"
echo " 11. Stock Comparison"
echo " 12. Complete Method Reference"
echo ""
echo "🚀 Launching notebook..."
echo ""
# Run jupyter with uv
cd /home/df/scratch/trading/learn-trading
uv run jupyter notebook defeatbeta_tutorial.ipynb