Skip to main content

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.

Release files for pyenergyx 0.2

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

Source distribution (sdist)

Source distribution for pyenergyx 0.2
File Size Uploaded
pyenergyx-0.2.tar.gz 4.0 kB Details

Built distribution (wheel)

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

Total release size: 8.5 kB

Release files / pyenergyx-0.2.tar.gz

Download URL pyenergyx-0.2.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a03d5d5ba46508e9f3f605073950a3e39af89fadd92ae036978f6c7208c6bc7c
BLAKE2b-256 checksum
How to use checksums
375f6abe04adb8006cdc73443c6e5150c6489441f4ab6f0e1e2a0f5772a5104c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.5

Release files / pyenergyx-0.2-py3-none-any.whl

Download URL pyenergyx-0.2-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
acd9e59e4d1442ec5c8877ad21dab1cc25b30b8bb2e26edb29f9df7d3e33356e
BLAKE2b-256 checksum
How to use checksums
5fa8ad2af8919d9037c22b3883994e1acf7c1e2625e2839efd29a421164b8266
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

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