A simple energy conversion library
Project description
PyEnergyX
PyEnergyX is a robust Python library aimed at professionals in the energy industry. It provides a reliable and accurate method for converting between various energy units.
Overview
With PyEnergyX, you can conveniently convert between common units as well as less conventional ones like Tonne of Coal Equivalent, Barrel of Aviation Gasoline, BTU, tons of coal, barrels of oil, joules, and many more.
The main source for the conversion factors used in this library is the Energy Information Administration (eia.gov) and the American Physical Society (aps.org), which ensures high accuracy and reliability of the conversions.
Installation
To install PyEnergyX, you can use pip to install directly from the GitHub repository:
pip install git+https://github.com/mariodgr/pyenergyx.git
Usage
Here's how to use PyEnergyX:
First, import the EnergyConverter class and create an instance:
from pyenergyx import EnergyConverter
converter = EnergyConverter()
You can get a list of all available energy units:
units = converter.get_units()
# Returns a list of dictionaries with 'abbreviation' and 'name' of a unit
To convert from one energy unit to another, use the convert() method:
result = converter.convert(1000, 'J', 'kWh')
# Converts 1000 Joules to Kilowatt Hours
Error Handling
The ConversionError exception will be raised if there are any issues during the conversion process, such as unknown units or invalid values.
## Contributing Contributions to PyEnergyX are very welcome! Feel free to fork the repository and submit pull requests.
License
This project is open source, provided under the MIT License. Feel free to use, modify, and distribute PyEnergyX as you see fit.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyenergyx-0.2.tar.gz.
File metadata
- Download URL: pyenergyx-0.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a03d5d5ba46508e9f3f605073950a3e39af89fadd92ae036978f6c7208c6bc7c
|
|
| MD5 |
bddf1adae1244fd43a45fda00062156f
|
|
| BLAKE2b-256 |
375f6abe04adb8006cdc73443c6e5150c6489441f4ab6f0e1e2a0f5772a5104c
|
File details
Details for the file pyenergyx-0.2-py3-none-any.whl.
File metadata
- Download URL: pyenergyx-0.2-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acd9e59e4d1442ec5c8877ad21dab1cc25b30b8bb2e26edb29f9df7d3e33356e
|
|
| MD5 |
18bfeba94fc1163ce9ecd15fc5c115ef
|
|
| BLAKE2b-256 |
5fa8ad2af8919d9037c22b3883994e1acf7c1e2625e2839efd29a421164b8266
|