Skip to main content

pytemperatureconverter

This is a python package that provides various functions for converting temperatures between different scales, such as Celsius, Fahrenheit, Kelvin and Rankine.

Installation

This package requires Python 3.11 or higher and pytest for testing

Usage

To use this package, you need to import it in your Python code:

from temperatureconverter import converter

The converter module provides the following functions:

celsius_to_fahrenheit(c): Converts Celsius to Fahrenheit. celsius_to_kelvin(c): Converts Celsius to Kelvin. celsius_to_rankine(c): Converts Celsius to Rankine. fahrenheit_to_celsius(f): Converts Fahrenheit to Celsius. fahrenheit_to_kelvin(f): Converts Fahrenheit to Kelvin. fahrenheit_to_rankine(f): Converts Fahrenheit to Rankine. kelvin_to_celsius(k): Converts Kelvin to Celsius. kelvin_to_fahrenheit(k): Converts Kelvin to Fahrenheit. kelvin_to_rankine(k): Converts Kelvin to Rankine. rankine_to_celsius(r): Converts Rankine to Celsius. rankine_to_fahrenheit(r): Converts Rankine to Fahrenheit. rankine_to_kelvin(r): Converts Rankine to Kelvin.

Each function takes a numeric value as an argument and returns a numeric value as a result. For example:

converter.celsius_to_fahrenheit(0) 32.0 converter.fahrenheit_to_kelvin(32) 273.15 converter.kelvin_to_rankine(273.15) 491.67

Testing

The functions have been tested using pytest. ============================= test session starts ============================= platform win32 -- Python 3.11.0, pytest-7.3.0, pluggy-1.0.0 -- C:\Users\username\AppData\Local\pypoetry\Cache\virtualenvs\pytemperatureconverter-4KrmmL8q-py3.11\Scripts\python.exe cachedir: .pytest_cache rootdir: C:\Users\username\Desktop\pytemperatureconverter collecting ... collected 12 items

tests/test_functions.py::test_celsius_to_fahrenheit PASSED [ 8%] tests/test_functions.py::test_celsius_to_kelvin PASSED [ 16%] tests/test_functions.py::test_celsius_to_rankine PASSED [ 25%] tests/test_functions.py::test_fahrenheit_to_celsius PASSED [ 33%] tests/test_functions.py::test_fahrenheit_to_kelvin PASSED [ 41%] tests/test_functions.py::test_fahrenheit_to_rankine PASSED [ 50%] tests/test_functions.py::test_kelvin_to_celsius PASSED [ 58%] tests/test_functions.py::test_kelvin_to_fahrenheit PASSED [ 66%] tests/test_functions.py::test_kelvin_to_rankine PASSED [ 75%] tests/test_functions.py::test_rankine_to_celsius PASSED [ 83%] tests/test_functions.py::test_rankine_to_fahrenheit PASSED [ 91%] tests/test_functions.py::test_rankine_to_kelvin PASSED [100%]

============================= 12 passed in 0.03s ==============================

License

This project is licensed under the MIT License.

Metadata

Release files for pytemperatureconverter 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytemperatureconverter 0.1.0
File Size Uploaded
pytemperatureconverter-0.1.0.tar.gz 2.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytemperatureconverter 0.1.0
File Interpreter ABI Platform
pytemperatureconverter-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.8 kB

Release files / pytemperatureconverter-0.1.0.tar.gz

Download URL pytemperatureconverter-0.1.0.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ac4f93de084739360afe252952861f8ba2cf75704a5637b0ca3b265ec101ad96
BLAKE2b-256 checksum
How to use checksums
9c7766ea82df23a00aa26b880017661625562697febb3fe4e569284e191401c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.11.0 Windows/10

Release files / pytemperatureconverter-0.1.0-py3-none-any.whl

Download URL pytemperatureconverter-0.1.0-py3-none-any.whl
Size 2.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b36eef49cf5e99a60a2ff9b71e2b1ee27d4d7a347ec0266106a95b5b4124c63d
BLAKE2b-256 checksum
How to use checksums
f8450f3df1fe4ea0ee43187ab5697a96fecb81d0b41126db7f6156a7d02f0e91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.4.2 CPython/3.11.0 Windows/10

Release history Release notifications | RSS feed

1.2.0

2 release files

1.1.0

2 release files

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page