A Python package for GHG (Greenhouse Gas) Inventory calculations based on IPCC 2006 Guidelines with 2019 Refinements.
Carbon inventory, make it easy!
pip install ghgpyFor development:
pip install ghgpy[dev]Python 3.11 and up
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())- 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
- 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
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
# 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 # Init the factory class
MyFactory = FactoryGeneral(name="Hong Ha Textile", desc = "Textile production for export!") MyFactory.connection(FuelDataHandle(default_fuel_database),\
EFDataHandle(s_combustion_energy),\
GHGDataHandle(ghg_gas_data, 'ar6')) MyFactory.add_combustion(name = "Boiler", desc = "Đốt lò hơi") MyFactory.add_combustion(name = "Boiler1", desc = "Đốt lò than bùn") 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') MyFactory.add_refrigerantuse(name='AC', desc='refrigerant use for AC') MyFactory.refrigerantuse["AC"].add("R32", UNumber(value=10, uncertainty=0), 'kg') MyFactory.add_elecuse(name='Office') MyFactory.elecuse['Office'].add(name='01', amount=UNumber(value=1), unit='MWh', gef=UNumber(value=0.987), force=True) MyFactory.emission(scope=1)MIT License - see LICENSE for details.
