bw2io.extractors.json_ld#

Attributes#

Classes#

JSONLDExtractor

Extract JSON-LD from a directory.

Module Contents#

class bw2io.extractors.json_ld.JSONLDExtractor[source]#

Bases: object

Extract JSON-LD from a directory.

FILES_TO_IGNORE#

Files to ignore when extracting JSON-LD data.

Type:

set

DIRECTORIES_TO_IGNORE#

Directories to ignore when extracting JSON-LD data.

Type:

set

classmethod extract(filepath, add_filename=True, **kwargs)[source]#

Extracts JSON-LD data from the filepath.

Parameters:
  • filepath (str or Path) – The path of the directory from which data will be extracted

  • add_filename (bool, optional) – Add the name to the extracted data. By default, True.

Returns:

A dictionary with the extracted JSON-LD data.

Return type:

dict

Raises:
  • ValueError – If the file is not a zip archive.

  • NotImplementedError – If extraction of zip archives is not yet supported.

bw2io.extractors.json_ld.DIRECTORIES_TO_IGNORE[source]#
bw2io.extractors.json_ld.FILES_TO_IGNORE[source]#