Skip to content

ID

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.

ProductFootprintId

Bases: UUID

Source code in pact_methodology/product_footprint/id.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
class ProductFootprintId(uuid.UUID):
    def __init__(self, value: str | None = None) -> None:
        """
        A unique identifier for a Product Footprint.

        The Product Footprint ID is a UUID v4 as specified in RFC 4122.

        Attributes:
            value (str): The UUID value of the Product Footprint ID.

        References:
            - https://www.rfc-editor.org/rfc/rfc4122
            - Pathfinder Framework - Guidance for the Accounting and Exchange of Product Life Cycle Emissions Version 2.0
        """
        if value is None:
            super().__init__(uuid.uuid4().hex, version=4)
        else:
            super().__init__(value, version=4)

__init__(value=None)

A unique identifier for a Product Footprint.

The Product Footprint ID is a UUID v4 as specified in RFC 4122.

Attributes:

Name Type Description
value str

The UUID value of the Product Footprint ID.

References
  • https://www.rfc-editor.org/rfc/rfc4122
  • Pathfinder Framework - Guidance for the Accounting and Exchange of Product Life Cycle Emissions Version 2.0
Source code in pact_methodology/product_footprint/id.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
def __init__(self, value: str | None = None) -> None:
    """
    A unique identifier for a Product Footprint.

    The Product Footprint ID is a UUID v4 as specified in RFC 4122.

    Attributes:
        value (str): The UUID value of the Product Footprint ID.

    References:
        - https://www.rfc-editor.org/rfc/rfc4122
        - Pathfinder Framework - Guidance for the Accounting and Exchange of Product Life Cycle Emissions Version 2.0
    """
    if value is None:
        super().__init__(uuid.uuid4().hex, version=4)
    else:
        super().__init__(value, version=4)