Thanks for your interest in contributing! This document explains how to get started.
git clone https://github.com/mihailorama/docfold.git
cd docfold
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -e ".[dev]"pytest # all tests
pytest tests/ -v # verbose
pytest -k "test_router" # filter by name
pytest --cov=docfold # with coverage reportWe use Ruff for linting and formatting:
ruff check src/ tests/ # lint
ruff format src/ tests/ # format
mypy src/ # type check- Create
src/docfold/engines/your_engine.py - Subclass
DocumentEngineand implementname,supported_extensions,is_available(), andprocess() - Add an optional dependency group in
pyproject.toml - Register the engine in
cli.py→_build_router() - Add tests in
tests/engines/test_adapters.py - Update
README.mdsupported engines table
- Add the function to
src/docfold/evaluation/metrics.py - Add tests in
tests/evaluation/test_metrics.py - Wire it into
EvaluationRunner._evaluate_single()if it uses ground truth data - Update
README.mdmetrics table
Ground truth annotations are valuable. To contribute:
- Place the source document in
tests/fixtures/golden/<category>/ - Create a
<filename>.ground_truth.jsonalongside it following the schema indocs/evaluation.md - Keep files small (< 1 MB per document)
- Fork the repo and create a feature branch from
main - Make your changes with tests
- Ensure
pytestandruff checkpass - Submit a PR with a clear description of what and why
Open a GitHub issue with:
- What you expected vs. what happened
- Minimal reproducible example
- Python version and OS
- Installed extras (
pip list | grep docfold)