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.1

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.1
File Size Uploaded
pytemperatureconverter-0.1.1.tar.gz 2.1 kB Details

Built distribution (wheel)

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

Total release size: 4.8 kB

Release files / pytemperatureconverter-0.1.1.tar.gz

Download URL pytemperatureconverter-0.1.1.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e43853478afb43ae229c8edc86bff15d35fb7f1454c208d38d12d24ca2cb4907
BLAKE2b-256 checksum
How to use checksums
fad18e33672cdf5cedc3e22ec9600f8e0a5d0a4f6424863109447d2d8a40e1d1
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.1-py3-none-any.whl

Download URL pytemperatureconverter-0.1.1-py3-none-any.whl
Size 2.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a535edd4979cfd9fa75279fa07520ac84292064c1a8acd197d373f298656b51d
BLAKE2b-256 checksum
How to use checksums
86d94aaf82f8dcba5de50a9f383dace37a42bbe3051faae6eb43d50c55810df1
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

This release

0.1.1 This release

2 release files

0.1.0

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