Files
swehockey/python/pyproject.toml
T
Mats Tornberg 47e1811d9e Add the Python variant, agreeing with Go byte for byte
A second, independent implementation of the same contract, in the same repo:

- swehockey/dom.py builds the tree on html.parser, so the variant has no
  runtime dependencies; the only HTML5 behaviour it depends on - stray <tr>
  landing in an implicit <tbody> - is handled explicitly by table_rows().
- parse.py mirrors the Go layout profiles, dual-render checks, carry-forward and
  invariants; a DriftError is raised in the same places with the same advice.
- cli.py offers the same three commands, flags and exit codes as the Go main.
- tests/ assert against the Go golden files, so the suite is also a
  cross-implementation check. 23 offline tests plus an opt-in live test.

Verified against the live site: JSON and CSV are byte-identical to the Go
output (364 games, 102536 bytes / 365 lines), and the full archive crawl gives
the same 27 seasons, 2119 games and 1779 played.

Also split the DriftError hint out in Go, so a golden mismatch no longer tells
the reader to extend layouts[].
2026-09-27 08:53:23 +00:00

31 lines
817 B
TOML

[build-system]
requires = ["setuptools>=68"]
build-backend = "setuptools.build_meta"
[project]
name = "swehockey-schedule"
version = "1.0.0"
description = "Deterministic crawler for the stats.swehockey.se schedule table"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "MIT" }
authors = [{ name = "Mats Tornberg" }]
keywords = ["hockey", "swehockey", "shl", "crawler", "scraper", "deterministic"]
classifiers = [
"Programming Language :: Python :: 3",
"Topic :: Text Processing :: Markup :: HTML",
]
# No runtime dependencies on purpose: the HTML tree is built on html.parser
# from the standard library.
dependencies = []
[project.scripts]
swehockey-schedule = "swehockey.cli:main"
[project.urls]
Homepage = "https://git.k6n.net/mats/swehockey"
[tool.setuptools]
packages = ["swehockey"]