On-the-go data analysis toolkit optimized for Cursor Cloud Agent development.
A lightweight Python package for rapid iteration on data analysis tasks, designed to work seamlessly with Cursor agents. Built with pandas and seaborn for data manipulation and visualization.
- Domain-driven architecture: Organized by domain (NFL, health, research, etc.)
- CLI-first design: Typer-based CLI for interactive analysis
- Caching: Parquet-based caching for efficient data retrieval
- Headless plotting: Seaborn visualizations saved to artifacts/
- Agent-friendly: Startup prompts and templates for Cursor Cloud Agent workflows
# Install dependencies
pip install -e .
# Or with dev dependencies
pip install -e ".[dev]"# Fetch NFL data for a season
ditto nfl fetch --season 2023 --weeks 1,2,3
# Analyze a team's recent performance
ditto nfl analyze --season 2023 --team NYG --window 5
# Generate visualization plots
ditto nfl plot --season 2023 --team NYG --window 5# Format code
black src/ tests/
# Lint code
ruff check src/ tests/
# Run tests
pytest tests/ -v
# Clean cache and artifacts
rm -rf data/cache/* artifacts/*-
Use the startup prompt: The repository includes a built-in startup workflow in
.cursor/startup_prompt.md -
Run the startup command:
# In Cursor, use the agent command: # "Follow the startup prompt workflow and ask me the 5 questions"
-
Answer the 5 questions:
- (a) Iteration name (slug) + domain
- (b) Primary user & success metric
- (c) Inputs/data sources + constraints
- (d) Outputs + definition of done
- (e) Time budget + risk tolerance
-
Automatic setup: The agent will:
- Generate
iterations/<slug>/PRD.md - Generate
iterations/<slug>/IMPLEMENTATION.md - Generate
iterations/<slug>/TASKS.md - Update README with iteration details
- Update
prompts/commands.ymlwith defaults
- Generate
- View tasks: Check
iterations/<slug>/TASKS.md - Update progress: Mark tasks complete in TASKS.md
- Run commands: Use the CLI commands defined in the iteration docs
ditto/
├── src/ditto/ # Core package
│ ├── __init__.py
│ ├── cli.py # CLI entry point
│ ├── core/ # Core utilities
│ │ ├── config.py # Configuration & paths
│ │ └── io.py # I/O operations
│ └── domains/ # Domain-specific modules
│ └── nfl/ # NFL analysis domain
│ ├── ingest.py # Data fetching & caching
│ ├── features.py # Feature engineering
│ ├── models.py # Data models
│ └── plots.py # Visualization
├── iterations/ # Iteration documentation
│ └── _template/ # Template files
├── prompts/ # Agent prompts & commands
├── tests/ # Test suite
├── data/ # Data storage
│ └── cache/ # Cached data (parquet)
├── artifacts/ # Generated outputs (plots, reports)
└── .cursor/ # Cursor agent configuration
The NFL domain provides commands for fetching, analyzing, and visualizing NFL play-by-play data.
- Primary: nflfastpy (requires
pip install nflfastpy) - Fallback: Sample data provider for testing (works offline)
ditto nfl fetch --season YEAR [--weeks 1,2,3]: Fetch and cache NFL dataditto nfl analyze --season YEAR --team TEAM --window N: Analyze team performanceditto nfl plot --season YEAR --team TEAM --window N: Generate visualization plots
# 1. Fetch data for weeks 1-5 of 2023 season
ditto nfl fetch --season 2023 --weeks 1,2,3,4,5
# 2. Analyze Giants performance over last 3 weeks
ditto nfl analyze --season 2023 --team NYG --window 3
# 3. Generate plots
ditto nfl plot --season 2023 --team NYG --window 3- File size limit: No file >300 lines
- Pure functions: Core logic separated from I/O
- Testing: Unit tests for pure functions, integration tests for CLI workflows
- Documentation: All modules and functions documented
- Follow the file structure conventions
- Keep files under 300 lines
- Write tests for new functionality
- Update iteration docs as you work
MIT