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.3.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for physunits-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5c07231e18fd69c43a9cd1a484876cb6cb88dca4f63e05507e775287753c1ec |
|
MD5 | 8ce0a222ab36770acf714dba4156fa8b |
|
BLAKE2b-256 | 73db33795ea7c35b3a393a3513b85fd900a5f3d83c61f313e47a2cf7b68125cf |