forallpeople documentation

“For all time. For all people.” - Nicolas de Caritat (Marquis de Condorcet), in regards to the metric system (now the SI system)

forallpeople is a Python library for representing the SI base units to enable easy-to-use, units-aware calculations. In addition to the SI base units, forallpeople can be used to represent units which are defined by the SI unit system, such as US Customary units.

Installation#

pip install forallpeople

A Simple Example#

[3]:
import forallpeople as si
si.environment('default')

g = 9.81 * si.m/si.s**2
m = 3500 * si.kg
force = m * g
force
[3]:
34.335 kN

Features#

  • Rich representations for use in Jupyter (HTML, Latex, plain-text)

  • Units display as conventional symbols by default

  • Units “auto-reduce” based upon the unit environment

  • Auto-scaling of SI derived units and base units (e.g. 1100 Hz -> 1.1 kHz)

  • Conversion between units defined in your environment

  • Custom unit environments for defining US, imperial, and derived SI unit options

  • Interactive imports to push unit names into the top level namespace

  • Immutable, hashable instances

Contents#