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 npmjs and JSR as @madduck/squoredata, by the tag-triggered workflow in .github/workflows/1-build-and-publish.yml. Both registries authenticate the workflow through OIDC, so no registry token is stored as a secret.

First-time setup, both of which must exist before the first tagged release:

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
npm publish typescript --access public
cd typescript && npx jsr publish --allow-dirty

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 JSR publish needs a JSR token; CI does not. Publishing a version that already exists fails, so always release from a tag.

Installing

npm is the usual route. The tarball attached to each GitHub Release is the same file that was published to npm, so both resolve to one version:

npm install @madduck/squoredata

A JSR-aware runtime resolves the same package through JSR instead. 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 a registry 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.3.0.post3

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.3.0.post3
File Size Uploaded Provenance Actions
squoredata-0.3.0.post3.tar.gz 27.3 kB With provenance Details for squoredata-0.3.0.post3.tar.gz

Built distribution (wheel)

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

Total release size: 38.9 kB

Release files / squoredata-0.3.0.post3.tar.gz

Download URL squoredata-0.3.0.post3.tar.gz
Size 27.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8bc59405138d14eea646667246161730bd0c953b6ba9e24062def2bb498f7ed2
BLAKE2b-256 checksum
How to use checksums
5e4322718fc30ca59d7ce7da43a7d747a62f4024e51039568b5610c750d5f150
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 20, 2026.

Transparency log

Release files / squoredata-0.3.0.post3-py3-none-any.whl

Download URL squoredata-0.3.0.post3-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9a367a43bc708450d0f95dab53ed95d7e14c720632fee4e258165e5c7563aa0
BLAKE2b-256 checksum
How to use checksums
7cfc5b9cc8a1f0c4c34a0060f94d62a33b74616aa5d42b50ebda7101c9353921
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 20, 2026.

Transparency log

Security for squoredata 0.3.0.post3

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.3.0.post3.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 20, 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