Skip to main content

Dimvexa

dimvexa (Python)

Python binding for Dimvexa: Exact factors. Loud failures. Zero guessing. A thin PyO3 layer; all conversion logic is in the Rust core.

import dimvexa

dimvexa.convert(10.0, "m/s", "km/h")  # 36.0
c = dimvexa.conversion("m", "km")  # parse once ...
c(numpy_array)  # ... apply to float64 arrays, lists or floats

try:
    dimvexa.convert(1.0, "gal", "L")
except dimvexa.DimvexaError as e:
    e.code, e.candidates  # 'ambiguous_symbol', ['gal_us', 'gal_imp']

Configs, densities and constants work as in the CLI (dimvexa-config does the loading):

dimvexa.convert("4pi", "rad", "deg")  # 720.0: a string is an exact value (pi, * / ^, parentheses)
dimvexa.convert("pi/2", "rad", "deg"), dimvexa.quantity("2*pi rad").to("deg")  # 90.0, 360 deg
dimvexa.convert(1.0, "ton", "kg", configs=["us-customary"])  # 907.18474; a name or a file path
dimvexa.convert(1.0, "L", "kg", density="998.2067kg/m3")  # never assumed, only when asked
dimvexa.convert(1.0, "L", "kg", configs=["water"], density="water_25C")
dimvexa.constants(config_texts=[toml_text])  # pi, planck_constant, elementary_charge, boltzmann_constant, avogadro_constant, speed_of_light, molar_gas_constant, then your own
dimvexa.quantity("1 L", density="998.2067kg/m3").to("kg")  # exact; quantity() takes the same options
dimvexa.calc("sqrt(9 m2)")  # {"value": 3.0, "unit": "m", "exact": True, "text": "3 m"}
dimvexa.calc("sqrt(2 * dp / rho)", vars={"dp": "50 kPa", "rho": "998 kg/m3"}, to="m/s")  # exact when the mathematics is, "≈ ..." when not
dimvexa.calc("1500 m", autoprefix=True)["text"]  # "1.5 km"; sci=True or sci=4 for 1.5e3 / 1.500e3; exact=True adds the fraction
dimvexa.units(configs=["us-customary"]), dimvexa.unit_info("bbl_oil", config_texts=[toml_text])  # config units too

Every refusal is a DimvexaError (a ValueError) with a stable code, suggestions and candidates. exact=True routes through the exact rational path, rounded once. A string value is always exact; 1/2pi is refused as ambiguous (ambiguous_expression), write pi/2 or 1/(2*pi).

Build and test

This crate is its own workspace (it needs PyO3 and NumPy from the registry; the main workspace is std-only and offline). It is not part of cargo xtask ci.

cd bindings/python
python -m venv .venv && . .venv/bin/activate
pip install maturin pytest numpy
maturin develop
pytest

Wheels are abi3 (Python 3.9+). No performance claim is made until a dated benchmark run exists (docs/benchmarking.md).

Metadata

Release files for dimvexa 0.11.1

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

Source distribution (sdist)

Source distribution for dimvexa 0.11.1
File Size Uploaded Provenance Actions
dimvexa-0.11.1.tar.gz 17.5 kB With provenance Details for dimvexa-0.11.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for dimvexa 0.11.1
File Actions
dimvexa-0.11.1-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for dimvexa-0.11.1-cp39-abi3-win_amd64.whl
dimvexa-0.11.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for dimvexa-0.11.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
dimvexa-0.11.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for dimvexa-0.11.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
dimvexa-0.11.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for dimvexa-0.11.1-cp39-abi3-macosx_11_0_arm64.whl
dimvexa-0.11.1-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for dimvexa-0.11.1-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 2.8 MB

Release files / dimvexa-0.11.1.tar.gz

Download URL dimvexa-0.11.1.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e63a08316bc137f777cbc91fd0f0a7c175cec821063324c0f515b102041964e8
BLAKE2b-256 checksum
How to use checksums
251f93e17e706fbc31219458019ad82bfe63b49e9f5dec215e86ac5788fec09b
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 19, 2026.

Transparency log

Release files / dimvexa-0.11.1-cp39-abi3-win_amd64.whl

Download URL dimvexa-0.11.1-cp39-abi3-win_amd64.whl
Size 493.6 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
035e80fb2386663cd55f4069d88b89437cfa46edc9b8bf04d45eb7e7ba61ee58
BLAKE2b-256 checksum
How to use checksums
334389e831ae82fe78d429449eec9cbf59d861f6cf5e7c7206bc530c0bc8276c
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 19, 2026.

Transparency log

Release files / dimvexa-0.11.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL dimvexa-0.11.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 570.7 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
504ca988926820f415785a08c0d637abb921126ba01440a6af8c3dd85f3bf93e
BLAKE2b-256 checksum
How to use checksums
e387c9a7dc24024e0fffd6807d4bea21f1c9d75c82c7646c88ea85e3fc6e4a00
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 19, 2026.

Transparency log

Release files / dimvexa-0.11.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL dimvexa-0.11.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 547.5 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
3f847324dc20fc7dc3e5d46934847da0911e31a884ea41fe6ae8ab9cfaf02082
BLAKE2b-256 checksum
How to use checksums
84dc1bea9adce20c0d1b752437e1156972ad0573ad2f2560cf33abfcd12fa54a
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 19, 2026.

Transparency log

Release files / dimvexa-0.11.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL dimvexa-0.11.1-cp39-abi3-macosx_11_0_arm64.whl
Size 555.6 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1c04a27363ae1c0be8fafa1fe71c41215dc84928dbd1defa5a6d92119e40e862
BLAKE2b-256 checksum
How to use checksums
23961055ca7069620cbd9dc9a5dc5e32bb56dc0295484e8693d77d47cee1b038
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 19, 2026.

Transparency log

Release files / dimvexa-0.11.1-cp39-abi3-macosx_10_12_x86_64.whl

Download URL dimvexa-0.11.1-cp39-abi3-macosx_10_12_x86_64.whl
Size 573.9 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ff8fed9ce6c56564af0dda5d723997abaca90aa87dc8c59e148f1f1cea310822
BLAKE2b-256 checksum
How to use checksums
abfc74db62f9129f8cb2aecd39b99a2159ba427f2d7278613c0fdc910afc4e54
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 19, 2026.

Transparency log

Security for dimvexa 0.11.1

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

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for dimvexa-0.11.1.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 19, 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