olca-schema


Nameolca-schema JSON
Version 0.0.12 PyPI version JSON
download
home_page
SummaryA package for reading and writing data sets in the openLCA schema format.
upload_time2023-08-08 16:09:59
maintainer
docs_urlNone
author
requires_python>=3.9
license
keywords openlca life cycle assessment lca
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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)
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "olca-schema",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "openLCA,life cycle assessment,LCA",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/f7/a0/cdedd76453ca9f358dd588c7677ca271ddc6357409093ffd6f3ebf5cf827/olca_schema-0.0.12.tar.gz",
    "platform": null,
    "description": "# olca-schema\r\n\r\nThis is a package for reading and writing data sets in the [openLCA\r\nschema](https://github.com/GreenDelta/olca-schema) format version 2. It provides\r\na typed class model of the schema elements, methods for reading and writing them\r\nin the JSON format, reading and writing data sets in zip packages, and some\r\nutility methods.\r\n\r\n## Usage\r\n\r\nThe package is published on [PyPI](https://pypi.org/project/olca-schema/) and\r\ncan be installed with `pip`:\r\n\r\n```bash\r\npip install olca-schema\r\n```\r\n\r\nHere is a small example that creates a package that can be imported into\r\nopenLCA 2:\r\n\r\n```python\r\nimport olca_schema as o\r\nimport olca_schema.zipio as zipio\r\n\r\n# create a unit group and flow property\r\nunits = o.new_unit_group('Units of mass', 'kg')\r\nkg = units.units[0]\r\nmass = o.new_flow_property('Mass', units)\r\n\r\n# create a product flow and a process with the product as output\r\nsteel = o.new_product('Steel', mass)\r\nprocess = o.new_process('Steel production')\r\noutput = o.new_output(process, steel, 1, kg)\r\noutput.is_quantitative_reference = True\r\n\r\n# prints the Json string of the process\r\nprint(process.to_json())\r\n\r\n# write a zip package with the data sets\r\nwith zipio.ZipWriter('path/to/example.zip') as w:\r\n    for entity in [units, mass, steel, process]:\r\n        w.write(entity)\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A package for reading and writing data sets in the openLCA schema format.",
    "version": "0.0.12",
    "project_urls": {
        "Bug Tracker": "https://github.com/GreenDelta/olca-schema/issues",
        "Homepage": "https://github.com/GreenDelta/olca-schema"
    },
    "split_keywords": [
        "openlca",
        "life cycle assessment",
        "lca"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "90e601a7158dd44e0df8c304910608d0fd079cc753113adcc61a3935c83ca35a",
                "md5": "883ea865ce15a0684ac9c36492bf2655",
                "sha256": "e045fe4fa1bfa54a554db111471274c6e014fe0cd70f0983e360175f2f32ef5c"
            },
            "downloads": -1,
            "filename": "olca_schema-0.0.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "883ea865ce15a0684ac9c36492bf2655",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 27316,
            "upload_time": "2023-08-08T16:09:58",
            "upload_time_iso_8601": "2023-08-08T16:09:58.147379Z",
            "url": "https://files.pythonhosted.org/packages/90/e6/01a7158dd44e0df8c304910608d0fd079cc753113adcc61a3935c83ca35a/olca_schema-0.0.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f7a0cdedd76453ca9f358dd588c7677ca271ddc6357409093ffd6f3ebf5cf827",
                "md5": "7ae6a2c97fa1e653d4bc5744d4eff889",
                "sha256": "6b08991489f199c17fd68a10831c026e4ceff4c85a2837a200ecac24e6ec834e"
            },
            "downloads": -1,
            "filename": "olca_schema-0.0.12.tar.gz",
            "has_sig": false,
            "md5_digest": "7ae6a2c97fa1e653d4bc5744d4eff889",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 31470,
            "upload_time": "2023-08-08T16:09:59",
            "upload_time_iso_8601": "2023-08-08T16:09:59.822697Z",
            "url": "https://files.pythonhosted.org/packages/f7/a0/cdedd76453ca9f358dd588c7677ca271ddc6357409093ffd6f3ebf5cf827/olca_schema-0.0.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-08 16:09:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "GreenDelta",
    "github_project": "olca-schema",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "olca-schema"
}
        
Elapsed time: 0.13797s