Skip to main content

ogxm

The Python package for OGXM, the backgammon match format: read and write .ogxm files, read .ogxms streams (many matches in one file, as match databases publish them), and check the signatures a file carries.

The package is a thin layer over libogxm, the reference codec, which the wheel bundles. Every rule of the format runs in that one codec, so a file this package accepts is a file every OGXM reader accepts.

pip install ogxm               # the codec and streams, no dependencies
pip install "ogxm[verify]"     # plus Ed25519 signature checks (cryptography)
pip install "ogxm[zstd]"       # plus zstandard, for .ogxms.zst dumps

Files

import ogxm

data = open("match.ogxm", "rb").read()
doc = ogxm.binary_to_json(data)      # the JSON projection (OGXM_JSON_SPEC.md)
print(doc["player_white"], doc["player_black"], doc.get("event"))

ogxm.v2_problem(doc)                 # None, or the name of the rule a document breaks
assert ogxm.json_to_binary(doc) == data

The JSON projection is a view for programs. The binary file is the interchange format: store and exchange that.

Streams

A stream is complete OGXM files back to back. A truncated download still reads: every complete match comes out before StreamTruncated is raised.

import zstandard, ogxm

with open("matches-2026-09.ogxms.zst", "rb") as raw:
    reader = zstandard.ZstdDecompressor().stream_reader(raw)
    for member in ogxm.iter_stream(reader):
        doc = ogxm.binary_to_json(member)

iter_stream(f, strict=False, on_skip=...) skips a corrupt member and resumes at the next one that verifies. ogxm.match_digest(member) is the key an Analysis-shape file joins its match by. StreamWriter(f).write(member) appends a member, refusing one without a checksum.

Signatures

ogxm.verify_analysis(data, index=0, keys={publisher_key})
ogxm.verify_match(data, keys={publisher_key})

Pass the publisher's raw Ed25519 public keys for the purpose being checked. Without keys, a valid signature proves the file is intact, not who signed it.

The library

ogxm.library_version() is the bundled codec's release; the package version is the same number. Set LIBOGXM_PATH to use another build of the library.

Metadata

Release files for ogxm 2.1.0

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

Built distributions (wheels)

Table of built distributions (wheels) for ogxm 2.1.0
File Interpreter ABI Platform
ogxm-2.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
ogxm-2.1.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.24+ ARM64, Linux glibc 2.28+ ARM64 Details

Total release size: 978.9 kB

Release files / ogxm-2.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL ogxm-2.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 508.7 kB
Tags Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
2f3319ee422ac1d4960d3214cda80210e2ab5e8d8816a578a643268dd9b366c6
BLAKE2b-256 checksum
How to use checksums
bc2ea4a4a9e48d11fc914127be3f7090c08eb4fc06ea9cd9cfeacbc9befb2c42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / ogxm-2.1.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL ogxm-2.1.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 470.2 kB
Tags Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
f978dcc3b5faca129e19eb9ea08367704300a1cada0987bc276b24dfc4e6cf5c
BLAKE2b-256 checksum
How to use checksums
78ff3101f0828ab37115c1ec0405738ad9984b5a6620866aae3328dbdddd3481
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

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