Skip to main content

Physical Units and Quantities for Python

Project description

Physical units and quantities for Python

This module is a Python binding of the C++ library scnt-puq. You can read more about this module and its functionality in the SciNumTool documentation.

Installation

To start, one has to install the scnt-puq library. On macOS this can be easily done using homebrew formula:

brew tap vrtulka23/scinumtools
brew install vrtulka23/scinumtools/scnt-puq

After that, one can proceed with the usual PyPi installation:

pip3 install pypuq

Examples of use

As already mentioned, pypuq is a binding to the standalone C++ library scnt-puq. Therefore, pypuq inherits all its usual functionality. However, the Python interface of exposed classes (Quantity, UnitSystem) is slightly adapted.

>>> from pypuq import Quantity
>>> 
>>> q = Quantity(16, 'm')
>>> r = Quantity(223, 's')
>>> speed = (q/r).convert('mph')
0.0717489*m*s-1

More examples and explanation are available in the SciNumTools documentation. You can also look at the test problems in the pytest directory.

Download files

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

Source Distribution

pypuq-1.3.7.tar.gz (6.2 kB view details)

Uploaded Source

File details

Details for the file pypuq-1.3.7.tar.gz.

File metadata

  • Download URL: pypuq-1.3.7.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pypuq-1.3.7.tar.gz
Algorithm Hash digest
SHA256 61f66c317e28766e5690d1bc319c3cd3daa339f100026f69d67e50eeae0a8f88
MD5 47825aea54af250d61d50fee49fb7432
BLAKE2b-256 09e47fd58d777ee8ff1829f41fd02003253ad51c7fa6c565e1ca98d989aa41df

See more details on using hashes here.

Supported by

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