bw2io.extractors.exiobase#

Classes#

Functions#

remove_numerics(string)

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

Module Contents#

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

Bases: object

classmethod _get_path(dirpath)[source]#

Get the directory path of the EXIOBASE data file.

Parameters:

dirpath (str) – The path of the EXIOBASE data file or directory.

Returns:

The directory path of the EXIOBASE data file.

Return type:

Path

classmethod _get_production_volumes(dirpath)[source]#

Extract production volumes from the EXIOBASE data file.

Parameters:

dirpath (str) – The path of the EXIOBASE data file or directory.

Returns:

A dictionary for the production volume.

Return type:

dict

classmethod _get_unit_data(dirpath)[source]#

Extract unit data from the EXIOBASE data file.

Parameters:

dirpath (str) – The path to the EXIOBASE data file or directory.

Returns:

A dctionary of unit data from the EXIOBase data file.

Return type:

dict

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

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

Parameters:
  • dirpath (str) – The path to the directory.

  • ignore_small_balancing_corrections (bool, optional) – Ignore small balancing corrections. By default True.

classmethod get_flows(dirpath)[source]#

Extract flows from an EXIOBASE data file.

Parameters:

dirpath (str) – The path of the EXIOBASE data file or directory.

Returns:

A dictionary of flows from the EXIOBASE data file.

Return type:

dict

classmethod get_products(dirpath)[source]#

Get product information from a given directory.

Parameters:

dirpath (str) – The path to the directory with the product information.

Returns:

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.

Return type:

list

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

Get an iterator in a given directory.

Parameters:
  • dirpath (str) – The path to the directory with the data.

  • num_products (int) – The number of products.

  • ignore_small_balancing_corrections (bool, 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:

string (str) – The string to be processed

Returns:

The processed string without numeric values enclosed in parentheses.

Return type:

str