bw2io.extractors.json_ld
#
Module Contents#
Classes#
Extract JSON-LD from a directory. |
Attributes#
- 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)[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.