

of the fu # can be also defined by default openLCA will take the settings of the # reference flow of the product system setup. # amount is the amount of the functional unit (fu) of the system that # should be used in the calculation unit, flow property, etc. CONTRIBUTION_ANALYSIS # select the product system and LCIA method setup. # define the calculation type here # see setup. # create the calculation setup setup = olca. In the following example, a calculation setup with a product system and impactĪssessment method is created, calculated, and finally exported to Excel: OpenLCA provides different types of calculations which can be selected via the # save it in openLCA, you may have to refresh # (close & reopen the database to see the new flow) client. Every flow needs at # least one flow property factor for its reference # flow property. description = "Added from the olca-ipc python API." # in openLCA, conversion factors between different # properties/quantities of a flow are stored in # FlowPropertyFactor objects. # create a flow that has 'Mass' as reference flow property steel = olca. # find the flow property 'Mass' from the database mass = client. The following example shows how toĬreate a new flow and link it to an existing flow property with the name Mass: The olca.Client class provides methods like get, find, insert, (Note that we convert camelCase names like calculationType of attributes andįunctions to lower_case_names_with_underscores like calculation_type when You can create, updateĪnd link data models as defined in the openLCA schema (e.g.

With the type annotations you should get goodĮditor support (type checks and IntelliSense). The olca package contains a class model with type annotations for theįor exchanging data with openLCA.
How to use openlca code#
Without input checks, error handling, code structuring, and all the things you The followingĮxamples show some typical uses cases (note that these are just examples
How to use openlca install#
Use it, you can just install (and uninstall) it with pip:Īn instance of the olca.Client class is then a convenient entry point forĬalling functions of openLCA and processing their results. The current stable version of olca-ipc is available via the IPC server via instances of these classes. The openLCA data exchange format and an API for communicating with an openLCA The olca-ipc package provides a class based implementation of The openLCA IPC protocol is based on the openLCA data exchange format which is Python (Cpython v3.9+) so that it is possible to use openLCA as a data storageĪnd calculation engine and combine it with the libraries from the Python Package provides a convenience API for using this IPC protocol from standard In openLCA and processing their results outside of openLCA. With this, it is possible to call functions Pip install -U provides an implementation If you want to use the latest development version, just install Not all features and bug-fixes are currently available on the version
