Python SDK for TIDAS/ILCD Life Cycle Assessment data
Project description
TIDAS Python SDK
Type-safe Python SDK for working with ILCD/TIDAS life-cycle assessment (LCA) data. It provides generated Pydantic models plus higher-level helpers so you can read, manipulate, validate and export ILCD-compatible datasets from Python.
Installation
From PyPI
pip install tidas-sdk
From source (this repository)
cd sdks/python
uv sync --group dev
Quick Start
Run the end-to-end sample to see the core features in action:
uv run python examples/usage.py
Minimal usage example:
from tidas_sdk import create_process
process = create_process({})
process.process_data_set.process_information.data_set_information.name.base_name.set_text(
"Sample Process", lang="en"
)
print(process.to_json())
Basic Usage
Creating entities
from tidas_sdk import create_process, create_flow, create_source
process = create_process({})
flow = create_flow({})
source = create_source({})
You can also build entities directly from ILCD‑style JSON:
from pathlib import Path
from tidas_sdk import create_process_from_json
process = create_process_from_json(Path("process.json"))
Or start from ILCD XML when you already have the canonical .xml datasets:
from pathlib import Path
from tidas_sdk import create_process_from_xml, TidasProcess
process = create_process_from_xml(Path("process.xml"))
# or, if you prefer to work with the class directly
process = TidasProcess.from_xml(Path("process.xml"))
Working with multilingual fields
name_list = process.process_data_set.process_information.data_set_information.name.base_name
name_list.set_text("Sample Process", lang="en")
name_list.set_text("示例工艺", lang="zh")
print(name_list.get_text("en"))
Validation and export
is_valid = process.validate() # Pydantic (and optional JSON Schema) validation
json_payload = process.to_json() # ILCD‑compatible dict
xml_payload = process.to_xml() # ILCD XML string
Main Features
- JSON ➜ Object:
create_process()and other factory helpers build rich entity objects from complete or partial ILCD JSON. - Object ➜ JSON:
to_json()returns ILCD-compatible dictionaries suitable for storage or downstream tooling. - Multilingual fields:
MultiLangListwithset_text()/get_text()simplifies@xml:lang/#texthandling. - Strong typing: generated Pydantic models expose full type hints for IDE autocompletion and static checking.
- On-demand validation:
validate()runs Pydantic and optional JSON Schema validation when your dataset is ready. - XML export:
to_xml()converts entities into ILCD XML for interoperability with other LCA systems.
See examples/usage.py for a step‑by‑step walkthrough of these features.
Development Workflow (for contributors)
# Install / update dependencies
uv sync --group dev
# Linting & formatting
uv run ruff check src
uv run ruff format src
# Type checking
uv run mypy src
# Tests
uv run pytest
Project Layout
src/tidas_sdk: Core implementation and generated modelsexamples/usage.py: Feature walkthrough used in this READMEscripts/: Utility scripts for code generation and maintenance
For questions or contributions, open an issue or pull request at https://github.com/tiangong-lca/tidas-sdk.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tidas_sdk-0.2.6.tar.gz.
File metadata
- Download URL: tidas_sdk-0.2.6.tar.gz
- Upload date:
- Size: 394.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c99820d96e0c2f3f78557f15b3f747e87ba0408d09f2e8a2151daef405f5e08a
|
|
| MD5 |
6004b700292b8a9630ff8e06993e65ae
|
|
| BLAKE2b-256 |
a374d5e4b2d0c26a9bbfc5e828f94877efdd6b1917df703d654ef29a2723815b
|
Provenance
The following attestation bundles were made for tidas_sdk-0.2.6.tar.gz:
Publisher:
publish.yml on tiangong-lca/tidas-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tidas_sdk-0.2.6.tar.gz -
Subject digest:
c99820d96e0c2f3f78557f15b3f747e87ba0408d09f2e8a2151daef405f5e08a - Sigstore transparency entry: 1546817097
- Sigstore integration time:
-
Permalink:
tiangong-lca/tidas-sdk@b181394e66d1059a8b4af2d12cba92368650a1e1 -
Branch / Tag:
refs/tags/python-v0.2.6 - Owner: https://github.com/tiangong-lca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b181394e66d1059a8b4af2d12cba92368650a1e1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tidas_sdk-0.2.6-py3-none-any.whl.
File metadata
- Download URL: tidas_sdk-0.2.6-py3-none-any.whl
- Upload date:
- Size: 424.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71181e6f933bf17b9ba75435ac7edf2629e51ef67d2927f59147c34a716f178a
|
|
| MD5 |
313183c3e9b84f1bb3a73ab2b90ffb5e
|
|
| BLAKE2b-256 |
27a393a47a2dfdd5d4a4d43bbd40e17d0d135325330282e000d7d119e8a6dc4b
|
Provenance
The following attestation bundles were made for tidas_sdk-0.2.6-py3-none-any.whl:
Publisher:
publish.yml on tiangong-lca/tidas-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tidas_sdk-0.2.6-py3-none-any.whl -
Subject digest:
71181e6f933bf17b9ba75435ac7edf2629e51ef67d2927f59147c34a716f178a - Sigstore transparency entry: 1546817107
- Sigstore integration time:
-
Permalink:
tiangong-lca/tidas-sdk@b181394e66d1059a8b4af2d12cba92368650a1e1 -
Branch / Tag:
refs/tags/python-v0.2.6 - Owner: https://github.com/tiangong-lca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b181394e66d1059a8b4af2d12cba92368650a1e1 -
Trigger Event:
push
-
Statement type: