Contributing¶
Guidelines for contributing to Data Miner.
Development Setup¶
# Clone and install in dev mode
git clone https://github.com/MVPavan/data_miner.git
cd data_miner
pip install -e ".[dev]"
# Start PostgreSQL
docker compose up -d
# Initialize database
data-miner init-db
Project Structure¶
data_miner/
├── cli.py # Click CLI commands
├── config/ # Pydantic configs + OmegaConf
├── db/ # SQLModel + PostgreSQL
├── workers/ # Long-running workers
├── modules/ # Core processing logic
├── models/ # ML model wrappers
└── utils/ # Utilities
Code Style¶
- Python 3.12+ features allowed
- Type hints required for public functions
- Docstrings for classes and public methods
- Black for formatting (line length 100)
- isort for imports
Adding a New Worker¶
- Create
workers/my_worker.py - Extend appropriate base class:
BaseVideoWorkerfor per-video processingBaseProjectVideosWorkerfor per-project-video processing-
BaseProjectStageWorkerfor project-level operations -
Implement
process()method - Add to supervisor config in
cli.py
Testing¶
Database Migrations¶
Currently using SQLModel's create_all(). For schema changes:
- Update models in
db/models.py - Run
data-miner init-db --force(destroys data!)
Submitting Changes¶
- Fork the repository
- Create a feature branch
- Make changes with tests
- Submit a pull request
Reporting Issues¶
Include: - Python version - PostgreSQL version - Config file (anonymized) - Error logs - Steps to reproduce