bw2io.extractors.json_ld#
Attributes#
Classes#
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.