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

bw2io.extractors.json_ld#

Module Contents#

Classes#

JSONLDExtractor

Extract JSON-LD from a directory.

Attributes#

DIRECTORIES_TO_IGNORE

FILES_TO_IGNORE

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

Bases: object

Extract JSON-LD from a directory.

Attributes#

FILES_TO_IGNORE: set

Files to ignore when extracting JSON-LD data.

DIRECTORIES_TO_IGNORE: set

Directories to ignore when extracting JSON-LD data.

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

Extracts JSON-LD data from the filepath.

Parameters#
filepathstr or Path

The path of the directory from which data will be extracted

add_filenamebool, optional

Add the name to the extracted data. By default, True.

Returns#
dict

A dictionary with the extracted JSON-LD data.

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]#