Port the display reader from the web server's rowing module as a second extraction method: send the whole photo to claude-haiku-4-5 and ask for elapsed time and distance as JSON. The prompt, model and reply parsing are unchanged; what is new is reading from a file, converting the reply to WorkoutStats so both methods produce the same rows, and accepting ANTHROPIC_API_KEY as well as CLAUDE_API_KEY. Select it with 'rowing-stats --method haiku'. The anthropic SDK is an optional extra, imported only when the baseline is used, so the OCR pipeline still installs and runs without it or an API key. Co-Authored-By: Claude Opus 5.5 <[email protected]>
32 lines
729 B
TOML
32 lines
729 B
TOML
[build-system]
|
|
requires = ["setuptools>=77"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "rowing-stats"
|
|
version = "0.1.0"
|
|
description = "Extract rowing stats from photos of a Concept2 PM5 monitor using OpenCV and Tesseract OCR"
|
|
readme = "README.md"
|
|
requires-python = ">=3.10"
|
|
dependencies = [
|
|
"numpy>=2.0",
|
|
"opencv-python-headless>=4.10",
|
|
"pillow>=10.0",
|
|
"pytesseract>=0.3.10",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
baseline = ["anthropic>=1.0"]
|
|
dev = ["pytest>=8.0", "anthropic>=1.0"]
|
|
notebook = ["ipykernel", "matplotlib"]
|
|
|
|
[project.scripts]
|
|
rowing-stats = "rowing_stats.cli:main"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["src"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
pythonpath = ["src"]
|