Converter

class tempyrature.tempyrature.Converter[source]

Bases: object

A simple temperature converter.

celsius2fahrenheit() float[source]

Converts celsius to fahrenheit.

Parameters

celsius (float) – The celsius temperature to convert.

Returns

The converted temperature.

Return type

float

Examples

>>> celsius2fahrenheit(25.0)
77.0

Formula

fahrenheit = 1.8 * celsius + 32

celsius2kelvin() float[source]

Converts celsius to kelvin.

Parameters

celsius (float) – The celsius temperature to convert.

Returns

The converted temperature.

Return type

float

Examples

>>> celsius2kelvin(10.0)
283.15

Formula

kelvin = celsius + 273.15

celsius2rankine() float[source]

Converts celsius to rankine.

Parameters

celsius (float) – The celsius temperature to convert.

Returns

The converted temperature.

Return type

float

Examples

>>> celsius2rankine(10.0)
509.66999999999996

Formula

rankine = (celsius + 273.15) * 9/5

fahrenheit2celsius() float[source]

Converts fahrenheit to celsius.

Parameters

fahrenheit (float) – The fahrenheit temperature to convert.

Returns

The converted temperature.

Return type

float

Examples

>>> fahrenheit2celsius(77.0)
25.0

Formula

celsius = (fahrenheit - 32) / 1.8

fahrenheit2kelvin() float[source]

Converts fahrenheit to kelvin.

Parameters

fahrenheit (float) – The fahrenheit temperature to convert.

Returns

The converted temperature.

Return type

float

Examples

>>> fahrenheit2kelvin(80.0)
299.81666666666666

Formula

kelvin = 273.15 + ((fahrenheit - 32.0) * (5.0/9.0))

fahrenheit2rankine() float[source]

Converts fahrenheit to rankine.

Parameters

fahrenheit (float) – The fahrenheit temperature to convert.

Returns

The converted temperature.

Return type

float

Examples

>>> fahrenheit2rankine(104.0)
563.6700000000001

Formula

rankine = fahrenheit + 459.67

kelvin2celsius() float[source]

Converts kelvin to celsius.

Parameters

kelvin (float) – The kelvin temperature to convert.

Returns

The converted temperature.

Return type

float

Examples

>>> kelvin2celsius(283.0)
9.850000000000023

Formula

celsius = kelvin - 273.15

kelvin2fahrenheit() float[source]

Converts kelvin to fahrenheit.

Parameters

kelvin (float) – The kelvin temperature to convert.

Returns

The converted temperature.

Return type

float

Examples

>>> kelvin2fahrenheit(299.81666666666666)
80.00000000000003

Formula

fahrenheit = (kelvin - 273.15) * 9/5 + 32

kelvin2rankine() float[source]

Converts kelvin to rankine.

Parameters

kelvin (float) – The kelvin temperature to convert.

Returns

The converted temperature.

Return type

float

Examples

>>> kelvin2rankine(313.15000000000003)
563.6700000000001

Formula

rankine = kelvin * 9/5

rankine2celsius() float[source]

Converts rankine to celsius.

Parameters

rankine (float) – The rankine temperature to convert.

Returns

The converted temperature.

Return type

float

Examples

>>> rankine2celsius(509.66999999999996)
10.0

Formula

celsius = rankine * 5/9 - 273.15

rankine2fahrenheit() float[source]

Converts rankine to fahrenheit.

Parameters

rankine (float) – The rankine temperature to convert.

Returns

The converted temperature.

Return type

float

Examples

>>> rankine2fahrenheit(563.6700000000001)
104.00000000000006

Formula

fahrenheit = rankine - 459.67

rankine2kelvin() float[source]

Converts rankine to kelvin.

Parameters

rankine (float) – The rankine temperature to convert.

Returns

The converted temperature.

Return type

float

Examples

>>> rankine2kelvin(563.6700000000001)
313.15000000000003

Formula

kelvin = rankine * 5/9