diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..cde3598 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,55 @@ +name: CI + +on: + push: + branches: [main, develop] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.11, 3.12] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e ".[dev]" + + - name: Lint with ruff + run: | + ruff check src/ tests/ + + - name: Check formatting with black + run: | + black --check src/ tests/ + + - name: Run tests + run: | + pytest --cov=src/quant_research_starter --cov-report=xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + file: ./coverage.xml + flags: unittests + name: codecov-umbrella + + build-docker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build Docker image + run: | + docker build -t quant-research-starter:latest . diff --git a/.gitignore b/.gitignore index b512c09..eef69cf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -node_modules \ No newline at end of file +node_modules +.vscode +.coverage \ No newline at end of file diff --git a/README.md b/README.md index 0be2a12..3772ae6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,52 @@ -# template -A Template Repository for OpenSpringFest (OSF) +# QuantResearchStarter + +A modular, open-source quantitative research and backtesting framework designed for clarity and extensibility. Perfect for researchers, students, and developers interested in quantitative finance. + +![Python Version](https://img.shields.io/badge/python-3.10%2B-blue) +![License](https://img.shields.io/badge/license-MIT-green) +[![CI](https://github.com/username/QuantResearchStarter/actions/workflows/ci.yml/badge.svg)](https://github.com/username/QuantResearchStarter/actions) + +## Features + +- **Data Management**: Download real data or generate synthetic data for testing +- **Factor Library**: Implement momentum, value, size, and volatility factors +- **Backtesting Engine**: Vectorized backtester with transaction costs and constraints +- **Risk Metrics**: Comprehensive performance and risk analytics +- **Modular Design**: Easy to extend with new factors and strategies +- **Production Ready**: Type hints, tests, CI/CD, and documentation + +## Quick Start + +### Installation + +```bash +# Clone the repository +git clone https://github.com/username/QuantResearchStarter.git +cd QuantResearchStarter + +# Install package in development mode +pip install -e . + +# Install development dependencies +pip install -e ".[dev]" + +# Optional UI +pip install streamlit plotly +``` + +### Quick Demo + +```bash +make demo +``` + +Or step-by-step: + +```bash +qrs generate-data -o data_sample/sample_prices.csv -s 5 -d 365 +qrs compute-factors -d data_sample/sample_prices.csv -f momentum -f value -o output/factors.csv +qrs backtest -d data_sample/sample_prices.csv -s output/factors.csv -o output/backtest_results.json + +# Streamlit dashboard (optional) +streamlit run src/quant_research_starter/dashboard/streamlit_app.py +```