Logo

A performant, verbose and generic physical unit system.

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

Getting started

This tutorial shows how to import units and perform basic calculations with them. It also demonstrates how the console output changes when using prefixes and composite units.

from qunits import u
# This imports all default units with prefixes.

s = 8 * u.m
dt = 2 * u.ms
v = s / dt  # >>> 4000.0 m/s

a = v / (2 * u.s)  # >>> 2000.0 m/s^2

f = 200 * u.kg * a  # >>> 400.0 kN