Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dv_py-0.3.3-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (270.3 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARMv7l

dv_py-0.3.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (260.0 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

dv_py-0.3.3-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (272.1 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARMv7l

dv_py-0.3.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (261.0 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

dv_py-0.3.3-cp38-abi3-win_amd64.whl (175.8 kB view details)

Uploaded CPython 3.8+Windows x86-64

dv_py-0.3.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (274.8 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

dv_py-0.3.3-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (270.4 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARMv7l

dv_py-0.3.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (260.3 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

dv_py-0.3.3-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (498.1 kB view details)

Uploaded CPython 3.8+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file dv_py-0.3.3-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for dv_py-0.3.3-pp310-pypy310_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 91b8b9443b777c95a1af2cc952f15be9ce6281f0d89af47139d469b3eb3dd6e4
MD5 80ae080a3e91135152e48956b07461f4
BLAKE2b-256 6d557d48cb9481b68a63b8179d7bf2e86a7e91177401b7eb72d1d05ddf3407c8

See more details on using hashes here.

File details

Details for the file dv_py-0.3.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dv_py-0.3.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 19ee14bfb96936cb69593f6fd48c83809fab97142bad5a8dffef804d0cd748e7
MD5 c98215842e7c98cff6c84016ec231365
BLAKE2b-256 ebc2c7f3e58ffb39c0cbc584cd247e98a4a44e19d305b61fd9aa7d8259dda12e

See more details on using hashes here.

File details

Details for the file dv_py-0.3.3-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for dv_py-0.3.3-pp39-pypy39_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 7512bd7aa6281c2d8d4fb02b35dbfafdbf194ad336099dc2f3d7a7fb8e400bb1
MD5 18a7e537d0a71a0ef5657fd5a0382400
BLAKE2b-256 c7f959bcf9a47a7f86e961cf5d5b91627867fab3b12b74011ff005268055287d

See more details on using hashes here.

File details

Details for the file dv_py-0.3.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dv_py-0.3.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0e69050e9692e521a627da03e9b2a07334a735b5c206912c099ce4ae87d85f3f
MD5 b86d5d11e07b0886d342cc818be02eda
BLAKE2b-256 05bda3f5a79b36ed206df0ae614cc137835d8c9d65dbe0df93aa42646a8ee93c

See more details on using hashes here.

File details

Details for the file dv_py-0.3.3-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: dv_py-0.3.3-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 175.8 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

Hashes for dv_py-0.3.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 776a97cf5f027f369c4454f050d1c4a143d6a904b1cf6c389395eb792a4eef7d
MD5 a4e5336f9f90460ea0536bede200f3b7
BLAKE2b-256 c18d5e85e79a787732b0bd57c1cda26df3f5228b9916ea2fd70ddacfc5b1e7ab

See more details on using hashes here.

File details

Details for the file dv_py-0.3.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dv_py-0.3.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc417b69061f4b74bdb9b9ba754730c3eb2059f766ac2e77cd7977d2195a8d08
MD5 3b185d5d558d59fdd2dca3837bf01be3
BLAKE2b-256 f059749ae053399479ac52df68d6725ccad454b24e78094e73e12f963f7eaace

See more details on using hashes here.

File details

Details for the file dv_py-0.3.3-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for dv_py-0.3.3-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 ad4fed313228ed8685efa990a16360fc9afd9691fef27518805f53384cb7c3f7
MD5 f9ac5e9155e3f454a464ddb68fbbdde4
BLAKE2b-256 fa814163886e07a84769486c18f192fd39592ffdd6496204c8bc3c7be127169d

See more details on using hashes here.

File details

Details for the file dv_py-0.3.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dv_py-0.3.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8c90aa8674728443f795a25aa9e1a9e3d57e2db774e9c685aa8a40eaf7068268
MD5 e71dc443ee3b282119d3fe33c493d8df
BLAKE2b-256 1ac6f18335a46f5aecb54375055b00e8730b7c7d5611f23aa87a4adfeec54126

See more details on using hashes here.

File details

Details for the file dv_py-0.3.3-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for dv_py-0.3.3-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 3d0311bb3f8fd5eb280aa0a9b2c55bdbb71147a1c3a172e965728208eaa86c45
MD5 3adefd68c3de5ec214fad20df8ce8c09
BLAKE2b-256 7f77d955fe202d2c272e6a726a9e4af21fa0bb2b38090a057e85ae16b8fabed3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page