Python bindings for dv (DimensionalVariable) - keeping track of units and dimensions for physical quantities
Project description
DV - Dimensional Variables
DV (DimensionalVariable) is a Python library for handling physical quantities with automatic unit checking and conversion. It is a wrapper library to the core Rust library, which contains all the logic. Read more about the project (including extra docs) at https://dv.alextac.com.
Features
- Unit-safe math: Add, subtract, multiply, divide with automatic unit checking
- Easy conversions: Convert between any compatible units
- Comprehensive unit support: SI units, imperial units, and more
- Type safety: Catch unit errors at runtime before they cause problems
Quick Example
from dv_py import DimensionalVariable as dv
# Create dimensioned variables
velocity = dv(10.0, "m/s")
time = dv(2.0, "s")
# Automatic dimensional analysis
distance = velocity * time
print(distance.value_in("m")) # 20.0
print(distance.value_in("km")) # 0.02
# Unit checking prevents errors
mass = dv(5.0, "kg")
distance + mass # Raises DVError: incompatible units!
Installation
pip install dv_py
Documentation
Full documentation, examples, and guides at: https://dv.alextac.com
License
This project is licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright © 2025 Alex Tacescu
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dv_py-0.3.2-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: dv_py-0.3.2-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 273.7 kB
- Tags: PyPy, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d7355b92653cb11deb30e7722d0d1c87c5915f2477b9dbbeafcd845f1103ba0
|
|
| MD5 |
cf501aff7f450b609837b9622e382d1c
|
|
| BLAKE2b-256 |
a4322b32f101cf544372892747fc46ee79fda1cfdeac0a5f0af1b99a3defdd4e
|
File details
Details for the file dv_py-0.3.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: dv_py-0.3.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 263.4 kB
- Tags: PyPy, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cff1698494ff89d4d250046525b5baf7caa30e7d3cca9a4905e4387bc06db6d
|
|
| MD5 |
7793d4a42816dfe085199091e0b3548e
|
|
| BLAKE2b-256 |
a83f23e4a2fd3186f1d1f93ebc5e68d580193fef8b352c1e5aafa9b5f8b5266f
|
File details
Details for the file dv_py-0.3.2-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: dv_py-0.3.2-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 274.9 kB
- Tags: PyPy, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64de3720d0b1b785c874df4960c324bf42ab90a2083c788c131f6b9ca221b54d
|
|
| MD5 |
7b4e3a88447e6efc4ebb898b32cb4c74
|
|
| BLAKE2b-256 |
9d31d43e3b316fb782e6cb8fa54aa0aa7bd25a2c3770695c365e6f3672899e69
|
File details
Details for the file dv_py-0.3.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: dv_py-0.3.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 263.9 kB
- Tags: PyPy, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cc9f2fa179d0f0016cf45c014ff5606244fe230198d1b7ac2b4cf740c4a53b8
|
|
| MD5 |
d3bb6c49b08b7a5b944ce71e01d0bb19
|
|
| BLAKE2b-256 |
1ac92d8a9cffd0c9286a97409d34a9b40858f0c3312a379f88268f57ff340235
|
File details
Details for the file dv_py-0.3.2-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: dv_py-0.3.2-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 177.0 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f37bf433fdc93bb58f81442c2b0e376c86a1b1f1b1fa60f7a70fe6bba52f886
|
|
| MD5 |
6b85c225e490584bcb2687bb4f9d04d8
|
|
| BLAKE2b-256 |
d595e987aee1ad8097ac2eef21c579075c474cdafd66bb166131ac338f8d414c
|
File details
Details for the file dv_py-0.3.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: dv_py-0.3.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 278.5 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec39cceb62ab74ca569c56de6a5e10d2ec0b5ebd227337c4ae14975179d72278
|
|
| MD5 |
5dba64c80742179d2686dc31a2fc2cd2
|
|
| BLAKE2b-256 |
8d7629ba1bbf1b5ee12477702e3e376c540e7dc984b83699af8b91ab9a4af1cc
|
File details
Details for the file dv_py-0.3.2-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: dv_py-0.3.2-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 273.6 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f81ccf7a1195f009e4ebf9ebc1c5ee682a3708edb60c89975484f1092db70e15
|
|
| MD5 |
8426c71d433d3ed5af5f08c715ed8152
|
|
| BLAKE2b-256 |
7f137b97f113c7c9d2e573c80d8032de9de2c8a5ca2e80406a1d035b05fab188
|
File details
Details for the file dv_py-0.3.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: dv_py-0.3.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 263.5 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdb6a4ebd1ca2ebba2c69bf03cc246c52ef4730a0020eb7fbd4dff576525efaa
|
|
| MD5 |
2aa48535b0cd7e286dc3f7ce98e7b7ba
|
|
| BLAKE2b-256 |
601f4e2bc1f8d1196d82669d2ac382239de01da61d5d14b7de0570bb0a529022
|
File details
Details for the file dv_py-0.3.2-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: dv_py-0.3.2-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 509.0 kB
- Tags: CPython 3.8+, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c416712efeb353b4d10185d3bb4c258be753c6f16b92726c534094a1de3c497
|
|
| MD5 |
1b47a1130e8cce85814630ca7f606705
|
|
| BLAKE2b-256 |
f3e4152a15d5a5530ced721079ff0397bdf345d41a0cfc2bc42a52663310150a
|