resource_manager.database_manager

Description:

This module contains the DataManager class, a tool for managing and retrieving various datasets related to landcover_lca tool. The class is designed to interact with a SQL database using SQLAlchemy, providing methods to fetch land use features, land use emissions factors, IPCC soil class SOC factors, national forest inventory data, and exported peat data. It is optimized for ease of use and efficiency.

Note

This is part of a larger suite of tools developed for environmental data analysis and modeling.

Module Contents

Classes

DataManager

A class that manages the database operations for landcover LCA.

class resource_manager.database_manager.DataManager(ef_country)

A class that manages the database operations for landcover LCA.

database_dir

The directory path of the database.

Type:

str

engine

The SQLAlchemy engine for database connection.

Type:

sqlalchemy.engine.Engine

ef_country

The country for which the emissions factors are retrieved.

Type:

str

__init__(ef_country)

Initializes the DataManager object.

data_engine_creater()

Creates and returns the SQLAlchemy engine for database connection.

get_landuse_features()

Retrieves the land use features from the database.

get_landuse_emissions_factors()

Retrieves the land use emissions factors from the database.

get_ipcc_soc_factors()

Retrieves the IPCC soil class SOC factors from the database.

get_national_forest_inventory()

Retrieves the national forest inventory data from the database.

get_exported_peat()

Retrieves the exported peat data from the database.

get_slam_export_data()

Retrieves the SLAM export data from the database.

data_engine_creater()

Creates and returns the SQLAlchemy engine for database connection.

Returns:

The SQLAlchemy engine for database connection.

Return type:

sqlalchemy.engine.Engine

get_landuse_features()

Retrieves the land use features from the database.

Returns:

The land use features data.

Return type:

pandas.DataFrame

get_landuse_emissions_factors()

Retrieves the land use emissions factors from the database.

Returns:

The land use emissions factors data.

Return type:

pandas.DataFrame

get_ipcc_soc_factors()

Retrieves the IPCC soil class SOC factors from the database.

Returns:

The IPCC soil class SOC factors data.

Return type:

pandas.DataFrame

get_national_forest_inventory()

Retrieves the national forest inventory data from the database.

Returns:

The national forest inventory data.

Return type:

pandas.DataFrame

get_exported_peat()

Retrieves the exported peat data from the database.

Returns:

The exported peat data.

Return type:

pandas.DataFrame

get_slam_export_data()

Retrieves the SLAM export data from the database.

Returns:

The SLAM export data.

Return type:

pandas.DataFrame