Skip to content

Schemas

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "EPD",
  "type": "object",
  "required": [
    "declared_unit",
    "format_version",
    "id",
    "location",
    "name",
    "published_date",
    "standard",
    "subtype",
    "valid_until",
    "version"
  ],
  "properties": {
    "adpe": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "adpf": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "ap": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "comment": {
      "type": [
        "string",
        "null"
      ]
    },
    "conversions": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/definitions/Conversion"
      }
    },
    "cru": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "declared_unit": {
      "$ref": "#/definitions/Unit"
    },
    "eee": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "eet": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "ep": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "format_version": {
      "type": "string"
    },
    "fw": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "gwp": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "hwd": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "id": {
      "type": "string"
    },
    "location": {
      "type": "string"
    },
    "mer": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "meta_data": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      }
    },
    "mfr": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "name": {
      "type": "string"
    },
    "nhwd": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "nrsf": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "odp": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "penre": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "penrm": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "penrt": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "pere": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "perm": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "pert": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "pocp": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "published_date": {
      "type": "string",
      "format": "date-time"
    },
    "reference_service_life": {
      "type": [
        "integer",
        "null"
      ],
      "format": "uint32",
      "minimum": 0.0
    },
    "rsf": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "rwd": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "sm": {
      "anyOf": [
        {
          "$ref": "#/definitions/ImpactCategory"
        },
        {
          "type": "null"
        }
      ]
    },
    "source": {
      "anyOf": [
        {
          "$ref": "#/definitions/Source"
        },
        {
          "type": "null"
        }
      ]
    },
    "standard": {
      "$ref": "#/definitions/Standard"
    },
    "subtype": {
      "$ref": "#/definitions/SubType"
    },
    "valid_until": {
      "type": "string",
      "format": "date-time"
    },
    "version": {
      "type": "string"
    }
  },
  "definitions": {
    "Conversion": {
      "type": "object",
      "required": [
        "meta_data",
        "to",
        "value"
      ],
      "properties": {
        "meta_data": {
          "type": "string"
        },
        "to": {
          "$ref": "#/definitions/Unit"
        },
        "value": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "ImpactCategory": {
      "type": "object",
      "properties": {
        "a1a3": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "a4": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "a5": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "b1": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "b2": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "b3": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "b4": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "b5": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "b6": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "b7": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "c1": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "c2": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "c3": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "c4": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "d": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        }
      }
    },
    "Source": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "Standard": {
      "type": "string",
      "enum": [
        "EN15804A1",
        "EN15804A2",
        "UNKNOWN"
      ]
    },
    "SubType": {
      "type": "string",
      "enum": [
        "Generic",
        "Specific",
        "Industry",
        "Representative"
      ]
    },
    "Unit": {
      "type": "string",
      "enum": [
        "M",
        "M2",
        "M3",
        "KG",
        "TONES",
        "PCS",
        "L",
        "M2R1",
        "KM",
        "TONES_KM",
        "UNKNOWN"
      ]
    }
  }
}
# generated by datamodel-codegen:
#   filename:  epdx.schema.json
#   timestamp: 2024-04-01T19:08:23+00:00

from __future__ import annotations

from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional

from pydantic import BaseModel, conint


class ImpactCategory(BaseModel):
    a1a3: Optional[float] = None
    a4: Optional[float] = None
    a5: Optional[float] = None
    b1: Optional[float] = None
    b2: Optional[float] = None
    b3: Optional[float] = None
    b4: Optional[float] = None
    b5: Optional[float] = None
    b6: Optional[float] = None
    b7: Optional[float] = None
    c1: Optional[float] = None
    c2: Optional[float] = None
    c3: Optional[float] = None
    c4: Optional[float] = None
    d: Optional[float] = None


class Source(BaseModel):
    name: str
    url: Optional[str] = None


class Standard(Enum):
    EN15804A1 = 'EN15804A1'
    EN15804A2 = 'EN15804A2'
    UNKNOWN = 'UNKNOWN'


class SubType(Enum):
    Generic = 'Generic'
    Specific = 'Specific'
    Industry = 'Industry'
    Representative = 'Representative'


class Unit(Enum):
    M = 'M'
    M2 = 'M2'
    M3 = 'M3'
    KG = 'KG'
    TONES = 'TONES'
    PCS = 'PCS'
    L = 'L'
    M2R1 = 'M2R1'
    KM = 'KM'
    TONES_KM = 'TONES_KM'
    UNKNOWN = 'UNKNOWN'


class Conversion(BaseModel):
    meta_data: str
    to: Unit
    value: float


class EPD(BaseModel):
    adpe: Optional[ImpactCategory] = None
    adpf: Optional[ImpactCategory] = None
    ap: Optional[ImpactCategory] = None
    comment: Optional[str] = None
    conversions: Optional[List[Conversion]] = None
    cru: Optional[ImpactCategory] = None
    declared_unit: Unit
    eee: Optional[ImpactCategory] = None
    eet: Optional[ImpactCategory] = None
    ep: Optional[ImpactCategory] = None
    format_version: str
    fw: Optional[ImpactCategory] = None
    gwp: Optional[ImpactCategory] = None
    hwd: Optional[ImpactCategory] = None
    id: str
    location: str
    mer: Optional[ImpactCategory] = None
    meta_data: Optional[Dict[str, Any]] = None
    mfr: Optional[ImpactCategory] = None
    name: str
    nhwd: Optional[ImpactCategory] = None
    nrsf: Optional[ImpactCategory] = None
    odp: Optional[ImpactCategory] = None
    penre: Optional[ImpactCategory] = None
    penrm: Optional[ImpactCategory] = None
    penrt: Optional[ImpactCategory] = None
    pere: Optional[ImpactCategory] = None
    perm: Optional[ImpactCategory] = None
    pert: Optional[ImpactCategory] = None
    pocp: Optional[ImpactCategory] = None
    published_date: datetime
    reference_service_life: Optional[conint(ge=0)] = None
    rsf: Optional[ImpactCategory] = None
    rwd: Optional[ImpactCategory] = None
    sm: Optional[ImpactCategory] = None
    source: Optional[Source] = None
    standard: Standard
    subtype: SubType
    valid_until: datetime
    version: str
/* tslint:disable */
/* eslint-disable */
/**
* @param {string} json
* @returns {EPD}
*/
export function convertIlcd(json: string): EPD;
export interface Conversion {
    value: number;
    to: Unit;
    meta_data: string;
}

export interface ImpactCategory {
    a1a3: number | null;
    a4: number | null;
    a5: number | null;
    b1: number | null;
    b2: number | null;
    b3: number | null;
    b4: number | null;
    b5: number | null;
    b6: number | null;
    b7: number | null;
    c1: number | null;
    c2: number | null;
    c3: number | null;
    c4: number | null;
    d: number | null;
}

export type SubType = "Generic" | "Specific" | "Industry" | "Representative";

export type Standard = "EN15804A1" | "EN15804A2" | "UNKNOWN";

export interface Source {
    name: string;
    url: string | null;
}

export type Unit = "M" | "M2" | "M3" | "KG" | "TONES" | "PCS" | "L" | "M2R1" | "KM" | "TONES_KM" | "UNKNOWN";

export interface EPD {
    id: string;
    name: string;
    declared_unit: Unit;
    version: string;
    published_date: DateTime<Utc>;
    valid_until: DateTime<Utc>;
    format_version: string;
    source: Source | null;
    reference_service_life: number | null;
    standard: Standard;
    comment: string | null;
    location: string;
    subtype: SubType;
    conversions: Conversion[] | null;
    gwp: ImpactCategory | null;
    odp: ImpactCategory | null;
    ap: ImpactCategory | null;
    ep: ImpactCategory | null;
    pocp: ImpactCategory | null;
    adpe: ImpactCategory | null;
    adpf: ImpactCategory | null;
    penre: ImpactCategory | null;
    pere: ImpactCategory | null;
    perm: ImpactCategory | null;
    pert: ImpactCategory | null;
    penrt: ImpactCategory | null;
    penrm: ImpactCategory | null;
    sm: ImpactCategory | null;
    rsf: ImpactCategory | null;
    nrsf: ImpactCategory | null;
    fw: ImpactCategory | null;
    hwd: ImpactCategory | null;
    nhwd: ImpactCategory | null;
    rwd: ImpactCategory | null;
    cru: ImpactCategory | null;
    mfr: ImpactCategory | null;
    mer: ImpactCategory | null;
    eee: ImpactCategory | null;
    eet: ImpactCategory | null;
    meta_data: Record<string, string> | null;
}