LCA as Code
A domain-specific language for life-cycle analysis experts.
https://github.com/kleis-technology/lcaac
Category: Industrial Ecology
Sub Category: Life Cycle Assessment
Keywords
domain-specific-language environmental-impact-assessment lifecycle-analysis sustainability
Keywords from Contributors
transforms archiving routes conversion observation measur profiles animals compose names
Last synced: about 4 hours ago
JSON representation
Repository metadata
LCA as Code - Domain-Specific Language for Life-Cycle Analysis
- Host: GitHub
- URL: https://github.com/kleis-technology/lcaac
- Owner: kleis-technology
- License: agpl-3.0
- Created: 2024-01-04T12:12:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-01T16:32:17.000Z (3 months ago)
- Last Synced: 2025-02-03T11:01:33.492Z (3 months ago)
- Topics: domain-specific-language, environmental-impact-assessment, lifecycle-analysis, sustainability
- Language: Kotlin
- Homepage: https://lca-as-code.com/book
- Size: 86.6 MB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 1
- Releases: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE-AGPL.txt
- Code of conduct: CODE_OF_CONDUCT.md
README.md
LCA as Code
This is the official repository of LCA as Code language.
What is LCA as Code?
LCA as Code is a domain-specific language (DSL) for life-cycle analysis experts.
Its declarative approach allows to define parametrized and reusable LCA models.
See our book to learn more about the language.
Table of Contents
Getting started
Install
From the source
git checkout v1.7.10
./gradlew :cli:installDist
alias lcaac=$GIT_ROOT/cli/build/install/lcaac/bin/lcaac
lcaac version
From Homebrew
brew tap kleis-technology/lcaac
brew install lcaac-cli
lcaac version
Impact assessment
Check the sample file in $GIT_ROOT/cli/samples/main.lca
.
process electricity_mix {
params {
from_fossil = 40 percent
from_nuclear = 20 percent
from_hydro = 40 percent
}
products {
1 kWh electricity
}
inputs {
from_fossil * 1 kWh electricity from fossil
from_nuclear * 1 kWh electricity from nuclear
from_hydro * 1 kWh electricity from hydro
}
}
// rest of the file omitted
Now you can assess the process electricity_mix
.
cd $GIT_ROOT/cli/samples
lcaac assess "electricity_mix"
The result is printed on the standard output in CSV format.
product,amount,reference unit,co2,co2_unit
electricity,1.0,kWh,5.4,kg
You can also run multiple assessments with an external data csv file providing values for the process parameters.
lcaac assess "electricity_mix" --file params.csv
Tests
The language allows to define tests as well. See the file $GIT_ROOT/cli/samples/test.lca
.
test should_pass {
given {
1 kWh electricity from electricity_mix
}
assert {
co2 between 0 kg and 10 kg
}
}
// rest of the file omitted
Run the tests using
lcaac test --show-success
What's inside
This repository contains the core libraries to handle LCAAC code.
core
Package The package core
contains:
- the language's abstract syntax tree (AST)
- the evaluator
- analysis programs, namely, contribution analysis, and local sensitivity analysis
grammar
Package The package grammar
contains:
- a concrete ANTLR-based grammar
- utilities to parse and load LCAAC files.
cli
Package The package cli
contains the code for the command-line interface.
Documentation
For users
For developers
- Core concepts [coming soon]
- Contribution guide [coming soon]
Related projects
Cloud Assess
Cloud Assess is an open-source tool
to automate the assessment of the environmental impacts of cloud services.
It aims at defining a trusted library of LCA models, written in the LCAAC language,
which can be easily consulted via a REST API.
LCA as Code IDE
An integrated-development environment (IDE) is available.
This editor provides facilities to develop and interact with LCAAC models. E.g.
- Automatic unit consistency check with syntax highlighting.
- Integrated analysis and visualization.
- Support for collaboration and code review.
License
This work is dual licensed:
- For commercial use: commercial license. Reach out to
[email protected]
for more information. - For non-commercial use: AGPL v3. See
LICENSE-AGPL.txt
.
About us
We are Kleis Technology.
Software craftsmen, thirsty for knowledge, with experience in complex subjects, we solve challenges in a pragmatic manner.
Backed by our core values of trust, commitment and continuous improvement, we love to make and create.
Owner metadata
- Name: Kleis Technology
- Login: kleis-technology
- Email:
- Kind: organization
- Description:
- Website: https://kleis.ch
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/69863653?v=4
- Repositories: 1
- Last ynced at: 2023-04-28T21:39:57.460Z
- Profile URL: https://github.com/kleis-technology
GitHub Events
Total
- Release event: 6
- Watch event: 3
- Delete event: 3
- Push event: 10
- Pull request event: 2
- Create event: 8
Last Year
- Release event: 6
- Watch event: 3
- Delete event: 3
- Push event: 10
- Pull request event: 2
- Create event: 8
Committers metadata
Last synced: 5 days ago
Total Commits: 1,144
Total Committers: 11
Avg Commits per committer: 104.0
Development Distribution Score (DDS): 0.326
Commits in past year: 110
Committers in past year: 1
Avg Commits per committer in past year: 110.0
Development Distribution Score (DDS) in past year: 0.0
Name | Commits | |
---|---|---|
Peva Blanchard | p****d@k****h | 771 |
Philippe Kernevez | p****e@k****t | 122 |
Joachim Desroches | j****s@k****h | 108 |
sebdebros | s****s@k****h | 57 |
Alban Seurat | a****t@m****m | 42 |
Joachim Desroches | jo@t****t | 34 |
florian-bellotti | f****i@v****r | 4 |
Peva Blanchard | p****d@g****m | 3 |
dependabot[bot] | 4****] | 1 |
Julien ruiz | j****z@k****h | 1 |
GitHub Action | a****n@g****m | 1 |
Committer domains:
- kleis.ch: 4
- github.com: 1
- viacesi.fr: 1
- thedesroches.net: 1
- me.com: 1
- kernevez.net: 1
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 1
Total pull requests: 41
Average time to close issues: N/A
Average time to close pull requests: about 6 hours
Total issue authors: 1
Total pull request authors: 1
Average comments per issue: 0.0
Average comments per pull request: 0.0
Merged pull request: 38
Bot issues: 0
Bot pull requests: 0
Past year issues: 1
Past year pull requests: 17
Past year average time to close issues: N/A
Past year average time to close pull requests: about 10 hours
Past year issue authors: 1
Past year pull request authors: 1
Past year average comments per issue: 0.0
Past year average comments per pull request: 0.0
Past year merged pull request: 15
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- pevab (1)
Top Pull Request Authors
- pevab (41)
Top Issue Labels
Top Pull Request Labels
Dependencies
- io.arrow-kt:arrow-core * implementation
- io.arrow-kt:arrow-optics * implementation
- org.apache.logging.log4j:log4j-api $log4jVersion implementation
- org.apache.logging.log4j:log4j-core $log4jVersion implementation
- org.apache.logging.log4j:log4j-slf4j-impl $log4jVersion implementation
- org.ejml:ejml-simple 0.43 implementation
- org.jetbrains.kotlin:kotlin-reflect * implementation
- org.jetbrains.kotlinx:kotlinx-serialization-json $kotlinxSerializationJSONVersion implementation
- org.jetbrains.kotlinx:multik-core 0.2.2 implementation
- org.jetbrains.kotlinx:multik-default 0.2.2 implementation
- io.mockk:mockk 1.13.4 testImplementation
- org.apache.logging.log4j:log4j-api $log4jVersion implementation
- org.apache.logging.log4j:log4j-core $log4jVersion implementation
- org.apache.logging.log4j:log4j-slf4j-impl $log4jVersion implementation
- io.mockk:mockk 1.13.4 testImplementation
Score: 4.882801922586371