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.
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)[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.