Physical units as global variables for simple numerical propagation
Project description
physunits
Simple package with common physical unit definitions.
Installation
Usage
An example usage of this package is:
>> from physunits import *
>> print(f"{1000 * cm / um:.2f} is how many microns there are in a thousand centimeters")
10000000.00 is how many microns there are in a thousand centimeters
The package tries to include only the most used unit prefixes, but you can generate other units, for example:
>>from physunits import *
>> minute = 60 * s
>> hour = 60 * minute
>> day = 24 * hour
>> print(f'There are approximately {365*day / hour} hours in a year.')
There are approximately 8760.0 hours in a year.
The unit prefixes act as simple globals. If only a set of units is desired, manually importing them as:
from physunits import mm, nm, um
is sufficient.
Contact and support
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 Distribution
physunits-0.0.5.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for physunits-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e7493adf70bba3435cf42f0f0cf85264f050ad53d221fdeb4244d0baa2c424e |
|
MD5 | e461789aac131aa10e3d434ff3763821 |
|
BLAKE2b-256 | b3de5fea9ce479990af2c3fe84ca4eecce8b5f467010bbca3369499645d76eba |