openepd 6.7.0__py3-none-any.whl → 6.8.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
openepd/__version__.py CHANGED
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- VERSION = "6.7.0"
16
+ VERSION = "6.8.0"
openepd/model/common.py CHANGED
@@ -149,10 +149,55 @@ class Location(BaseOpenEpdSchema):
149
149
  )
150
150
 
151
151
 
152
+ ATTACHMENT_KNOWN_KEYS: dict[str, str] = {
153
+ "OpenEPD": "A Product EPD in OpenEPD format",
154
+ "openEPD": "Equivalent to OpenEPD",
155
+ "ILCD_EPD": "A Product EPD in ILCD+EPD format. An underscore is used in place of '+' for compatability purposes.",
156
+ "OpenIndustryEPD": "An Industry EPD in OpenEPD format",
157
+ "openIndustryEPD": "Equivalent to OpenIndustryEPD",
158
+ "LCA_Model": "An underlying LCA model from which one could replicate these EPD results, in LCA Commons 2.0 format",
159
+ "LCA_Report": "An underlying LCA report, in PDF or other document format",
160
+ "lca_software": "A url, optionally with an #anchor tag, pointing to the version of the software used, generally one provided by the software vendor. ",
161
+ "lca_dataset_reference": "A URL link to an lca dataset used in the analysis. Multiple dataset references can be added by appending a number or string after _reference, e.g. lca_dataset_reference_3 or lca_dataset_reference_steel",
162
+ "EPD": "Environmental Product Declaration, verified by a third party, not in OpenEPD format.",
163
+ "IndustryEPD": "EPD for an industry, sector, or group of companies, not in OpenEPD format.",
164
+ "Datasheet": "A technical data sheet describing the product.",
165
+ "PCR": "Product Category Rules for EPD generation",
166
+ "Contact_Us": "A url to contact. May be an email (mailto:) link.",
167
+ "URL": "A link to a relevant resource. No particular format is specified. Each URL should be uniquely named. ",
168
+ "VOC": "Volatile Organic Compound declaration",
169
+ "HPD": "Material Health Product Declaration",
170
+ "PEF": "Product Environmental Footprint (without 3rd party verification)",
171
+ "MSDS": "Material Safety Data Sheet",
172
+ "Developer": "Link to the website of the group who performed the LCA and/or prepared the EPD.",
173
+ }
174
+
175
+
176
+ class AttachmentDict(dict[str, pyd.AnyUrl]):
177
+ """Special form of dict for attachments."""
178
+
179
+ @classmethod
180
+ def __modify_schema__(cls, field_schema: dict[str, Any], field: pyd.fields.ModelField | None):
181
+ # This may be generalized later to combine, for example, enum descriptions and field descriptions to provide
182
+ # a better result.
183
+ field_description = field.field_info.description if field else ""
184
+ if field_description:
185
+ field_description = field_description.strip()
186
+ if not field_description.endswith("."):
187
+ field_description += "."
188
+ field_description += " "
189
+
190
+ field_schema["description"] = field_description + "Extra properties of string -> URL allowed."
191
+ field_schema["properties"] = {
192
+ k: {"type": "string", "format": "uri", "description": v} for k, v in ATTACHMENT_KNOWN_KEYS.items()
193
+ }
194
+ field_schema["additionalProperties"] = True
195
+
196
+
152
197
  class WithAttachmentsMixin(pyd.BaseModel):
153
198
  """Mixin for objects that can have attachments."""
154
199
 
155
- attachments: dict[Annotated[str, pyd.Field(max_length=200)], pyd.AnyUrl] | None = pyd.Field(
200
+ attachments: AttachmentDict = pyd.Field(
156
201
  description="Dict of URLs relevant to this entry",
157
202
  example={
158
203
  "Contact Us": "https://www.c-change-labs.com/en/contact-us/",
openepd/model/epd.py CHANGED
@@ -15,7 +15,7 @@
15
15
  #
16
16
 
17
17
  from openepd.compat.pydantic import pyd
18
- from openepd.model.base import BaseDocumentFactory, BaseOpenEpdSchema, OpenEpdDoctypes
18
+ from openepd.model.base import BaseDocumentFactory, OpenEpdDoctypes, OpenEpdExtension
19
19
  from openepd.model.common import Ingredient, WithAltIdsMixin, WithAttachmentsMixin
20
20
  from openepd.model.declaration import (
21
21
  DEVELOPER_DESCRIPTION,
@@ -61,13 +61,18 @@ PLANT_DESCRIPTION = "List of object(s) for one or more plant(s) that this declar
61
61
  #
62
62
 
63
63
 
64
- class Ec3EpdExtension(BaseOpenEpdSchema):
64
+ class Ec3EpdExtension(OpenEpdExtension):
65
65
  """Extension for EC3 specific fields on openEPD."""
66
66
 
67
67
  # While the extensions should be stored under the 'ext' key - extension point of the BaseOpenepdModel - the EC3
68
68
  # extension was started before the introduction of extension management, and so is located at the root of the EPD
69
69
  # object.
70
70
 
71
+ @classmethod
72
+ def get_extension_name(cls) -> str:
73
+ """Return the name of the extension."""
74
+ return "ec3"
75
+
71
76
  uaGWP_a1a2a3_traci21: float | None = pyd.Field(
72
77
  default=None,
73
78
  description="""The A1A2A3 uncertainty-adjusted GWP, in kgCO2e per declared unit, calculated for the TRACI 2.1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openepd
3
- Version: 6.7.0
3
+ Version: 6.8.0
4
4
  Summary: Python library to work with OpenEPD format
5
5
  Home-page: https://github.com/cchangelabs/openepd
6
6
  License: Apache-2.0
@@ -1,5 +1,5 @@
1
1
  openepd/__init__.py,sha256=Shkfh0Kun0YRhmRDw7LkUj2eQL3X-HnP55u2THOEALw,794
2
- openepd/__version__.py,sha256=4gnODThekFJwXNHfdYsu7FCdS-28EDHtQ3CWAlc16Dc,638
2
+ openepd/__version__.py,sha256=9OPQvTofWeNtZsDOXlGpgiqoTls3frlEMPI9m1HFIX0,638
3
3
  openepd/api/__init__.py,sha256=UGmZGEyMnASrYwEBPHuXmVzHiuCUskUsJEPoHTIo-lg,620
4
4
  openepd/api/average_dataset/__init__.py,sha256=UGmZGEyMnASrYwEBPHuXmVzHiuCUskUsJEPoHTIo-lg,620
5
5
  openepd/api/average_dataset/generic_estimate_sync_api.py,sha256=mxWwDokEGMe87Px8C_aHvIdVKZVHrEAuVtaSA1zJchU,7953
@@ -35,9 +35,9 @@ openepd/compat/pydantic.py,sha256=DOjSixsylLqMtFAIARu50sGcT4VPXN_c473q_2JwZQ0,11
35
35
  openepd/model/__init__.py,sha256=UGmZGEyMnASrYwEBPHuXmVzHiuCUskUsJEPoHTIo-lg,620
36
36
  openepd/model/base.py,sha256=OEYNFUTL4BivBNAt_LGowTlDuUjvKMHgf5U5ZBncZwQ,9805
37
37
  openepd/model/category.py,sha256=IQXNGQFQmFZ_H9PRONloX_UOSf1sTMDq1rM1yz8JR0Y,1639
38
- openepd/model/common.py,sha256=4iZAdmQy5UvLKrtmO8OnXsH1HD8jl20c6cv8MUZKW-M,10356
38
+ openepd/model/common.py,sha256=rADzzNqrjQ8oixy4KL7kyiIIvWM2S7cUDuicen1Xs6Y,13062
39
39
  openepd/model/declaration.py,sha256=oBJ_v_ESoQhybQIH5S5tmYVkgkoX3gwe3nvFyPqb4uk,13832
40
- openepd/model/epd.py,sha256=I8pGcvvsVzbwyQYRrqGQa7tGyRw55T_sIQn1VJ9568g,12165
40
+ openepd/model/epd.py,sha256=Ldw_X-lo5abEXSAAxV9scjVku7NQWrsANxlIfRjkw_8,12290
41
41
  openepd/model/factory.py,sha256=XP7eeQNW5tqwX_4hfuEb3lK6BFQDb4KB0fSN0r8-lCU,2656
42
42
  openepd/model/generic_estimate.py,sha256=bbU0cR4izSqjZcfxUHNbdO4pllqqd8OaUFikrEgCFoA,3992
43
43
  openepd/model/geography.py,sha256=G3Oz3QBw5n-RiSCAv-vAGxrOZBhwIT5rASnPlo9dkcs,42095
@@ -136,7 +136,7 @@ openepd/model/validation/quantity.py,sha256=1z-G46dlryJEm4W-O0QiEJuFYICz7CPTM6gL
136
136
  openepd/model/versioning.py,sha256=R_zm6rCrgF3vlJQYbpyWhirdS_Oek16cv_mvZmpuE8I,4473
137
137
  openepd/patch_pydantic.py,sha256=xrkzblatmU9HBzukWkp1cPq9ZSuohoz1p0pQqVKSlKs,4122
138
138
  openepd/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
139
- openepd-6.7.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
140
- openepd-6.7.0.dist-info/METADATA,sha256=Iyf-1pV9bb1T9i2iY0oCm4Yaw1vvL39gaO9UEK21AKo,9038
141
- openepd-6.7.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
142
- openepd-6.7.0.dist-info/RECORD,,
139
+ openepd-6.8.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
140
+ openepd-6.8.0.dist-info/METADATA,sha256=aBd0besZvKgFZrQV-rASIVpDRYZVOlRa9li7fRUk684,9038
141
+ openepd-6.8.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
142
+ openepd-6.8.0.dist-info/RECORD,,