/ README.rst
README.rst
1 Introduction 2 ============ 3 4 5 6 7 .. image:: https://img.shields.io/discord/327254708534116352.svg 8 :target: https://adafru.it/discord 9 :alt: Discord 10 11 12 .. image:: https://github.com/CedarGroveStudios/CircuitPython_TemperatureTools/workflows/Build%20CI/badge.svg 13 :target: https://github.com/CedarGroveStudios/CircuitPython_TemperatureTools/actions 14 :alt: Build Status 15 16 17 .. image:: https://img.shields.io/badge/code%20style-black-000000.svg 18 :target: https://github.com/psf/black 19 :alt: Code Style: Black 20 21 A collection of CircuitPython helpers for calculating Dew Point, Heat Index, and for converting temperature units.. 22 23 24 ``Dew Point`` calculates dew point temperature from measured temperature (Celsius) 25 and humidity (percent). Returns the calculated dew point (Celsius) and summary 26 description. Detailed description is provided if ``verbose=True``. Dew point value 27 is constrained to the range of 0 to 40 (Celsius). 28 29 ``Heat Index`` calculates heat index temperature from measured temperature 30 (Celsius) and humidity (percent). Returns the calculated heat index (Celsius) 31 and summary description. Detailed description is provided if ``verbose=True``. 32 33 ``Unit Converters`` convert values between Celsius, Fahrenheit, and Kelvin. 34 35 36 .. image:: https://github.com/CedarGroveStudios/CircuitPython_AirQualityTools/blob/main/media/WARNING.jpg 37 38 Dependencies 39 ============= 40 This driver depends on: 41 42 * `Adafruit CircuitPython <https://github.com/adafruit/circuitpython>`_ 43 44 Please ensure all dependencies are available on the CircuitPython filesystem. 45 This is easily achieved by downloading 46 `the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_ 47 or individual libraries can be installed using 48 `circup <https://github.com/adafruit/circup>`_. 49 50 51 Installing to a Connected CircuitPython Device with Circup 52 ========================================================== 53 54 Make sure that you have ``circup`` installed in your Python environment. 55 Install it with the following command if necessary: 56 57 .. code-block:: shell 58 59 pip3 install circup 60 61 With ``circup`` installed and your CircuitPython device connected use the 62 following command to install: 63 64 .. code-block:: shell 65 66 circup install cedargrove_temperaturetools 67 68 Or the following command to update an existing version: 69 70 .. code-block:: shell 71 72 circup update 73 74 Usage Example 75 ============= 76 77 .. code-block:: python 78 79 from cedargrove_temperaturetools.dew_point import dew_point 80 from cedargrove_temperaturetools.heat_index import heat_index 81 from cedargrove_temperaturetools.unit_converters import ( 82 celsius_to_fahrenheit, 83 celsius_to_kelvin, 84 ) 85 86 # Measured temperature and humidity 87 TEMPERATURE = 24 # Degrees Celsius 88 HUMIDITY = 50 # Relative humidity in percent 89 90 dew_point_temp, description = dew_point(TEMPERATURE, HUMIDITY) 91 print(f"Dew Point = {dew_point_temp} {description}") 92 93 dew_point_temp, description = dew_point(TEMPERATURE, HUMIDITY, verbose=True) 94 print(f"Dew Point = {dew_point_temp} {description}") 95 96 heat_index_temp, description = heat_index(TEMPERATURE, HUMIDITY) 97 print(f"Heat Index = {heat_index_temp} {description}") 98 99 heat_index_temp, description = heat_index(TEMPERATURE, HUMIDITY, verbose=True) 100 print(f"Heat Index = {heat_index_temp} {description}") 101 102 print(f"Measured Temperature (Celsius) = {TEMPERATURE}") 103 print(f"Measured Temperature (Fahrenheit) = {celsius_to_fahrenheit(TEMPERATURE)}") 104 print(f"Measured Temperature (Kelvin) = {celsius_to_kelvin(TEMPERATURE)}") 105 106 107 108 Documentation 109 ============= 110 API documentation for this library can be found on `Read the Docs <https://github.com/CedarGroveStudios/CircuitPython_TemperatureTools/blob/main/media/pseudo_rtd_cedargrove_temperaturetools.pdf/>`_. 111 112 For information on building library documentation, please check out 113 `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_. 114 115 Contributing 116 ============ 117 118 Contributions are welcome! Please read our `Code of Conduct 119 <https://github.com/CedarGroveStudios/CircuitPython_AirQualityTools/blob/HEAD/CODE_OF_CONDUCT.md>`_ 120 before contributing to help this project stay welcoming.