semvec/pypi-packages huggingface dataset:
olca-ipc 2.4.0
A package for calling openLCA functions from Python.
Requires Python: >=3.11
Keywords: openLCA, life cycle assessment, LCA

# olca-ipc

`olca-ipc` is a Python package for inter-process communication (IPC) with
openLCA. With this, it is possible to call functions of openLCA and processing
their results in Python. It implements the unified IPC protocol of openLCA for
JSON-RPC and REST APIs. The documentation of these protocols and examples can be
found here:

__[https://greendelta.github.io/openLCA-ApiDoc](https://greendelta.github.io/openLCA-ApiDoc)__.

This package is available on [pypi.org](https://pypi.org/project/olca-ipc) and
can be installed / updated like this:

```bash
pip install -U olca-ipc
```

Note that this version only works with the openLCA >= 2.x and requires
**Python >= 3.11**. The last stable version for openLCA 1.x is
[0.0.12](https://pypi.org/project/olca-ipc/0.0.12/):

```bash
# for openLCA 1.x
pip install olca-ipc==0.0.12
```

The source code and API documentation of the version for openLCA 1.x is in the
`v1` branch of this repository. If you just want to read and write data for
openLCA 2, you can also just use the
[olca-schema package](https://pypi.org/project/olca-schema/), which is a
dependency of `olca-ipc`.
olca-schema 2.4.0
A package for reading and writing data sets in the openLCA schema format.
Requires Python: >=3.9
Keywords: openLCA, life cycle assessment, LCA

# olca-schema

This is a package for reading and writing data sets in the [openLCA
schema](https://github.com/GreenDelta/olca-schema) format version 2. It provides
a typed class model of the schema elements, methods for reading and writing them
in the JSON format, reading and writing data sets in zip packages, and some
utility methods.

## Usage

The package is published on [PyPI](https://pypi.org/project/olca-schema/) and
can be installed with `pip`:

```bash
pip install olca-schema
```

Here is a small example that creates a package that can be imported into
openLCA 2:

```python
import olca_schema as o
import olca_schema.zipio as zipio

# create a unit group and flow property
units = o.new_unit_group('Units of mass', 'kg')
kg = units.units[0]
mass = o.new_flow_property('Mass', units)

# create a product flow and a process with the product as output
steel = o.new_product('Steel', mass)
process = o.new_process('Steel production')
output = o.new_output(process, steel, 1, kg)
output.is_quantitative_reference = True

# prints the Json string of the process
print(process.to_json())

# write a zip package with the data sets
with zipio.ZipWriter('path/to/example.zip') as w:
    for entity in [units, mass, steel, process]:
        w.write(entity)
```