Skip to content

Product Footprint

This part of the project documentation focuses on an information-oriented approach. Use it as a reference for the technical implementation of the pact_methodology project code.

ProductFootprint

Represents the carbon footprint of a product under a specific scope and with values calculated in accordance with the Pathfinder Framework.

Attributes:

Name Type Description
id ProductFootprintId

The unique identifier for this ProductFootprint.

spec_version str

The version of the ProductFootprint data specification.

version Version

The version of the ProductFootprint.

created DateTime

The date and time when the ProductFootprint was created.

updated DateTime | None

The date and time when the ProductFootprint was last updated.

status ProductFootprintStatus

The status of the ProductFootprint.

status_comment str | None

A comment describing the status of the ProductFootprint.

validity_period ValidityPeriod | None

The validity period for the ProductFootprint.

company_name str

The name of the company that owns the ProductFootprint.

company_ids list[CompanyId]

A list of CompanyIds for the company that owns the ProductFootprint.

product_description str

A description of the product.

product_ids list[ProductId]

A list of ProductIds for the product.

product_category_cpc CPC

The category of the product according to the CPC (Central Product Classification) system.

product_name_company str

The name of the product as used by the company.

comment str

A comment about the ProductFootprint.

extensions list[DataModelExtension] | None

A list of DataModelExtension objects.

pcf CarbonFootprint

The carbon footprint of the given product with value conforming to the data type CarbonFootprint.

preceding_pf_ids list[ProductFootprintId] | None

A list of preceding ProductFootprintIds.

Examples:

>>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
>>> product_footprint = ProductFootprint(
...     version=Version(),
...     created=DateTime(),
...     status=ProductFootprintStatus(),
...     company_name="Example Company",
...     company_ids=[CompanyId()],
...     product_description="Example Product",
...     product_ids=[ProductId()],
...     product_category_cpc=CPC(),
...     product_name_company="Example Product Name",
...     comment="Example comment",
...     pcf=pcf
... )
>>> print(product_footprint)
ProductFootprint(id=<ProductFootprintId>, spec_version=2.2.0, version=<Version>, ...)
Source code in pact_methodology/product_footprint/product_footprint.py
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
class ProductFootprint:
    """
    Represents the carbon footprint of a product under a specific scope and with values calculated in accordance
    with the Pathfinder Framework.

    Attributes:
        id (ProductFootprintId): The unique identifier for this ProductFootprint.
        spec_version (str): The version of the ProductFootprint data specification.
        version (Version): The version of the ProductFootprint.
        created (DateTime): The date and time when the ProductFootprint was created.
        updated (DateTime | None): The date and time when the ProductFootprint was last updated.
        status (ProductFootprintStatus): The status of the ProductFootprint.
        status_comment (str | None): A comment describing the status of the ProductFootprint.
        validity_period (ValidityPeriod | None): The validity period for the ProductFootprint.
        company_name (str): The name of the company that owns the ProductFootprint.
        company_ids (list[CompanyId]): A list of CompanyIds for the company that owns the ProductFootprint.
        product_description (str): A description of the product.
        product_ids (list[ProductId]): A list of ProductIds for the product.
        product_category_cpc (CPC): The category of the product according to the CPC (Central Product Classification) system.
        product_name_company (str): The name of the product as used by the company.
        comment (str): A comment about the ProductFootprint.
        extensions (list[DataModelExtension] | None): A list of DataModelExtension objects.
        pcf (CarbonFootprint): The carbon footprint of the given product with value conforming to the data type CarbonFootprint.
        preceding_pf_ids (list[ProductFootprintId] | None): A list of preceding ProductFootprintIds.

    Examples:
        >>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
        >>> product_footprint = ProductFootprint(
        ...     version=Version(),
        ...     created=DateTime(),
        ...     status=ProductFootprintStatus(),
        ...     company_name="Example Company",
        ...     company_ids=[CompanyId()],
        ...     product_description="Example Product",
        ...     product_ids=[ProductId()],
        ...     product_category_cpc=CPC(),
        ...     product_name_company="Example Product Name",
        ...     comment="Example comment",
        ...     pcf=pcf
        ... )
        >>> print(product_footprint)
        ProductFootprint(id=<ProductFootprintId>, spec_version=2.2.0, version=<Version>, ...)
    """

    def __init__(
        self,
        *,
        id: ProductFootprintId | None = None,
        spec_version: str = "2.2.0",
        version: Version,
        created: DateTime,
        updated: DateTime | None = None,
        status_info: ProductFootprintStatus,
        validity_period: ValidityPeriod | None = None,
        company_name: str,
        company_ids: list[CompanyId],
        product_description: str,
        product_ids: list[ProductId],
        product_category_cpc: CPC,
        product_name_company: str,
        comment: str,
        extensions: list[DataModelExtension] | None = None,
        pcf: CarbonFootprint,
        preceding_pf_ids: list[ProductFootprintId] | None = None,
    ):
        """
        Initializes a new ProductFootprint instance.

        Args:
            id (ProductFootprintId | None): The ProductFootprintId for this instance. If not provided, a new one will be generated.
            spec_version (str): The version of the ProductFootprint data specification. Currently, hardcoded to "2.2.0", but may be updated in the future to support different versions.
            version (Version): The version of the ProductFootprint.
            created (DateTime): The date and time when the ProductFootprint was created.
            updated (DateTime | None): The date and time when the ProductFootprint was last updated.
            status (ProductFootprintStatus): The status of the ProductFootprint.
            status_comment (str | None): A comment describing the status of the ProductFootprint.
            validity_period (ValidityPeriod | None): The validity period for the ProductFootprint.
            company_name (str): The name of the company that owns the ProductFootprint.
            company_ids (list[CompanyId]): A list of CompanyIds for the company that owns the ProductFootprint.
            product_description (str): A description of the product.
            product_ids (list[ProductId]): A list of ProductIds for the product.
            product_category_cpc (CPC): The category of the product according to the CPC (Central Product Classification) system.
            product_name_company (str): The name of the product as used by the company.
            comment (str): A comment about the ProductFootprint.
            extensions (list[DataModelExtension] | None): A list of DataModelExtension objects.
            pcf (CarbonFootprint): The carbon footprint of the given product with value conforming to the data type CarbonFootprint.
            preceding_pf_ids (list[ProductFootprintId] | None): A list of preceding ProductFootprintIds.

        Examples:
            >>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
            >>> product_footprint = ProductFootprint(
            ...     version=Version(),
            ...     created=DateTime(),
            ...     status=ProductFootprintStatus(),
            ...     company_name="Example Company",
            ...     company_ids=[CompanyId()],
            ...     product_description="Example Product",
            ...     product_ids=[ProductId()],
            ...     product_category_cpc=CPC(),
            ...     product_name_company="Example Product Name",
            ...     comment="Example comment",
            ...     pcf=pcf
            ... )
            >>> print(product_footprint)
            ProductFootprint(id=<ProductFootprintId>, spec_version=2.2.0, version=<Version>, ...)
        """
        self.id = id if id else ProductFootprintId()
        self.spec_version = spec_version
        self.version = version
        self.created = created
        self.updated = updated
        self.status_info = status_info
        self.company_name = company_name
        self.company_ids = company_ids
        self.product_description = product_description
        self.product_ids = product_ids
        self.product_category_cpc = product_category_cpc
        self.product_name_company = product_name_company
        self.comment = comment
        self.extensions = extensions
        self.pcf = pcf
        self.preceding_pf_ids = preceding_pf_ids
        self.validity_period = validity_period if validity_period else ValidityPeriod(reference_period_end=self.pcf.reference_period.end)

    @property
    def id(self):
        """Gets the unique identifier for this ProductFootprint."""
        return self._id

    @id.setter
    def id(self, value):
        """Sets the unique identifier for this ProductFootprint.

        Args:
            value (ProductFootprintId | None): The identifier to set.

        Raises:
            ValueError: If value is not an instance of ProductFootprintId or None.
        """
        if not isinstance(value, (ProductFootprintId, type(None))):
            raise ValueError("id must be an instance of ProductFootprintId or None")
        self._id = value

    @property
    def spec_version(self):
        """Gets the version of the ProductFootprint data specification."""
        return self._spec_version

    @spec_version.setter
    def spec_version(self, value):
        """Sets the version of the ProductFootprint data specification.

        Args:
            value (str): The specification version to set.

        Raises:
            ValueError: If value is not "2.2.0".
        """
        if value != "2.2.0":
            raise ValueError("Invalid spec version")
        self._spec_version = value

    @property
    def version(self):
        """Gets the version of the ProductFootprint."""
        return self._version

    @version.setter
    def version(self, value):
        """Sets the version of the ProductFootprint.

        Args:
            value (Version): The version to set.

        Raises:
            ValueError: If value is not an instance of Version.
        """
        if not isinstance(value, Version):
            raise ValueError("version must be an instance of Version")
        self._version = value

    @property
    def created(self):
        """Gets the date and time when the ProductFootprint was created."""
        return self._created

    @created.setter
    def created(self, value):
        """Sets the date and time when the ProductFootprint was created.

        Args:
            value (DateTime): The creation date/time to set.

        Raises:
            ValueError: If value is not an instance of DateTime.
        """
        if not isinstance(value, DateTime):
            raise ValueError("created must be an instance of DateTime")
        self._created = value

    @property
    def updated(self):
        """Gets the date and time when the ProductFootprint was last updated."""
        return self._updated

    @updated.setter
    def updated(self, value):
        """Sets the date and time when the ProductFootprint was last updated.

        Args:
            value (DateTime | None): The update date/time to set.

        Raises:
            ValueError: If value is not an instance of DateTime or None.
        """
        if value is not None and not isinstance(value, DateTime):
            raise ValueError("updated must be an instance of DateTime or None")
        self._updated = value

    @property
    def status(self):
        """Gets the status of the ProductFootprint."""
        return self._status_info.status

    @status.setter
    def status(self, value):
        """Sets the status of the ProductFootprint.

        Args:
            value (Status): The status to set.

        Raises:
            ValueError: If value is not an instance of Status.
        """
        self._status_info.status = value

    @property
    def status_comment(self):
        """Gets the comment describing the status of the ProductFootprint."""
        return self._status_info.comment

    @status_comment.setter
    def status_comment(self, value):
        """Sets the comment describing the status of the ProductFootprint.

        Args:
            value (str | None): The status comment to set.

        Raises:
            ValueError: If value is not a string or None.
        """
        self._status_info.comment = value

    @property
    def status_info(self):
        """Gets the status information of the ProductFootprint."""
        return self._status_info

    @status_info.setter
    def status_info(self, value):
        """Sets the status information of the ProductFootprint.

        Args:
            value (ProductFootprintStatus): The status information to set.

        Raises:
            ValueError: If value is not an instance of ProductFootprintStatus.
        """
        if not isinstance(value, ProductFootprintStatus):
            raise ValueError("status_info must be an instance of ProductFootprintStatus")
        self._status_info = value

    @property
    def validity_period(self):
        """Gets the validity period for the ProductFootprint."""
        return self._validity_period

    @validity_period.setter
    def validity_period(self, value):
        """Sets the validity period for the ProductFootprint.

        Args:
            value (ValidityPeriod | None): The validity period to set.

        Raises:
            ValueError: If value is not an instance of ValidityPeriod or None.
        """
        if value is not None and not isinstance(value, ValidityPeriod):
            raise ValueError("validity_period must be an instance of ValidityPeriod or None")
        self._validity_period = value

    @property
    def company_name(self):
        """Gets the name of the company that owns the ProductFootprint."""
        return self._company_name

    @company_name.setter
    def company_name(self, value):
        """Sets the name of the company that owns the ProductFootprint.

        Args:
            value (str): The company name to set.

        Raises:
            ValueError: If value is not a non-empty string.
        """
        if not isinstance(value, str) or not value:
            raise ValueError("company_name must be a non-empty string")
        self._company_name = value

    @property
    def company_ids(self):
        """Gets the list of CompanyIds for the company that owns the ProductFootprint."""
        return self._company_ids

    @company_ids.setter
    def company_ids(self, value):
        """Sets the list of CompanyIds for the company that owns the ProductFootprint.

        Args:
            value (list[CompanyId]): The list of company IDs to set.

        Raises:
            ValueError: If value is not a list of CompanyId instances.
        """
        if not isinstance(value, list) or not all(isinstance(company_id, CompanyId) for company_id in value):
            raise ValueError("company_ids must be a list of CompanyId")
        self._company_ids = value

    @property
    def product_description(self):
        """Gets the description of the product."""
        return self._product_description

    @product_description.setter
    def product_description(self, value):
        """Sets the description of the product.

        Args:
            value (str): The product description to set.

        Raises:
            ValueError: If value is not a non-empty string.
        """
        if not isinstance(value, str) or not value:
            raise ValueError("product_description must be a non-empty string")
        self._product_description = value

    @property
    def product_ids(self):
        """Gets the list of ProductIds for the product."""
        return self._product_ids

    @product_ids.setter
    def product_ids(self, value):
        """Sets the list of ProductIds for the product.

        Args:
            value (list[ProductId]): The list of product IDs to set.

        Raises:
            ValueError: If value is not a list of ProductId instances.
        """
        if not isinstance(value, list) or not all(isinstance(product_id, ProductId) for product_id in value):
            raise ValueError("product_ids must be a list of ProductId")
        self._product_ids = value

    @property
    def product_category_cpc(self):
        """Gets the category of the product according to the CPC (Central Product Classification) system."""
        return self._product_category_cpc

    @product_category_cpc.setter
    def product_category_cpc(self, value):
        """Sets the category of the product according to the CPC system.

        Args:
            value (CPC): The CPC category to set.

        Raises:
            ValueError: If value is not an instance of CPC.
        """
        if not isinstance(value, CPC):
            raise ValueError("product_category_cpc must be an instance of CPC")
        self._product_category_cpc = value

    @property
    def product_name_company(self):
        """Gets the name of the product as used by the company."""
        return self._product_name_company

    @product_name_company.setter
    def product_name_company(self, value):
        """Sets the name of the product as used by the company.

        Args:
            value (str): The product name to set.

        Raises:
            ValueError: If value is not a non-empty string.
        """
        if not isinstance(value, str) or not value:
            raise ValueError("product_name_company must be a non-empty string")
        self._product_name_company = value

    @property
    def comment(self):
        """Gets the comment about the ProductFootprint."""
        return self._comment

    @comment.setter
    def comment(self, value):
        """Sets the comment about the ProductFootprint.

        Args:
            value (str): The comment to set.

        Raises:
            ValueError: If value is not a string.
        """
        if not isinstance(value, str):
            raise ValueError("comment must be a string")
        self._comment = value

    @property
    def extensions(self):
        """Gets the list of DataModelExtension objects."""
        return self._extensions

    @extensions.setter
    def extensions(self, value):
        """Sets the list of DataModelExtension objects.

        Args:
            value (list[DataModelExtension] | None): The list of extensions to set.

        Raises:
            ValueError: If value is not None and not a list of DataModelExtension instances.
        """
        if value is not None and (not isinstance(value, list) or not all(isinstance(ext, DataModelExtension) for ext in value)):
            raise ValueError("extensions must be a list of DataModelExtension objects or None")
        self._extensions = value

    @property
    def pcf(self):
        """Gets the carbon footprint of the given product with value conforming to the data type CarbonFootprint."""
        return self._pcf

    @pcf.setter
    def pcf(self, value):
        """Sets the carbon footprint of the given product.

        Args:
            value (CarbonFootprint): The carbon footprint to set.

        Raises:
            ValueError: If value is not an instance of CarbonFootprint.
        """
        if not isinstance(value, CarbonFootprint):
            raise ValueError("pcf must be an instance of CarbonFootprint")
        self._pcf = value

    @property
    def preceding_pf_ids(self):
        """Gets the list of preceding ProductFootprintIds."""
        return self._preceding_pf_ids

    @preceding_pf_ids.setter
    def preceding_pf_ids(self, value):
        """Sets the list of preceding ProductFootprintIds.

        Args:
            value (list[ProductFootprintId] | None): The list of preceding product footprint IDs to set.

        Raises:
            ValueError: If value is not None and not a list of unique ProductFootprintId instances.
        """
        if value is not None:
            if not isinstance(value, list) or not all(isinstance(pf_id, ProductFootprintId) for pf_id in value):
                raise ValueError("preceding_pf_ids must be a list of ProductFootprintId or None")
            if len(value) != len(set(value)):
                raise ValueError("preceding_pf_ids must not contain duplicates")
        self._preceding_pf_ids = value

    def __str__(self):
        """
        Returns a string representation of the ProductFootprint instance.

        Examples:
            >>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
            >>> product_footprint = ProductFootprint(
            ...     version=Version(),
            ...     created=DateTime(),
            ...     status=ProductFootprintStatus(),
            ...     company_name="Example Company",
            ...     company_ids=[CompanyId()],
            ...     product_description="Example Product",
            ...     product_ids=[ProductId()],
            ...     product_category_cpc=CPC(),
            ...     product_name_company="Example Product Name",
            ...     comment="Example comment",
            ...     pcf=pcf
            ... )
            >>> print(product_footprint)
            ProductFootprint(id=<ProductFootprintId>, spec_version=2.2.0, version=<Version>, ...)
        """
        return (
            f"ProductFootprint(id={self.id}, spec_version={self.spec_version}, version={self.version}, "
            f"created={self.created}, updated={self.updated}, status={self.status}, status_comment='{self.status_comment}', "
            f"validity_period={self.validity_period}, company_name='{self.company_name}', company_ids={self.company_ids}, "
            f"product_description='{self.product_description}', product_ids={self.product_ids}, "
            f"product_category_cpc={self.product_category_cpc}, product_name_company='{self.product_name_company}', "
            f"comment='{self.comment}', extensions={self.extensions}, pcf={self.pcf}, preceding_pf_ids={self.preceding_pf_ids})"
        )

    def __repr__(self):
        """
        Returns a detailed string representation of the ProductFootprint instance for debugging.

        Examples:
            >>> pcf = CarbonFootprint(
            >>> product_footprint = ProductFootprint(
            ...     version=Version(),
            ...     created=DateTime(),
            ...     status=ProductFootprintStatus(),
            ...     company_name="Example Company",
            ...     company_ids=[CompanyId()],
            ...     product_description="Example Product",
            ...     product_ids=[ProductId()],
            ...     product_category_cpc=CPC(),
            ...     product_name_company="Example Product Name",
            ...     comment="Example comment",
            ...     pcf=pcf
            ... )
            >>> repr(product_footprint)
            ProductFootprint(id=<ProductFootprintId>, spec_version='2.2.0', version=<Version>, ...)
        """
        return (
            f"ProductFootprint(id={self.id!r}, spec_version={self.spec_version!r}, version={self.version!r}, "
            f"created={self.created!r}, updated={self.updated!r}, status={self.status!r}, status_comment={self.status_comment!r}, "
            f"validity_period={self.validity_period!r}, company_name={self.company_name!r}, company_ids={self.company_ids!r}, "
            f"product_description={self.product_description!r}, product_ids={self.product_ids!r}, "
            f"product_category_cpc={self.product_category_cpc!r}, product_name_company={self.product_name_company!r}, "
            f"comment={self.comment!r}, extensions={self.extensions!r}, pcf={self.pcf!r}, preceding_pf_ids={self.preceding_pf_ids!r})"
        )

    def __eq__(self, other):
        """
        Compares two ProductFootprint instances for equality.

        Examples:
            >>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
            >>> product_footprint1 = ProductFootprint(
            ...     version=Version(),
            ...     created=DateTime(),
            ...     status=ProductFootprintStatus(),
            ...     company_name="Example Company",
            ...     company_ids=[CompanyId()],
            ...     product_description="Example Product",
            ...     product_ids=[ProductId()],
            ...     product_category_cpc=CPC(),
            ...     product_name_company="Example Product Name",
            ...     comment="Example comment",
            ...     pcf=pcf
            ... )
            >>> product_footprint2 = ProductFootprint(
            ...     version=Version(),
            ...     created=DateTime(),
            ...     status=ProductFootprintStatus(),
            ...     company_name="Example Company",
            ...     company_ids=[CompanyId()],
            ...     product_description="Example Product",
            ...     product_ids=[ProductId()],
            ...     product_category_cpc=CPC(),
            ...     product_name_company="Example Product Name",
            ...     comment="Example comment",
            ...     pcf=pcf
            ... )
            >>> product_footprint1 == product_footprint2
            True
        """
        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Compares two ProductFootprint instances for inequality.

        Examples:
            >>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
            >>> product_footprint1 = ProductFootprint(
            ...     version=Version(),
            ...     created=DateTime(),
            ...     status=ProductFootprintStatus(),
            ...     company_name="Example Company",
            ...     company_ids=[CompanyId()],
            ...     product_description="Example Product",
            ...     product_ids=[ProductId()],
            ...     product_category_cpc=CPC(),
            ...     product_name_company="Example Product Name",
            ...     comment="Example comment",
            ...     pcf=pcf
            ... )
            >>> product_footprint2 = ProductFootprint(
            ...     version=Version(),
            ...     created=DateTime(),
            ...     status=ProductFootprintStatus(),
            ...     company_name="Different Company",
            ...     company_ids=[CompanyId()],
            ...     product_description="Example Product",
            ...     product_ids=[ProductId()],
            ...     product_category_cpc=CPC(),
            ...     product_name_company="Example Product Name",
            ...     comment="Example comment",
            ...     pcf=pcf
            ... )
            >>> product_footprint1 != product_footprint2
            True
        """
        return not self.__eq__(other)

comment property writable

Gets the comment about the ProductFootprint.

company_ids property writable

Gets the list of CompanyIds for the company that owns the ProductFootprint.

company_name property writable

Gets the name of the company that owns the ProductFootprint.

created property writable

Gets the date and time when the ProductFootprint was created.

extensions property writable

Gets the list of DataModelExtension objects.

id property writable

Gets the unique identifier for this ProductFootprint.

pcf property writable

Gets the carbon footprint of the given product with value conforming to the data type CarbonFootprint.

preceding_pf_ids property writable

Gets the list of preceding ProductFootprintIds.

product_category_cpc property writable

Gets the category of the product according to the CPC (Central Product Classification) system.

product_description property writable

Gets the description of the product.

product_ids property writable

Gets the list of ProductIds for the product.

product_name_company property writable

Gets the name of the product as used by the company.

spec_version property writable

Gets the version of the ProductFootprint data specification.

status property writable

Gets the status of the ProductFootprint.

status_comment property writable

Gets the comment describing the status of the ProductFootprint.

status_info property writable

Gets the status information of the ProductFootprint.

updated property writable

Gets the date and time when the ProductFootprint was last updated.

validity_period property writable

Gets the validity period for the ProductFootprint.

version property writable

Gets the version of the ProductFootprint.

__eq__(other)

Compares two ProductFootprint instances for equality.

Examples:

>>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
>>> product_footprint1 = ProductFootprint(
...     version=Version(),
...     created=DateTime(),
...     status=ProductFootprintStatus(),
...     company_name="Example Company",
...     company_ids=[CompanyId()],
...     product_description="Example Product",
...     product_ids=[ProductId()],
...     product_category_cpc=CPC(),
...     product_name_company="Example Product Name",
...     comment="Example comment",
...     pcf=pcf
... )
>>> product_footprint2 = ProductFootprint(
...     version=Version(),
...     created=DateTime(),
...     status=ProductFootprintStatus(),
...     company_name="Example Company",
...     company_ids=[CompanyId()],
...     product_description="Example Product",
...     product_ids=[ProductId()],
...     product_category_cpc=CPC(),
...     product_name_company="Example Product Name",
...     comment="Example comment",
...     pcf=pcf
... )
>>> product_footprint1 == product_footprint2
True
Source code in pact_methodology/product_footprint/product_footprint.py
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
def __eq__(self, other):
    """
    Compares two ProductFootprint instances for equality.

    Examples:
        >>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
        >>> product_footprint1 = ProductFootprint(
        ...     version=Version(),
        ...     created=DateTime(),
        ...     status=ProductFootprintStatus(),
        ...     company_name="Example Company",
        ...     company_ids=[CompanyId()],
        ...     product_description="Example Product",
        ...     product_ids=[ProductId()],
        ...     product_category_cpc=CPC(),
        ...     product_name_company="Example Product Name",
        ...     comment="Example comment",
        ...     pcf=pcf
        ... )
        >>> product_footprint2 = ProductFootprint(
        ...     version=Version(),
        ...     created=DateTime(),
        ...     status=ProductFootprintStatus(),
        ...     company_name="Example Company",
        ...     company_ids=[CompanyId()],
        ...     product_description="Example Product",
        ...     product_ids=[ProductId()],
        ...     product_category_cpc=CPC(),
        ...     product_name_company="Example Product Name",
        ...     comment="Example comment",
        ...     pcf=pcf
        ... )
        >>> product_footprint1 == product_footprint2
        True
    """
    return self.__dict__ == other.__dict__

__init__(*, id=None, spec_version='2.2.0', version, created, updated=None, status_info, validity_period=None, company_name, company_ids, product_description, product_ids, product_category_cpc, product_name_company, comment, extensions=None, pcf, preceding_pf_ids=None)

Initializes a new ProductFootprint instance.

Parameters:

Name Type Description Default
id ProductFootprintId | None

The ProductFootprintId for this instance. If not provided, a new one will be generated.

None
spec_version str

The version of the ProductFootprint data specification. Currently, hardcoded to "2.2.0", but may be updated in the future to support different versions.

'2.2.0'
version Version

The version of the ProductFootprint.

required
created DateTime

The date and time when the ProductFootprint was created.

required
updated DateTime | None

The date and time when the ProductFootprint was last updated.

None
status ProductFootprintStatus

The status of the ProductFootprint.

required
status_comment str | None

A comment describing the status of the ProductFootprint.

required
validity_period ValidityPeriod | None

The validity period for the ProductFootprint.

None
company_name str

The name of the company that owns the ProductFootprint.

required
company_ids list[CompanyId]

A list of CompanyIds for the company that owns the ProductFootprint.

required
product_description str

A description of the product.

required
product_ids list[ProductId]

A list of ProductIds for the product.

required
product_category_cpc CPC

The category of the product according to the CPC (Central Product Classification) system.

required
product_name_company str

The name of the product as used by the company.

required
comment str

A comment about the ProductFootprint.

required
extensions list[DataModelExtension] | None

A list of DataModelExtension objects.

None
pcf CarbonFootprint

The carbon footprint of the given product with value conforming to the data type CarbonFootprint.

required
preceding_pf_ids list[ProductFootprintId] | None

A list of preceding ProductFootprintIds.

None

Examples:

>>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
>>> product_footprint = ProductFootprint(
...     version=Version(),
...     created=DateTime(),
...     status=ProductFootprintStatus(),
...     company_name="Example Company",
...     company_ids=[CompanyId()],
...     product_description="Example Product",
...     product_ids=[ProductId()],
...     product_category_cpc=CPC(),
...     product_name_company="Example Product Name",
...     comment="Example comment",
...     pcf=pcf
... )
>>> print(product_footprint)
ProductFootprint(id=<ProductFootprintId>, spec_version=2.2.0, version=<Version>, ...)
Source code in pact_methodology/product_footprint/product_footprint.py
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
def __init__(
    self,
    *,
    id: ProductFootprintId | None = None,
    spec_version: str = "2.2.0",
    version: Version,
    created: DateTime,
    updated: DateTime | None = None,
    status_info: ProductFootprintStatus,
    validity_period: ValidityPeriod | None = None,
    company_name: str,
    company_ids: list[CompanyId],
    product_description: str,
    product_ids: list[ProductId],
    product_category_cpc: CPC,
    product_name_company: str,
    comment: str,
    extensions: list[DataModelExtension] | None = None,
    pcf: CarbonFootprint,
    preceding_pf_ids: list[ProductFootprintId] | None = None,
):
    """
    Initializes a new ProductFootprint instance.

    Args:
        id (ProductFootprintId | None): The ProductFootprintId for this instance. If not provided, a new one will be generated.
        spec_version (str): The version of the ProductFootprint data specification. Currently, hardcoded to "2.2.0", but may be updated in the future to support different versions.
        version (Version): The version of the ProductFootprint.
        created (DateTime): The date and time when the ProductFootprint was created.
        updated (DateTime | None): The date and time when the ProductFootprint was last updated.
        status (ProductFootprintStatus): The status of the ProductFootprint.
        status_comment (str | None): A comment describing the status of the ProductFootprint.
        validity_period (ValidityPeriod | None): The validity period for the ProductFootprint.
        company_name (str): The name of the company that owns the ProductFootprint.
        company_ids (list[CompanyId]): A list of CompanyIds for the company that owns the ProductFootprint.
        product_description (str): A description of the product.
        product_ids (list[ProductId]): A list of ProductIds for the product.
        product_category_cpc (CPC): The category of the product according to the CPC (Central Product Classification) system.
        product_name_company (str): The name of the product as used by the company.
        comment (str): A comment about the ProductFootprint.
        extensions (list[DataModelExtension] | None): A list of DataModelExtension objects.
        pcf (CarbonFootprint): The carbon footprint of the given product with value conforming to the data type CarbonFootprint.
        preceding_pf_ids (list[ProductFootprintId] | None): A list of preceding ProductFootprintIds.

    Examples:
        >>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
        >>> product_footprint = ProductFootprint(
        ...     version=Version(),
        ...     created=DateTime(),
        ...     status=ProductFootprintStatus(),
        ...     company_name="Example Company",
        ...     company_ids=[CompanyId()],
        ...     product_description="Example Product",
        ...     product_ids=[ProductId()],
        ...     product_category_cpc=CPC(),
        ...     product_name_company="Example Product Name",
        ...     comment="Example comment",
        ...     pcf=pcf
        ... )
        >>> print(product_footprint)
        ProductFootprint(id=<ProductFootprintId>, spec_version=2.2.0, version=<Version>, ...)
    """
    self.id = id if id else ProductFootprintId()
    self.spec_version = spec_version
    self.version = version
    self.created = created
    self.updated = updated
    self.status_info = status_info
    self.company_name = company_name
    self.company_ids = company_ids
    self.product_description = product_description
    self.product_ids = product_ids
    self.product_category_cpc = product_category_cpc
    self.product_name_company = product_name_company
    self.comment = comment
    self.extensions = extensions
    self.pcf = pcf
    self.preceding_pf_ids = preceding_pf_ids
    self.validity_period = validity_period if validity_period else ValidityPeriod(reference_period_end=self.pcf.reference_period.end)

__ne__(other)

Compares two ProductFootprint instances for inequality.

Examples:

>>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
>>> product_footprint1 = ProductFootprint(
...     version=Version(),
...     created=DateTime(),
...     status=ProductFootprintStatus(),
...     company_name="Example Company",
...     company_ids=[CompanyId()],
...     product_description="Example Product",
...     product_ids=[ProductId()],
...     product_category_cpc=CPC(),
...     product_name_company="Example Product Name",
...     comment="Example comment",
...     pcf=pcf
... )
>>> product_footprint2 = ProductFootprint(
...     version=Version(),
...     created=DateTime(),
...     status=ProductFootprintStatus(),
...     company_name="Different Company",
...     company_ids=[CompanyId()],
...     product_description="Example Product",
...     product_ids=[ProductId()],
...     product_category_cpc=CPC(),
...     product_name_company="Example Product Name",
...     comment="Example comment",
...     pcf=pcf
... )
>>> product_footprint1 != product_footprint2
True
Source code in pact_methodology/product_footprint/product_footprint.py
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
def __ne__(self, other):
    """
    Compares two ProductFootprint instances for inequality.

    Examples:
        >>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
        >>> product_footprint1 = ProductFootprint(
        ...     version=Version(),
        ...     created=DateTime(),
        ...     status=ProductFootprintStatus(),
        ...     company_name="Example Company",
        ...     company_ids=[CompanyId()],
        ...     product_description="Example Product",
        ...     product_ids=[ProductId()],
        ...     product_category_cpc=CPC(),
        ...     product_name_company="Example Product Name",
        ...     comment="Example comment",
        ...     pcf=pcf
        ... )
        >>> product_footprint2 = ProductFootprint(
        ...     version=Version(),
        ...     created=DateTime(),
        ...     status=ProductFootprintStatus(),
        ...     company_name="Different Company",
        ...     company_ids=[CompanyId()],
        ...     product_description="Example Product",
        ...     product_ids=[ProductId()],
        ...     product_category_cpc=CPC(),
        ...     product_name_company="Example Product Name",
        ...     comment="Example comment",
        ...     pcf=pcf
        ... )
        >>> product_footprint1 != product_footprint2
        True
    """
    return not self.__eq__(other)

__repr__()

Returns a detailed string representation of the ProductFootprint instance for debugging.

Examples:

>>> pcf = CarbonFootprint(
>>> product_footprint = ProductFootprint(
...     version=Version(),
...     created=DateTime(),
...     status=ProductFootprintStatus(),
...     company_name="Example Company",
...     company_ids=[CompanyId()],
...     product_description="Example Product",
...     product_ids=[ProductId()],
...     product_category_cpc=CPC(),
...     product_name_company="Example Product Name",
...     comment="Example comment",
...     pcf=pcf
... )
>>> repr(product_footprint)
ProductFootprint(id=<ProductFootprintId>, spec_version='2.2.0', version=<Version>, ...)
Source code in pact_methodology/product_footprint/product_footprint.py
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
def __repr__(self):
    """
    Returns a detailed string representation of the ProductFootprint instance for debugging.

    Examples:
        >>> pcf = CarbonFootprint(
        >>> product_footprint = ProductFootprint(
        ...     version=Version(),
        ...     created=DateTime(),
        ...     status=ProductFootprintStatus(),
        ...     company_name="Example Company",
        ...     company_ids=[CompanyId()],
        ...     product_description="Example Product",
        ...     product_ids=[ProductId()],
        ...     product_category_cpc=CPC(),
        ...     product_name_company="Example Product Name",
        ...     comment="Example comment",
        ...     pcf=pcf
        ... )
        >>> repr(product_footprint)
        ProductFootprint(id=<ProductFootprintId>, spec_version='2.2.0', version=<Version>, ...)
    """
    return (
        f"ProductFootprint(id={self.id!r}, spec_version={self.spec_version!r}, version={self.version!r}, "
        f"created={self.created!r}, updated={self.updated!r}, status={self.status!r}, status_comment={self.status_comment!r}, "
        f"validity_period={self.validity_period!r}, company_name={self.company_name!r}, company_ids={self.company_ids!r}, "
        f"product_description={self.product_description!r}, product_ids={self.product_ids!r}, "
        f"product_category_cpc={self.product_category_cpc!r}, product_name_company={self.product_name_company!r}, "
        f"comment={self.comment!r}, extensions={self.extensions!r}, pcf={self.pcf!r}, preceding_pf_ids={self.preceding_pf_ids!r})"
    )

__str__()

Returns a string representation of the ProductFootprint instance.

Examples:

>>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
>>> product_footprint = ProductFootprint(
...     version=Version(),
...     created=DateTime(),
...     status=ProductFootprintStatus(),
...     company_name="Example Company",
...     company_ids=[CompanyId()],
...     product_description="Example Product",
...     product_ids=[ProductId()],
...     product_category_cpc=CPC(),
...     product_name_company="Example Product Name",
...     comment="Example comment",
...     pcf=pcf
... )
>>> print(product_footprint)
ProductFootprint(id=<ProductFootprintId>, spec_version=2.2.0, version=<Version>, ...)
Source code in pact_methodology/product_footprint/product_footprint.py
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
def __str__(self):
    """
    Returns a string representation of the ProductFootprint instance.

    Examples:
        >>> pcf = CarbonFootprint(...)  # Assume CarbonFootprint is properly initialized
        >>> product_footprint = ProductFootprint(
        ...     version=Version(),
        ...     created=DateTime(),
        ...     status=ProductFootprintStatus(),
        ...     company_name="Example Company",
        ...     company_ids=[CompanyId()],
        ...     product_description="Example Product",
        ...     product_ids=[ProductId()],
        ...     product_category_cpc=CPC(),
        ...     product_name_company="Example Product Name",
        ...     comment="Example comment",
        ...     pcf=pcf
        ... )
        >>> print(product_footprint)
        ProductFootprint(id=<ProductFootprintId>, spec_version=2.2.0, version=<Version>, ...)
    """
    return (
        f"ProductFootprint(id={self.id}, spec_version={self.spec_version}, version={self.version}, "
        f"created={self.created}, updated={self.updated}, status={self.status}, status_comment='{self.status_comment}', "
        f"validity_period={self.validity_period}, company_name='{self.company_name}', company_ids={self.company_ids}, "
        f"product_description='{self.product_description}', product_ids={self.product_ids}, "
        f"product_category_cpc={self.product_category_cpc}, product_name_company='{self.product_name_company}', "
        f"comment='{self.comment}', extensions={self.extensions}, pcf={self.pcf}, preceding_pf_ids={self.preceding_pf_ids})"
    )