Skip to main content

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


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)

Uploaded Source

Built Distribution

physunits-0.0.5-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

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