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.
Release files for tidas-sdk 0.2.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tidas_sdk-0.2.15.tar.gz | 404.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tidas_sdk-0.2.15-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 835.4 kB
Release files / tidas_sdk-0.2.15.tar.gz
| Download URL | tidas_sdk-0.2.15.tar.gz |
|---|---|
| Size | 404.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30e562be39b362444f50e4eddfa42e78a2bd9dbf015d727b8f27f50509790aca
|
|
BLAKE2b-256 checksum How to use checksums |
af4a75ac2e7a009c4f32cd41ee953a60bf146ad727838a11c14f1d9245b7ad07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.
Transparency logRelease files / tidas_sdk-0.2.15-py3-none-any.whl
| Download URL | tidas_sdk-0.2.15-py3-none-any.whl |
|---|---|
| Size | 431.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
30b5ea7653a0fa889f3db94b118e4c39f71f300ced361cfd1bcff1dd38819bf4
|
|
BLAKE2b-256 checksum How to use checksums |
c6dcacb29bc07d221996c77373971b5b1e914358cef580840ada1576908e8743
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.
Transparency log