Skip to main content

squoredata

Self-contained Pydantic v2 data structures used by Squore scoreboard tablets.

The package was extracted from tcboard. It contains only the data models, not the surrounding server logic. TypeScript bindings are generated from the models so that a JavaScript or TypeScript project can consume the same shape.

Models

  • SquoreMatch — a match as used by Squore, without any live information.
  • SquoreMatchLiveData — a SquoreMatch together with the live data a tablet reports. It adds the court and timestamp fields.

Supporting models: Players, Colors, Countries, Clubs, Event, Format, Wifi, Metadata, SquoreDeviceInfo, TimerInfo, Timing, When, Point, Game, and the LiveStatus enum.

Install

pip install squoredata

TypeScript bindings

scripts/generate_ts.py renders the JSON Schema of each model and converts it to TypeScript with json-schema-to-typescript. The output lives in typescript/ and is committed. The JSON Schema is the single source of truth: the interfaces and the runtime validators are both derived from it.

The npm package is published as @madduck/squoredata. It ships:

  • SquoreMatch.d.ts, SquoreMatchLiveData.d.ts — the interfaces
  • index.js, index.d.ts — Ajv-backed validators and the schemas object
  • schemas/*.schema.json — the schema documents, addressable on their own

The package version mirrors the Python version, and both come from the Git tag. The generated manifests are version-independent artefacts: they describe the models, not a release, so they always carry the placeholder 0.0.0. The release workflow stamps the tag-derived version into typescript/package.json and typescript/jsr.json with scripts/stamp_version.py before npm pack and before jsr publish. Because the placeholder never changes, the committed manifests change only when the models do, and CI's staleness check stays meaningful.

The Hatch build hook (hatch_build.py) runs the generator before a wheel is built, so a release can never carry stale bindings.

Install the generated package into another project from a published release, or from the local directory:

npx jsr add @madduck/squoredata
npm install /path/to/squoredata/typescript

Publishing

The TypeScript package is published to JSR as @madduck/squoredata, by the tag-triggered workflow in .github/workflows/1-build-and-publish.yml. JSR authenticates the workflow through OIDC, so no registry token is stored as a secret.

First-time setup: claim the @madduck scope at https://jsr.io/new and link it to the GitHub account that owns this repository.

To release by hand, with the version taken from the Git tag:

python scripts/generate_ts.py
git diff --exit-code typescript/   # must be clean before publishing
python scripts/stamp_version.py v0.1.1
cd typescript && npx jsr publish

The stamp step is what the release workflow does automatically; do not commit its output, because the committed manifests keep the placeholder version.

A local publish needs a JSR token; CI does not. Publishing a version that already exists fails, so always release from a tag.

Installing

JSR packages install into a Node project without an npmjs account. In a Node project, use the JSR CLI:

npx jsr add @madduck/squoredata

For Deno, deno add jsr:@madduck/squoredata works directly.

The release workflow also attaches the packed tarball to the GitHub Release. That route needs no registry and no account at all:

npm install https://github.com/madduck/squoredata/releases/download/v0.1.0/madduck-squoredata-0.1.0.tgz

The tarball has no version range and does not update, so prefer JSR unless you need a fully offline or account-free install.

Golden tests

The files in golden/ are the shared contract between the two sides:

  • tests/test_golden.py serialises and re-validates the models against the golden JSON.
  • typescript/tests/golden.ts assigns the same JSON to the generated interfaces, so tsc --noEmit fails when the two sides diverge.
  • typescript/tests/golden.test.js runs the generated validators against the same JSON, and asserts that they reject an extra property, a missing required property, and a wrong type.

Regenerate the golden files with python scripts/make_golden.py after a model change.

Development

pip install -e .[dev]
ruff check .
pytest
mypy --strict .

npm install
npm test

Metadata

Release files for squoredata 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for squoredata 0.1.2
File Size Uploaded Provenance Actions
squoredata-0.1.2.tar.gz 26.4 kB With provenance Details for squoredata-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for squoredata 0.1.2
File Interpreter ABI Platform Actions
squoredata-0.1.2-py3-none-any.whl Python 3 none any Details for squoredata-0.1.2-py3-none-any.whl

Total release size: 37.8 kB

Release files / squoredata-0.1.2.tar.gz

Download URL squoredata-0.1.2.tar.gz
Size 26.4 kB
Tags Source
SHA-256 checksum
How to use checksums
27edb27940b817518b6a24021f50413b44db512feddd8d0e1e26515c127ef315
BLAKE2b-256 checksum
How to use checksums
d43d832cb1c8b8598453f0e2cd0d53a761011b8bdc4a07b57f12ce75d0fc2bf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / squoredata-0.1.2-py3-none-any.whl

Download URL squoredata-0.1.2-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e4ebcc17bb47a637b2188e8103830f711c64df03b5400366751a6b4b205cae9
BLAKE2b-256 checksum
How to use checksums
682866e6ec790cf60b52d5e55d7933ceb50405e9d46dfd3790bd4e724743b73f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Security for squoredata 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for squoredata-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page