GHGPy

An open source greenhouse gas accounting tool that complies with IPCC 2006 and the GHG Protocol.
https://github.com/iclimate/ghgpy

Category: Emissions
Sub Category: Carbon Intensity and Accounting

Keywords

carbon-dioxide carbon-emissions ghg-data ghg-emissions python3 sustainability

Last synced: 17 minutes ago
JSON representation

Repository metadata

Python library for GHG Inventory

https://github.com/iClimate/ghgpy/blob/main/

          # GHGPy (Green House Gas Python)

---
![Python](https://img.shields.io/pypi/pyversions/ghgpy)
![PyPI](https://img.shields.io/pypi/v/ghgpy)
![license](https://img.shields.io/github/license/iClimate/ghgpy)


# GHGPy A Python package for GHG (Greenhouse Gas) Inventory calculations based on IPCC 2006 Guidelines with 2019 Refinements. **Carbon inventory, make it easy!** [![PyPI version](https://badge.fury.io/py/ghgpy.svg)](https://badge.fury.io/py/ghgpy) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/) ## Installation ```bash pip install ghgpy ``` For development: ```bash pip install ghgpy[dev] ``` [pypi: ghgpy](https://pypi.org/project/ghgpy/) ## Requirements / Dependencies Python 3.11 and up ## Quick Start ```python from ghgpy import __version__ from ghgpy.data import fuels_database # Load the emission factors database db = fuels_database(db='xlsx') # Display available data print(f"GHGPy v{__version__}") print(f"Number of emission factors: {len(db.data)}") print(db.data.head()) ``` ## Features - **IPCC 2006 Guidelines**: Emission factors from IPCC 2006 with 2019 Refinements - **Multiple Sectors**: Support for Energy, IPPU, AFOLU, and Waste sectors - **Flexible Database**: Excel-based database with SQLite/MySQL support - **Unit Converters**: Built-in energy, weight, and volume conversions - **Factory Pattern**: Easy-to-use factory classes for GHG calculations - **Uncertainty Support**: Built-in uncertainty data types ## Links - **Website:** https://iclimate.io.vn - **Our services** https://decarbdirect.com/ - **Documentation:** https://ghgpy.iclimate.io.vn - **Source code:** https://github.com/iClimate/ghgpy - **Contributing:** https://ghgpy.iclimate.io.vn/devdocs/ - **Bug reports:** https://github.com/iClimate/ghgpy/issues --- ## Call for Contributions The GHGPy project welcomes your expertise and enthusiasm! We're looking for contributors to help with: - Adding emission factors for additional regions - Implementing new calculation methodologies - Improving documentation - Writing tests ## Basic Usage ### Import library ```python # General factory from src.ghgpy.factory import FactoryGeneral # Uncertainty data type from src.ghgpy.datamodel.fuel import UNumber # Database handles from src.ghgpy.datamodel.db import FuelDataHandle, GHGDataHandle, EFDataHandle # Default databases from src.ghgpy.data.fuels import default_fuel_database from src.ghgpy.data.ghg import ghg_gas_data from src.ghgpy.data.efs import s_combustion_energy ``` ### Create a factory ```python # Init the factory class MyFactory = FactoryGeneral(name="Hong Ha Textile", desc = "Textile production for export!") ``` ### Connect to the database ```python MyFactory.connection(FuelDataHandle(default_fuel_database),\ EFDataHandle(s_combustion_energy),\ GHGDataHandle(ghg_gas_data, 'ar6')) ``` ### Add a combussion process in factory ```python MyFactory.add_combustion(name = "Boiler", desc = "Đốt lò hơi") ``` ### Add another combussion process in factory ```python MyFactory.add_combustion(name = "Boiler1", desc = "Đốt lò than bùn") ``` ### Add fuels use in these combussion ```python MyFactory.combustion["Boiler"].add('Diesel_Oil', UNumber(value=1000), 'l') MyFactory.combustion["Boiler"].add('Anthracite', UNumber(value=1000), 'kg') MyFactory.combustion["Boiler1"].add('Lignite', UNumber(value=1000), 'kg') ``` ### Add refrigerant use in factory ```python MyFactory.add_refrigerantuse(name='AC', desc='refrigerant use for AC') ``` ### Add amount of specific type of refrigerant ```python MyFactory.refrigerantuse["AC"].add("R32", UNumber(value=10, uncertainty=0), 'kg') ``` ### Electriciy use in factory ```python MyFactory.add_elecuse(name='Office') ``` ### Electriciy consumption ```python MyFactory.elecuse['Office'].add(name='01', amount=UNumber(value=1), unit='MWh', gef=UNumber(value=0.987), force=True) ``` ### Calculate emission ```python MyFactory.emission(scope=1) ``` ## License MIT License - see [LICENSE](LICENSE) for details.

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 15 days ago

Total Commits: 22
Total Committers: 2
Avg Commits per committer: 11.0
Development Distribution Score (DDS): 0.045

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
bkt92 b****2@y****n 21
Doantruong2212 1****2 1

Committer domains:


Issue and Pull Request metadata

Last synced: 5 months ago

Total issues: 0
Total pull requests: 1
Average time to close issues: N/A
Average time to close pull requests: 5 minutes
Total issue authors: 0
Total pull request authors: 1
Average comments per issue: 0
Average comments per pull request: 0.0
Merged pull request: 1
Bot issues: 0
Bot pull requests: 0

Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/iclimate/ghgpy

Top Issue Authors

Top Pull Request Authors

  • bkt92 (2)

Top Issue Labels

Top Pull Request Labels

Score: 2.3025850929940455