Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #31 from ocni-dtu/chrk/convert_lcabyg
Browse files Browse the repository at this point in the history
Chrk/convert lcabyg
  • Loading branch information
ocni-dtu authored Mar 24, 2024
2 parents 8eec0c0 + 4334de6 commit 0c479a5
Show file tree
Hide file tree
Showing 15 changed files with 675 additions and 107 deletions.
4 changes: 2 additions & 2 deletions docs/code/python/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
print(json.dumps(epd_dict, indent=2))

print("\nEPD as Pydantic model")
epd_pydantic = epdx.convert_ilcd(ilcd_file.read_text(), as_type="pydantic")
epd_pydantic = epdx.convert_ilcd(ilcd_file.read_text(), as_type=epdx.EPD)
print(epd_pydantic)

print("\nEPD as string")
epd_str = epdx.convert_ilcd(ilcd_file.read_text(), as_type="str")
epd_str = epdx.convert_ilcd(ilcd_file.read_text(), as_type=str)
print(epd_str)
2 changes: 1 addition & 1 deletion packages/python/src/epdx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def convert_ilcd(data: str | dict, *, as_type: Type[T] = dict) -> T:
elif as_type == EPD:
return EPD(**json.loads(_epd))
else:
raise NotImplemented("Currently only 'dict', 'str' and 'pydantic' is implemented as_type.")
raise NotImplementedError("Currently only 'dict', 'str' and 'epdx.EPD' is implemented as_type.")


class ParsingException(Exception):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "epdx"
description = "EPDx is a library for parsing EPD files into a common exchange format."
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.10"
license = { file = "LICENSE" }
authors = [
{ name = "Christian Kongsgaard", email = "[email protected]" },
Expand Down
Loading

0 comments on commit 0c479a5

Please sign in to comment.