Open vjousse opened 4 days ago
@vjousse Can you provide more detail on what kind of json
file you want to import? json
is just a generic format, LCA/sustainability assessment can be expressed in many ways in json
.
Oops sorry, I’ve opened the issue on the wrong repo. I was talking about the JSON exported by https://github.com/brightway-lca/bw_simapro_csv
Sorry, I moved the issue, but can move it back if needed.
bw_simapro_csv
doesn't export JSON? Where do you see that?
There is a mention of it in the documentation here: https://github.com/brightway-lca/bw_simapro_csv?tab=readme-ov-file#exporting-to-brightway
Exporting to Brightway Process datasets can be exported to a format usable by bw2io with SimaProCSV.to_brightway(). This returns a Python dictionary, but you can also write this data to a file on disk by passing a pathlib.Path instance, i.e.:
from pathlib import Path
from bw_simapro_csv import SimaProCSV
sp = SimaProCSV(Path("my SimaPro file.csv"))
sp.to_brightway(Path("my-export.json"))
The code: https://github.com/brightway-lca/bw_simapro_csv/blob/main/bw_simapro_csv/main.py#L185
You don't need to export anything to JSON, just use SimaProBlockCSVImporter directly.
Oh thanks for the tip! Should I submit a documentation PR for it in the bw_simapro_csv
repo?
There is a mention in the documentation of https://github.com/brightway-lca/bw_simapro_csv that the
json
file can be imported into Brightway usingbw2io
but I haven't found a way to do it.Is there a documentation somewhere about it?
Thanks for the awesome work!