Derived Dimensions and Units

SI prefixes

SI Prefix

Short Prefix

Order of Magnitude

yotta

Y

1024

zetta

Z

1021

exa

E

1018

peta

P

1015

tera

T

1012

giga

G

109

mega

M

106

kilo

k

103

hecto

h

102

deka

da

101

deci

d

10-1

centi

c

10-2

milli

m

10-3

micro

μ

10-6

nano

n

10-9

pico

p

10-12

femto

f

10-15

atto

a

10-18

zepto

z

10-21

yocto

y

10-24

Each of the SI named derived units have versions with these prefixes applied. Here, those are coulombs for charge, joules for energy, newtons for force, hertz for frequency, watts for power, pascals for pressure, ohms for resistance, and volts for voltage.

Volume is a curious case in that liters often has the milli- prefix applied milliliters but almost no other SI prefix is used with them. In general calculations, cubic meters are preferred. Nonetheless the full suite of prefixes is available for liters.

Area

class pyunitx.area.acres(value: Decimal | float | str)

An acre is a common measure of land area.

class pyunitx.area.hectares(value: Decimal | float | str)

A hectare is a unit of land area compatible with SI units, being defined as 10,000 square meters or the area of a square 100 meters on a side.

Charge

class pyunitx.charge.coulombs(value: Decimal | float | str)

A coulomb is formally defined as the amount of charge that travels past a point in a 1-Ampere current over the course of one second. Current is the defined fundamental quantity in the SI system, and is certainly easier to measure directly, but charge cannot be decomposed.

class pyunitx.charge.fundamental_charge(value: Decimal | float | str)

This is the charge of a single proton or electron.

Energy

class pyunitx.energy.btu(value: Decimal | float | str)

There are many different possible definitions of the British Thermal Unit, this is the thermochemical definition.

class pyunitx.energy.calorie(value: Decimal | float | str)

This is the gram calorie, the amount of heat energy necessary to heat 1 gram of water by 1 °C. Nutritional calories are 1000 times larger, using a kilogram in the calculation instead.

class pyunitx.energy.electronvolts(value: Decimal | float | str)

An electronvolt is the amount of energy a single electron gains by traveling through an electric potential of one volt. As volts are equivalent to joules per coulomb, that means the numerical value of this unit is identical to that of the fundamental charge expressed in coulombs.

In particle physics, masses are often stated in units of electronvolts making use of mass-energy equivalence through the famous E=mc^2. The mass of a proton, therefore, may be expressed as 938 MeV, leaving the “divided by c^2” implied.

class pyunitx.energy.joules(value: Decimal | float | str)

The joule is the base unit of energy in the SI system. It is the amount of work done on an object by pushing it with a 1 N force for 1 m.

Force

pyunitx.force.kgf

alias of kilograms_force

class pyunitx.force.kilograms_force(value: Decimal | float | str)

One kgf is the weight of a kilogram in standard earth gravity.

class pyunitx.force.newtons(value: Decimal | float | str)

The newton is the base SI unit of force.

class pyunitx.force.pounds(value: Decimal | float | str)

Pounds are a more elementary unit in US Customary System than an actual mass.

Frequency

class pyunitx.frequency.hertz(value: Decimal | float | str)

The hertz represents an occurrence once per second. Most commonly, this is used to measure sounds, where the occurrence is a soundwave peak passing.

class pyunitx.frequency.rpm(value: Decimal | float | str)

Revolutions per minute measure the action of a piston crank or of a wheel.

Power

class pyunitx.power.horsepower(value: Decimal | float | str)

One horsepower is 550 foot-pounds per second, and is produced by a very standards-compliant equine.

class pyunitx.power.watts(value: Decimal | float | str)

A watt is a joule per second. In most cases, like calculating the energy expenditure of a heating system, collecting rates of energy use is the most useful then multiplying by time to get overall energy usage.

Pressure

class pyunitx.pressure.bars(value: Decimal | float | str)

A bar is 105 pascals, around sea level atmospheric pressure.

class pyunitx.pressure.pascals(value: Decimal | float | str)

The pascal is the base unit of pressure, but it is very small.

class pyunitx.pressure.psi(value: Decimal | float | str)

Pounds per square inch are the typical units of pressure in US Customary System, despite not using the base unit of length.

class pyunitx.pressure.torr(value: Decimal | float | str)

One torr is equivalent to 1/760 of a standard atmosphere. It is used sometimes for fine gradations of pressure.

Resistance

Resistor Color Codes

Letter

Color

K

BLACK

B

BROWN

R

RED

O

ORANGE

Y

YELLOW

E

GREEN

U

BLUE

V

VIOLET

G

GRAY

W

WHITE

L

GOLD

S

SILVER

class pyunitx.resistance.Color(value)

Resistor color codes.

This associates the colors with their value as digits, or multipliers, or tolerance percentages.

digit()

Gets the value of a color when used as a digit.

multiplier()

Gets the value of a color when used as a multiplier.

temp_coefficient()

Gets the value of a color used as a temperature coefficient, in fractions per kelvin.

tolerance()

Gets the value of a color when used as a tolerance percentage.

class pyunitx.resistance.ohms(value: Decimal | float | str)

A current of one ampere traveling through one ohm of resistance drops its potential by one volt.

pyunitx.resistance.from_color(spec: str | Iterable[Color], include_tol=False, include_coeff=False) ohms | Tuple[ohms, ohms] | Tuple[ohms, ohms, meters_squared_kilograms_per_kelvin_per_ampere_squared_per_second_cubed]

Read the definition of a resistor from its color code.

By default, just returns the resistor value in ohms. The return type is changed by include_tol and include_coeff, as described below.

Parameters:
  • spec – Either a string where each character is a color code, or an iterable of Colors to be somewhat more readable.

  • include_tol – If True, output a tuple of (resistor value in ohms, absolute resistor tolerance in ohms).

  • include_coeff – If True, output a tuple of (resistor value in ohms, absolute resistor tolerance in ohms, absolute resistor temperature sensitivity in ohms per kelvin). Overrides include_tol.

Voltage

class pyunitx.voltage.volts(value: Decimal | float | str)

Volts are the only real unit of electrical potential energy.

Volume

class pyunitx.volume.cups(value: Decimal | float | str)

Cups are a common unit of measure when cooking. One cup is 8 fluid ounces or 16 tablespoons.

class pyunitx.volume.fluid_ounces(value: Decimal | float | str)

Fluid ounces are the closest the US Customary System has to a base unit of volume.

class pyunitx.volume.gallons(value: Decimal | float | str)

Gallons are the bulk unit of volume in the US Customary System. It is equal to 128 fluid ounces, or 4 quarts, or 8 pints, or 16 cups. At least this range of measurements is all powers of 2.

class pyunitx.volume.liters(value: Decimal | float | str)

A liter is one cubic decimeter, or a cube about as big as the palm of your hand.

class pyunitx.volume.milliliters(value: Decimal | float | str)

A milliliter is around 20 drops of water, or the size of a 1-cm cube.

class pyunitx.volume.tablespoons(value: Decimal | float | str)

Tablespoons are a common unit of measure when cooking. One tablespoon is 3 teaspoons.

class pyunitx.volume.teaspoons(value: Decimal | float | str)

Teaspoons are a common unit of measure when cooking. It’s about equal to 5 milliliters, if you need to do quick conversion.

Non-consistent Derived Units

class pyunitx.derived.lightyears(value: Decimal | float | str)

A lightyear is the distance light travels in one year. As the real duration of a year changes over time (we’re not going to say a lightyear is a different distance in a leap year) it uses a constant value of a Julian year, or 365.25 days.

class pyunitx.derived.parsecs(value: Decimal | float | str)

One parsec is an astronomical distance defined by observation of the stars. As we orbit the sun, nearer stars move with respect to the extremely distant ones, an effect called parallax. Since we know the distance from the earth to the sun, we can calculate the distance the distance to those stars with a little trigonometry.

If a star moves across an angle of one arcsecond as we observe it at either end of a distance of 1 AU, that means it is one parsec away.