Skip to main content

gram-value for Python

The data values of the gram notation, in pure Python with no dependencies: the eleven value kinds, equality and order, canonical gram text, interpretation of the ten known tags, and the mapping to Python values. The rules are in spec/ and the decisions in design/; the mapping table is docs/mappings/python.md.

import gram_value as gv

m = gv.measurement(gv.integer(5), "kg").unwrap()
gv.to_text(m).unwrap()  # "5kg"
gv.to_native(gv.integer(2**70)).unwrap()  # 1180591620717411303424: an int, exact

Constructors and conversions that can find a problem return a Result with ok, value and diagnostics; reading .value of a failed result raises GramValueError. Every Python entry of the mapping is exact, so to_native never reports a loss (fail_on_loss is there for symmetry with the other languages). This package does not parse gram text; use tree-sitter-gram for that.

uv sync
uv run pytest
uv run mypy

Metadata

Release files for gram-value 0.2.0

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

Source distribution (sdist)

Source distribution for gram-value 0.2.0
File Size Uploaded Provenance Actions
gram_value-0.2.0.tar.gz 16.7 kB With provenance Details for gram_value-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gram-value 0.2.0
File Interpreter ABI Platform Actions
gram_value-0.2.0-py3-none-any.whl Python 3 none any Details for gram_value-0.2.0-py3-none-any.whl

Total release size: 36.1 kB

Release files / gram_value-0.2.0.tar.gz

Download URL gram_value-0.2.0.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fda19ff484b05fd8830b35fdf6bb11b629d5ab77c65d333c3f14113e0ffbda63
BLAKE2b-256 checksum
How to use checksums
9f37540cb8b1bcb92803f8d60066f73ec7a2fa3028036338a22523ab3f5d2932
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Release files / gram_value-0.2.0-py3-none-any.whl

Download URL gram_value-0.2.0-py3-none-any.whl
Size 19.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68ac8ebd1361ead73a9a8679d9e6ecc8dee6c2d8daf1bc229e31bcc8780cb410
BLAKE2b-256 checksum
How to use checksums
1ce4ddf924eb646478c47c058fa1d4839109ca5c051d9e09c49d10b7b409bcd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 15, 2026.

Transparency log

Security for gram-value 0.2.0

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 gram_value-0.2.0.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 Nov 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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