epd-parser
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/as:epd-parser — EPD PDF Parser
/as:epd-parser — EPD PDF解析器
<!-- architecture-studio:harness-compatibility -->
Harness note: useon Claude Code and/as:<skill>on Codex. Resolve$<skill>as the directory containing this loaded<skill-root>andSKILL.mdas the plugin root that contains<plugin-root>, and use equivalent native tools when host tool names differ.skills/
Extract structured environmental impact data from EPD (Environmental Product Declaration) PDF files. Uses PyMuPDF for text extraction and Claude's reasoning to parse varying EPD formats into a standardized 42-column schema.
EPDs follow ISO 14025 / ISO 21930 / EN 15804 and report life cycle environmental impacts of building products. This skill reads those PDFs and structures the data for comparison, specification, and LEED documentation.
<!-- architecture-studio:harness-compatibility -->
Harness说明:在Claude Code中使用,在Codex中使用/as:<skill>。将$<skill>解析为包含已加载的<skill-root>的目录,将SKILL.md解析为包含<plugin-root>的插件根目录;当宿主工具名称不同时,请使用等效的原生工具。skills/
从EPD(环境产品声明)PDF文件中提取结构化的环境影响数据。使用PyMuPDF进行文本提取,并借助Claude的推理能力将不同格式的EPD解析为标准化的42列schema。
EPD遵循ISO 14025 / ISO 21930 / EN 15804标准,用于报告建筑产品的生命周期环境影响。本技能可读取此类PDF并将数据结构化,用于对比、规格制定及LEED文档编制。
Input
输入
The user provides EPD PDFs in one of these ways:
- File paths — one or more PDF file paths
- Folder path — a directory containing PDFs (will process all files)
.pdf - Just invoked — ask the user for file paths or a folder
用户可通过以下任一方式提供EPD PDF:
- 文件路径 — 一个或多个PDF文件路径
- 文件夹路径 — 包含PDF的目录(将处理所有文件)
.pdf - 仅调用(无输入) — 向用户询问文件路径或文件夹
Output Schema
输出Schema
Use the canonical 42-column contract in . It is separate from the 33-column FF&E product schema. Never substitute or persist an FF&E-shaped record as EPD data. Leave unavailable values empty and use a plain URL for .
schema/epd-schema.mdEPD Link使用中定义的标准42列约定。该schema与33列的FF&E产品schema相互独立。严禁将FF&E格式的记录替代为EPD数据或持久化存储。不可用的值请留空,字段使用纯URL格式。
schema/epd-schema.mdEPD LinkMaterial Category Vocabulary
材料分类词汇表
Use ONE normalized term: Concrete, Steel, Aluminum, Wood/Timber, Insulation, Gypsum, Glass, Ceramic/Tile, Carpet, Resilient Flooring, Roofing Membrane, Sealant, Paint/Coating, Masonry, Stone, Composite Panel, Acoustic, Cladding, Rebar, Cement, Aggregate, Furniture, Other.
请使用以下标准化术语中的一个:混凝土(Concrete)、钢材(Steel)、铝材(Aluminum)、木材(Wood/Timber)、保温材料(Insulation)、石膏(Gypsum)、玻璃(Glass)、陶瓷/瓷砖(Ceramic/Tile)、地毯(Carpet)、弹性地板(Resilient Flooring)、屋面卷材(Roofing Membrane)、密封胶(Sealant)、涂料/涂层(Paint/Coating)、砌体(Masonry)、石材(Stone)、复合板(Composite Panel)、声学材料(Acoustic)、覆层(Cladding)、钢筋(Rebar)、水泥(Cement)、骨料(Aggregate)、家具(Furniture)、其他(Other)。
EPD-specific data in Notes (col AO)
备注(AO列)中的EPD专属数据
EPDs contain fields that don't have dedicated columns. Append these to Notes:
- EPD Type: or
Type: Product-specificorType: Industry-averageType: Sector - Verification:
Verified by: [verifier name] - EN version: or
EN 15804+A1(important for comparability)EN 15804+A2 - Source File:
Source: holcim-readymix-epd.pdf - LCA Software: or
LCA: GaBiorLCA: SimaProLCA: openLCA - Biogenic carbon note: If the EPD reports biogenic carbon storage separately
Example Notes cell:
Type: Product-specific | Verified by: Underwriters Laboratories | EN 15804+A2 | LCA: GaBi | Source: holcim-readymix-epd.pdfEPD包含一些没有专属列的字段,请将以下内容追加到备注中:
- EPD类型:(产品特定)或
Type: Product-specific(行业平均)或Type: Industry-average(行业层面)Type: Sector - 验证信息:
Verified by: [验证机构名称] - EN版本:或
EN 15804+A1(对可比性至关重要)EN 15804+A2 - 源文件:
Source: holcim-readymix-epd.pdf - LCA软件:或
LCA: GaBi或LCA: SimaProLCA: openLCA - 生物碳说明:若EPD单独报告了生物碳储存量
备注单元格示例:
Type: Product-specific | Verified by: Underwriters Laboratories | EN 15804+A2 | LCA: GaBi | Source: holcim-readymix-epd.pdfLEED Eligibility Logic (col AI)
LEED合格性逻辑(AI列)
- Yes: Product-specific, third-party verified EPD conforming to ISO 14025
- Partial: Industry-average or sector EPD (counts for LEED Option 1 but not Option 2)
- No: Self-declared, unverified, or non-conforming
- 是:符合ISO 14025标准、经第三方验证的产品特定EPD
- 部分符合:行业平均或行业层面EPD(适用于LEED选项1,但不适用于选项2)
- 否:自我声明、未经验证或不符合标准的EPD
Workflow
工作流程
Step 1: Get input
步骤1:获取输入
Parse the user's input to identify PDF file(s) and output preferences.
- If given a folder, list all files and report count
.pdf - If no PDFs found or path is invalid, ask the user
- Report: "Found N EPD PDF(s) to process."
解析用户输入,识别PDF文件及输出偏好。
- 若提供了文件夹,列出所有文件并报告数量
.pdf - 若未找到PDF或路径无效,询问用户
- 报告格式:"找到N份待处理的EPD PDF。"
Step 2: Extract text from PDF
步骤2:从PDF提取文本
Use PyMuPDF (fitz) to extract text from each PDF. Run this Python script via Bash:
python
import fitz
import sys
import json
pdf_path = sys.argv[1]
doc = fitz.open(pdf_path)
pages = []
for i, page in enumerate(doc):
text = page.get_text()
pages.append({"page": i + 1, "text": text})
doc.close()
print(json.dumps({"filename": pdf_path.split("/")[-1], "total_pages": len(pages), "pages": pages}))For each PDF, extract all pages and keep the JSON output transiently for parsing; do not create a persistent JSON artifact.
使用PyMuPDF(fitz)从每个PDF中提取文本。通过Bash运行以下Python脚本:
python
import fitz
import sys
import json
pdf_path = sys.argv[1]
doc = fitz.open(pdf_path)
pages = []
for i, page in enumerate(doc):
text = page.get_text()
pages.append({"page": i + 1, "text": text})
doc.close()
print(json.dumps({"filename": pdf_path.split("/")[-1], "total_pages": len(pages), "pages": pages}))对于每个PDF,提取所有页面的内容,并将JSON输出临时保存用于解析;不要创建持久化的JSON文件。
Step 3: Parse EPD data
步骤3:解析EPD数据
Read the extracted text and identify all environmental impact data. This is the core intelligence step.
For small EPDs (<=30 pages): Process all pages at once.
For large EPDs (>30 pages): Process in chunks of 15 pages. Carry forward context between chunks.
Parsing instructions:
-
Identify the EPD structure — EPDs typically have these sections:
- General information (pages 1-2): manufacturer, product, declared unit, program operator, validity
- Product description (pages 2-3): materials, manufacturing process, application
- LCA information: system boundary, data sources, allocation rules
- Impact indicator tables: the core data — usually 1-3 pages of tables
- Resource use and waste tables
- Additional information: scenarios, biogenic carbon, recycled content
-
Extract product identity first — manufacturer, product name, declared unit, functional unit. These are always on page 1-2.
-
Extract EPD metadata — registration number, program operator, PCR, standard, dates, system boundary. Usually on page 1 or in a header/sidebar.
-
Find and parse impact indicator tables — This is the most critical step:
- Look for tables with life cycle stage columns (A1, A2, A3 or A1-A3 combined, A4, A5, B1-B7, C1-C4, D)
- Impact categories are rows: GWP, ODP, AP, EP, POCP, ADP (or ADPE/ADPF)
- EN 15804+A2 EPDs split GWP into: GWP-total, GWP-fossil, GWP-biogenic, GWP-luluc. Capture all that exist.
- EN 15804+A1 EPDs report a single GWP row. Put this value in GWP-total (A1-A3).
- If A1, A2, A3 are reported separately (not combined), sum them for the A1-A3 total.
- Units are standardized: GWP = kg CO2e, ODP = kg CFC-11e, AP = kg SO2e (or mol H+ eq for +A2), EP = kg PO4e (or mol N eq / kg P eq for +A2), POCP = kg C2H4e (or kg NMVOC eq for +A2).
-
Extract resource use — PERE, PENRE, fresh water, waste. Usually in a separate table following the impact indicators.
-
Extract additional data — recycled content %, manufacturing plant, country of origin, LCA software, verifier name.
-
Determine LEED eligibility — based on EPD type and verification status.
-
Leave fields blank rather than guessing — if a field isn't in the EPD, leave it empty.
读取提取的文本,识别所有环境影响数据。这是核心的智能处理步骤。
小型EPD(≤30页): 一次性处理所有页面。
大型EPD(>30页): 按15页为分块处理,在分块之间传递上下文。
解析说明:
-
识别EPD结构 — EPD通常包含以下部分:
- 基本信息(第1-2页):制造商、产品、声明单位、项目运营方、有效期
- 产品描述(第2-3页):材料、制造工艺、应用场景
- LCA信息:系统边界、数据来源、分配规则
- 影响指标表:核心数据 — 通常为1-3页的表格
- 资源使用与废弃物表
- 附加信息:场景、生物碳、回收成分
-
优先提取产品标识信息 — 制造商、产品名称、声明单位、功能单位。这些信息通常在第1-2页。
-
提取EPD元数据 — 注册号、项目运营方、PCR、标准、日期、系统边界。通常在第1页或页眉/侧边栏中。
-
查找并解析影响指标表 — 这是最关键的步骤:
- 查找包含生命周期阶段列的表格(A1、A2、A3或A1-A3合并列、A4、A5、B1-B7、C1-C4、D)
- 影响类别为行:GWP、ODP、AP、EP、POCP、ADP(或ADPE/ADPF)
- EN 15804+A2 EPD 将GWP拆分为:GWP-total、GWP-fossil、GWP-biogenic、GWP-luluc。请提取所有存在的分项。
- EN 15804+A1 EPD 仅报告一行GWP数据。请将该值填入GWP-total(A1-A3)字段。
- 若A1、A2、A3分别报告(未合并),请将三者相加得到A1-A3总量。
- 单位为标准化单位:GWP = kg CO2e,ODP = kg CFC-11e,AP = kg SO2e(+A2版本为mol H+ eq),EP = kg PO4e(+A2版本为mol N eq / kg P eq),POCP = kg C2H4e(+A2版本为kg NMVOC eq)。
-
提取资源使用数据 — PERE、PENRE、淡水、废弃物。通常在影响指标表之后的单独表格中。
-
提取附加数据 — 回收成分百分比、制造工厂、原产国、LCA软件、验证机构名称。
-
判定LEED合格性 — 基于EPD类型和验证状态。
-
字段留空请勿猜测 — 若EPD中没有某个字段的信息,请留空。
Multi-product EPDs
多产品EPD
Some EPDs declare impacts for multiple products, product groups, or concrete mix designs. Create one row per product/variant:
- If the EPD covers "Product A" and "Product B" with separate impact tables, create two rows
- If the EPD covers multiple concrete mixes (e.g., 3000 PSI, 4000 PSI, 5000 PSI), create one row per mix
- The product name should distinguish variants: "ReadyMix Concrete — 4000 PSI"
部分EPD会声明多个产品、产品组或混凝土配合比的环境影响。请为每个产品/变体创建一行记录:
- 若EPD包含"产品A"和"产品B"且分别有影响表,请创建两行记录
- 若EPD包含多种混凝土配合比(例如3000 PSI、4000 PSI、5000 PSI),请为每种配合比创建一行记录
- 产品名称应能区分变体:"ReadyMix Concrete — 4000 PSI"
Step 4: Present results
步骤4:展示结果
Show a summary table for each parsed EPD:
undefined为每个解析后的EPD展示一个汇总表:
undefinedEPD Parse Results
EPD Parse Results
holcim-readymix-epd.pdf
holcim-readymix-epd.pdf
| Field | Value |
|---|---|
| Product | ReadyMix Concrete — 4000 PSI |
| Manufacturer | Holcim |
| Declared Unit | 1 m3 |
| GWP (A1-A3) | 312 kg CO2e |
| System Boundary | Cradle-to-gate |
| Program Operator | NSF |
| Valid | 2024-01-15 to 2029-01-15 |
| LEED Eligible | Yes |
Products extracted: 3 (3000 PSI, 4000 PSI, 5000 PSI)
The preview is the default result. It can pass directly to `/as:epd-compare` or `/as:epd-to-spec` without creating a file.| Field | Value |
|---|---|
| Product | ReadyMix Concrete — 4000 PSI |
| Manufacturer | Holcim |
| Declared Unit | 1 m3 |
| GWP (A1-A3) | 312 kg CO2e |
| System Boundary | Cradle-to-gate |
| Program Operator | NSF |
| Valid | 2024-01-15 to 2029-01-15 |
| LEED Eligible | Yes |
Products extracted: 3 (3000 PSI, 4000 PSI, 5000 PSI)
预览为默认输出结果。无需创建文件,可直接传递给`/as:epd-compare`或`/as:epd-to-spec`使用。Step 5: Optional persistence
步骤5:可选持久化
Do not create a file by default. Only when the user explicitly asks to save reusable records:
- Resolve the nearest ancestor containing ; the target is
PROJECT.md.<project-root>/epd-library.csv - Build complete records using , with
schema/epd-schema.mdas an ISO 8601 timestamp andParsed AtasSource.epd-parser - Preview the records, target path, and whether this initializes or appends.
- Use one confirmation gate; do not ask the same confirmation first in prose.
- Serialize all approved records as one JSON array, preserving canonical field names. After approval, use if needed, then invoke
python3 "<plugin-root>/skills/master-schedule/scripts/csv-library.py" init epdexactly once. Never append in a per-record loop. The helper validates the entire file, rejects FF&E or malformed headers, and writes the whole batch atomically.python3 "<plugin-root>/skills/master-schedule/scripts/csv-library.py" append epd --row-json <batch.json>
If no project root exists, keep the result in conversation and offer ; do not invent another CSV destination.
/as:project init默认情况下不创建文件。仅当用户明确要求保存可复用记录时才执行:
- 定位最近的包含的上级目录;目标路径为
PROJECT.md。<project-root>/epd-library.csv - 使用构建完整记录,其中
schema/epd-schema.md为ISO 8601格式的时间戳,Parsed At为Source。epd-parser - 预览记录、目标路径,以及是初始化还是追加操作。
- 仅进行一次确认;请勿先以文字形式重复询问相同的确认问题。
- 将所有获批记录序列化为一个JSON数组,保留标准字段名。获得批准后,如需初始化则运行,然后仅调用一次
python3 "<plugin-root>/skills/master-schedule/scripts/csv-library.py" init epd。严禁按记录循环追加。该辅助工具会验证整个文件,拒绝FF&E格式或格式错误的表头,并原子性地写入整批数据。python3 "<plugin-root>/skills/master-schedule/scripts/csv-library.py" append epd --row-json <batch.json>
若不存在项目根目录,请将结果保留在对话中,并提供选项;请勿自行设定其他CSV存储路径。
/as:project initEdge Cases
边界情况
- Scanned PDFs (image-only): PyMuPDF will return empty or garbage text. Detect this (very short text relative to page count) and tell the user: "This PDF appears to be scanned/image-based. Text extraction won't work — consider using an OCR tool first."
- Non-English EPDs: Common for European manufacturers (German, French, Spanish, Swedish). Impact indicator abbreviations (GWP, ODP, AP, EP, POCP) are the same internationally. Extract numeric data regardless; note the language in Notes.
- EN 15804+A1 vs +A2: Older EPDs use +A1 (single GWP row, different EP/AP units). Newer use +A2 (split GWP, different units for AP/EP/POCP). Always note which version in Notes. Map to schema as closely as possible.
- Multi-product EPDs: One row per product/variant. See Multi-product EPDs section above.
- Expired EPDs: Flag in Notes: . Still parse the data.
EXPIRED — valid to YYYY-MM-DD - Password-protected PDFs: PyMuPDF will fail to open. Catch the error and tell the user.
- Very large PDFs (50+ pages): Process in 15-page chunks. Give progress updates.
- EPDs with impact tables as images: Detect missing numeric data in what should be table sections. Flag: "Impact tables may be embedded as images — manual extraction needed."
- 扫描版PDF(纯图片):PyMuPDF将返回空文本或乱码。请检测此情况(文本长度相对于页数过短)并告知用户:"该PDF似乎是扫描/图片版。文本提取无法正常工作 — 建议先使用OCR工具处理。"
- 非英文EPD:常见于欧洲制造商(德语、法语、西班牙语、瑞典语)。影响指标缩写(GWP、ODP、AP、EP、POCP)在国际上是统一的。无论语言如何都请提取数值数据,并在备注中注明语言。
- EN 15804+A1与+A2版本:旧版EPD使用+A1(单行GWP,EP/AP单位不同)。新版使用+A2(GWP拆分,AP/EP/POCP单位不同)。请务必在备注中注明版本,并尽可能映射到schema中。
- 多产品EPD:每个产品/变体一行记录。参见上文“多产品EPD”部分。
- 过期EPD:在备注中标记:。仍需解析数据。
EXPIRED — valid to YYYY-MM-DD - 受密码保护的PDF:PyMuPDF将无法打开。请捕获错误并告知用户。
- 超大型PDF(50页以上):按15页分块处理,并提供进度更新。
- 影响表为图片的EPD:若在本应是表格的区域检测不到数值数据,请标记:"影响表可能嵌入为图片 — 需要手动提取。"
GWP Baseline Policy
GWP基准政策
This policy is shared by all four EPD skills (, , , ) and must read identically in each. Industry-average GWP baselines are allowed only when cited with a named source and publication year (e.g., "NRMCA Industry-Wide Member EPD v3.2, 2022" or "AISC Fabricated Hot-Rolled Structural Sections EPD, 2021"). Uncited baseline numbers recalled from memory or training data are banned. If no source-and-year citation is available, ask the user to provide a baseline EPD or find one with — never guess a baseline.
epd-parserepd-researchepd-compareepd-to-spec/as:epd-researchFor this skill: report only values extracted from the parsed EPD itself. When contextualizing a parsed GWP against an industry average (e.g., in the parse-results summary), the baseline must carry a source-and-year citation or be omitted.
本政策由四个EPD技能(、、、)共同使用,各技能中的表述必须完全一致。仅当行业平均GWP基准带有明确来源和出版年份时才可使用(例如"NRMCA Industry-Wide Member EPD v3.2, 2022"或"AISC Fabricated Hot-Rolled Structural Sections EPD, 2021")。严禁使用从记忆或训练数据中回忆的、无引用来源的基准数值。若无来源和年份的引用信息,请要求用户提供基准EPD,或使用查找 — 绝对不要猜测基准值。
epd-parserepd-researchepd-compareepd-to-spec/as:epd-research对于本技能:仅报告从所解析的EPD本身提取的数值。当将解析得到的GWP与行业平均水平进行对比说明时(例如在解析结果汇总中),基准必须带有来源和年份引用,否则应省略。
Error Reporting
错误报告
After processing, always report:
Parsed: X products from Y EPD PDF(s)
- filename.pdf: N products extracted
- filename2.pdf: M products extracted
Issues: [list any problems — expired, scanned, missing tables, etc.]处理完成后,始终按以下格式报告:
Parsed: X products from Y EPD PDF(s)
- filename.pdf: N products extracted
- filename2.pdf: M products extracted
Issues: [list any problems — expired, scanned, missing tables, etc.]