Skip to main content

olca2tidas

将 openLCA 导出的 JSON-LD 一键转换为 TIDAS / eILCD 风格 JSON(便于导入天工数据库)、并输出认证清单。 本工具在您的原始转换脚本基础上,封装为 pip 可安装、带 CLI、支持日志输出。


1) 安装

pip install olca2tidas

或者从源码安装:

git clone https://github.com/Kirin-Ciao/olca2tidas.git
cd olca2tidas
pip install -e .

2) 快速开始

方式 A:使用包装后的命令 olca2tidas(推荐)

# Windows 示例(注意路径需要引号)
olca2tidas -- --src "E:\openLCA\tiangong\<your-file>" --out "E:\openLCA\tiangong\Result"

# 同时把控制台输出保存到日志文件:
olca2tidas --log-file logs/run-$(date +%Y%m%d-%H%M%S).log -- --src "C:\data\JSON-LD" --out "C:\data\Result"

-- 之后的参数将原样转发给您的转换脚本(位于 olca2tidas.converter)。 > 需要查看底层脚本的帮助时,运行: olca2tidas -- --help

方式 B:直接调用底层脚本(开发/调试)

python -m olca2tidas.converter --src "/path/to/JSON-LD" --out "/path/to/Result"

3) 常见参数

  • --log-file <path>:将控制台输出同时写入该日志文件(wrapper 提供)。
  • --log-level {DEBUG,INFO,WARNING,ERROR}:调整 wrapper 日志等级(默认 INFO)。
  • -- --help:查看底层转换脚本自己的 --help 说明(由脚本的 argparse 提供)。

底层脚本支持参数(示例):--src、--out、--version、--edge_dir、--locale、--no-cert 等。

4) 输出

转换完成后,会在输出目录生成:

  • data/flows/*.json, data/processes/*.json, data/lifecyclemodels/*.json(覆盖保存后的 ILCD/TIDAS JSON)
  • convert_manifest.json:包含转换数量、SHA256 校验与结构验证结果

5) 开发&发布

  • 运行测试:

    pytest -q
    
  • 本地构建:

    python -m pip install --upgrade build
    python -m build
    
  • 发布到 PyPI:

    python -m pip install --upgrade build twine
    python -m build
    python -m twine upload dist/*
    
  • GitHub Actions 自动发布:打 tag(如 v0.1.0)后自动构建并上传(需在仓库 Secrets 中设置 PYPI_API_TOKEN)。

6) 许可

MIT License © Qilin Cao

Metadata

Release files for olca2tidas 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for olca2tidas 0.1.6
File Size Uploaded Provenance Actions
olca2tidas-0.1.6.tar.gz 14.9 kB Without provenance Details for olca2tidas-0.1.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for olca2tidas 0.1.6
File Interpreter ABI Platform Actions
olca2tidas-0.1.6-py3-none-any.whl Python 3 none any Details for olca2tidas-0.1.6-py3-none-any.whl

Total release size: 30.2 kB

Release files / olca2tidas-0.1.6.tar.gz

Download URL olca2tidas-0.1.6.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
466f201d3e940f8dbc709134951fa94e9646c7f89604ecacb228bdde0110f175
BLAKE2b-256 checksum
How to use checksums
c3473915c466f88e5d29332aaf48ac1f5d21cb175cee24df511fb4ba258fe244
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / olca2tidas-0.1.6-py3-none-any.whl

Download URL olca2tidas-0.1.6-py3-none-any.whl
Size 15.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7d719f6f679c4617d9817e5974e4f6fac5b78433152f61dc3e0bea15ab9f962
BLAKE2b-256 checksum
How to use checksums
f7adaf2ff89e12a84108ababc58622d6788de54fb0a0a4dc085302c53d9c2e57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Security for olca2tidas 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page