root / edi
@fabre fabre authored 9 days ago
schemas/ edifact init 9 days ago
.gitignore init 9 days ago
LICENSE init 9 days ago
README.md init 9 days ago
edifact_parser.py init 9 days ago
edifact_summary.py init 9 days ago
edifact_to_yaml.py init 9 days ago
sample-orders.edifact init 9 days ago
README.md

EDIFACT Python Parser

vscode-edi-support 中提取并用 Python 重写的 EDIFACT 解析工具集。

脚本

  • edifact_to_yaml.py: 解析 EDIFACT,默认输出 YAML(可选 JSON)
  • edifact_summary.py: 输出业务摘要(默认 YAML,可选 JSON)
  • edifact_parser.py: 底层解析与语义补全逻辑

用法

解析为 YAML:

python3 edifact_to_yaml.py sample-orders.edifact -o sample-orders.yaml

解析为 JSON:

python3 edifact_to_yaml.py sample-orders.edifact --json -o sample-orders.full.json

输出摘要(YAML):

python3 edifact_summary.py sample-orders.edifact -o sample-orders.summary.yaml

输出摘要(JSON):

python3 edifact_summary.py sample-orders.edifact --json -o sample-orders.summary.json