REGISTER NOW: DdS Autumn School! 🇨🇭 Grosshöchstetten (Switzerland) 🗓️ 6.-11. October 2024

bw2io.extractors.exiobase#

Module Contents#

Classes#

Exiobase3MonetaryDataExtractor

Functions#

remove_numerics(string)

Remove numeric values enclosed in parentheses from a given string, e.g. 'Tobacco products (16)' into 'Tobacco products'.

class bw2io.extractors.exiobase.Exiobase3MonetaryDataExtractor[source]#

Bases: object

classmethod _get_path(dirpath)[source]#

Get the directory path of the EXIOBASE data file.

Parameters#

dirpathstr

The path of the EXIOBASE data file or directory.

Returns#

Path

The directory path of the EXIOBASE data file.

classmethod _get_production_volumes(dirpath)[source]#

Extract production volumes from the EXIOBASE data file.

Parameters#

dirpathstr

The path of the EXIOBASE data file or directory.

Returns#

dict

A dictionary for the production volume.

classmethod _get_unit_data(dirpath)[source]#

Extract unit data from the EXIOBASE data file.

Parameters#

dirpathstr

The path to the EXIOBASE data file or directory.

Returns#

dict

A dctionary of unit data from the EXIOBase data file.

classmethod get_biosphere_iterator(dirpath, ignore_small_balancing_corrections=True)[source]#

Returns an iterator that yields tuples of flow names, locations, and amounts.

Parameters#

dirpathstr

The path to the directory.

ignore_small_balancing_correctionsbool, optional

Ignore small balancing corrections. By default True.

classmethod get_flows(dirpath)[source]#

Extract flows from an EXIOBASE data file.

Parameters#

dirpathstr

The path of the EXIOBASE data file or directory.

Returns#

dict

A dictionary of flows from the EXIOBASE data file.

classmethod get_products(dirpath)[source]#

Get product information from a given directory.

Parameters#

dirpathstr

The path to the directory with the product information.

Returns#

list

A list of dictionaries with the following keys: - ‘name’: str The product name. - ‘location’: str The product location. - ‘unit’: str The product’s unit of measure. - ‘production volume’: float The total production volume for the product.

classmethod get_technosphere_iterator(dirpath, num_products, ignore_small_balancing_corrections=True)[source]#

Get an iterator in a given directory.

Parameters#

dirpathstr

The path to the directory with the data.

num_productsint

The number of products.

ignore_small_balancing_correctionsbool, optional

Ignore small balancing corrections. By default True.

bw2io.extractors.exiobase.remove_numerics(string)[source]#

Remove numeric values enclosed in parentheses from a given string, e.g. ‘Tobacco products (16)’ into ‘Tobacco products’.

Parameters#

stringstr

The string to be processed

Returns#

str

The processed string without numeric values enclosed in parentheses.