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.1.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.1.0
File Size Uploaded Provenance Actions
gram_value-0.1.0.tar.gz 13.7 kB With provenance Details for gram_value-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 30.2 kB

Release files / gram_value-0.1.0.tar.gz

Download URL gram_value-0.1.0.tar.gz
Size 13.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bd87bfbe79bea974d3bdf2fc544c61b137ca598ee021e07594f22891e739dc05
BLAKE2b-256 checksum
How to use checksums
9648272e281138fe4baf0f1c3e797ba59014d819caeea24f97fe3c0981475998
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 14, 2026.

Transparency log

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

Download URL gram_value-0.1.0-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e53d8c2e1e79e9d87d663fa20d94ffe79befbab9ad548e46d78c321e7dcf5417
BLAKE2b-256 checksum
How to use checksums
93adc32aaa2a89db4f5eca08d3d5540b86f9d34ac40fcbad280cf6839d410f5f
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 14, 2026.

Transparency log

Security for gram-value 0.1.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.1.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 14, 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.1.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