Skip to main content

Typed engineering quantities with SI-default storage, built on pint

Project description

engunits

Tests MIT License Python 3.12+

Typed engineering quantities with SI-default storage, built on pint.

Install

pip install engunits

Quick start

from engunits import Mass, Length, Velocity

# Create quantities — SI units by default
m = Mass(1000, "lb")       # stored internally as kg
l = Length(5, "ft")         # stored internally as m

# Convert on demand
print(m("kg"))              # 453.592 kg
print(l("m"))               # 1.524 m

# Callable syntax for conversion
v = Velocity(100, "m/s")
print(v("ft/s"))            # 328.084 ft/s

# Arithmetic
total = Mass(10, "kg") + Mass(5, "kg")
scaled = Length(3, "m") * 2
ratio = Mass(30, "kg") / Mass(10, "kg")  # returns float: 3.0

Supported quantities

Class SI Unit
Mass kg
Length m
Time s
Temperature K
Velocity m/s
Force N
Moment N·m
Power W
Energy J
Area
Volume
Density kg/m³
Pressure Pa
AngularVelocity rad/s
Voltage V
Current A
Capacity A·h

License

MIT

Project details


Download files

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

Source Distribution

engunits-0.1.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

engunits-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file engunits-0.1.0.tar.gz.

File metadata

  • Download URL: engunits-0.1.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for engunits-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cc4a0c89b375f12fdec858a9c71d86942dd9d4272e2a0028324c552404283ab0
MD5 08e6988786e5d49ff946824f6ee75c00
BLAKE2b-256 f823ea9979d371606d9fc88c4095512ef49c9328ab5c24c2c349b3b68e97587f

See more details on using hashes here.

Provenance

The following attestation bundles were made for engunits-0.1.0.tar.gz:

Publisher: release.yml on matuscvengros/engunits

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file engunits-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: engunits-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for engunits-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ac64a88a76a1f74263842338de8ab9c83bd0718d7ec87bd47121ce422adb60e
MD5 7c01e0bec124a13bafc6f45415ce7143
BLAKE2b-256 8b15cb93b48870060000022244b0fe29960b2b9b68fa284529cc7de85447dcd7

See more details on using hashes here.

Provenance

The following attestation bundles were made for engunits-0.1.0-py3-none-any.whl:

Publisher: release.yml on matuscvengros/engunits

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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