basyx-python-sdk


Namebasyx-python-sdk JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
SummaryThe Eclipse BaSyx Python SDK, an implementation of the Asset Administration Shell for Industry 4.0 systems
upload_time2024-12-11 08:37:16
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Eclipse BaSyx Python SDK

(formerly known as PyI40AAS – Python Industry 4.0 Asset Administration Shell)

The Eclipse BaSyx Python project focuses on providing a Python implementation of the Asset Administration Shell (AAS) 
for Industry 4.0 Systems.

## Features

* Modelling of AASs as Python objects
    * **except for**: *HasDataSpecification*
* Reading and writing of AASX package files
* (De-)serialization of AAS objects into/from JSON and XML
* Storing of AAS objects in CouchDB, Backend infrastructure for easy expansion 
* Compliance checking of AAS XML and JSON files


### Project Structure

The BaSyx Python SDK project provides the `basax.aas` Python package with 6 submodules:

* `basyx.aas.model`: The AAS metamodel implemented in python
* `basyx.aas.adapter`: Adapters for various file formats 
* `basyx.aas.backend`: Backend infrastructure for storing and retrieving AAS objects
* `basyx.aas.util`: Provides utilities
* `basyx.aas.examples`: Example data and tutorials


## License

The BaSyx Python SDK project is licensed under the terms of the MIT License.

SPDX-License-Identifier: MIT

For more information, especially considering the licenses of included third-party works, please consult the `NOTICE`
file.

## Dependencies

The BaSyx Python SDK requires the following Python packages to be installed for production usage. These dependencies are listed in
`setup.py` to be fetched automatically when installing with `pip`:
* `lxml` (BSD 3-clause License, using `libxml2` under MIT License)
* `python-dateutil` (BSD 3-clause License)
* `pyecma376-2` (Apache License v2.0)
* `urllib3` (MIT License)
* `Werkzeug` (BSD 3-clause License)

Optional production usage dependencies:
* For using the Compliance Tool to validate JSON files against the JSON Schema: `jsonschema` and its
dependencies (MIT License, Apache License, PSF License)

Development/testing/documentation/example dependencies (see `requirements.txt`):
* `jsonschema` and its dependencies (MIT License, Apache License, PSF License)

Dependencies for building the documentation (see `docs/add-requirements.txt`):
* `Sphinx` and its dependencies (BSD 2-clause License, MIT License, Apache License)
* `sphinx-rtd-theme` and its dependencies (MIT License, PSF License)
* `sphinx-argparse` (MIT License)


## Getting Started

### Installation

Eclipse BaSyx Python SDK can be installed from PyPI, the Python Package Index, just as nearly every other Python package:
```bash
pip install basyx-python-sdk
``` 

For working with the current development version, you can also install the package directly from GitHub, using Pip's Git feature:
```bash
pip install --no-cache-dir git+https://github.com/eclipse-basyx/basyx-python-sdk@main#subdirectory=sdk
```

You may want to use a Python's `venv` or a similar tool to install BaSyx Python SDK and its dependencies only in a project-specific local environment. 


### Example

The following code example shows how to create a `Submodel` with a `Property` serialize it into an XML file using the
Eclipse BaSyx Python SDK:

Create a `Submodel`:
```python
from basyx.aas import model  # Import all BaSyx Python SDK classes from the model package

identifier = 'https://acplt.org/Simple_Submodel'
submodel = model.Submodel(identifier)
```

Create a `Property` and add it to the `Submodel`:
```python
# create an external reference to a semantic description of the property
semantic_reference = model.ExternalReference(
    (model.Key(
        type_=model.KeyTypes.GLOBAL_REFERENCE,
        value='http://acplt.org/Properties/SimpleProperty'
    ),)
)
property = model.Property(
    id_short='ExampleProperty',  # Identifying string of the element within the submodel namespace
    value_type=model.datatypes.String,  # Data type of the value
    value='exampleValue',  # Value of the property
    semantic_id=semantic_reference  # set the semantic reference
)
submodel.submodel_element.add(property)
```

Serialize the `Submodel` to XML:
```python
from basyx.aas.adapter.xml import write_aas_xml_file

data: model.DictObjectStore[model.Identifiable] = model.DictObjectStore()
data.add(submodel)
write_aas_xml_file(file='Simple_Submodel.xml', data=data)
```


### Examples and Tutorials

For further examples and tutorials, check out the `basyx.aas.examples`-package. Here is a quick overview:

* [`tutorial_create_simple_aas`](./basyx/aas/examples/tutorial_create_simple_aas.py): Create an Asset Administration Shell, including an Asset object and a Submodel
* [`tutorial_storage`](./basyx/aas/examples/tutorial_storage.py): Manage a larger number of Asset Administration Shells in an ObjectStore and resolve references
* [`tutorial_serialization_deserialization`](./basyx/aas/examples/tutorial_serialization_deserialization.py): Use the JSON and XML serialization/deserialization for single objects or full standard-compliant files
* [`tutorial_aasx`](./basyx/aas/examples/tutorial_aasx.py): Export Asset Administration Shells with related objects and auxiliary files to AASX package files
* [`tutorial_backend_couchdb`](./basyx/aas/examples/tutorial_backend_couchdb.py): Use the *Backends* interface (`update()/commit()` methods) to manage and retrieve AAS objects in a CouchDB document database


### Documentation

A detailed, complete API documentation is available on Read the Docs: https://basyx-python-sdk.readthedocs.io

### Compliance Tool

The compliance tool functionality moved to [github.com/rwth-iat/aas-compliance-tool](https://github.com/rwth-iat/aas-compliance-tool).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "basyx-python-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "The Eclipse BaSyx Authors <admins@iat.rwth-aachen.de>",
    "download_url": "https://files.pythonhosted.org/packages/2b/f9/4b5a887994da6c725236fb6c8212f453109a658f9a57c58002d116f4c19e/basyx_python_sdk-1.1.0.tar.gz",
    "platform": null,
    "description": "# Eclipse BaSyx Python SDK\n\n(formerly known as PyI40AAS \u2013 Python Industry 4.0 Asset Administration Shell)\n\nThe Eclipse BaSyx Python project focuses on providing a Python implementation of the Asset Administration Shell (AAS) \nfor Industry 4.0 Systems.\n\n## Features\n\n* Modelling of AASs as Python objects\n    * **except for**: *HasDataSpecification*\n* Reading and writing of AASX package files\n* (De-)serialization of AAS objects into/from JSON and XML\n* Storing of AAS objects in CouchDB, Backend infrastructure for easy expansion \n* Compliance checking of AAS XML and JSON files\n\n\n### Project Structure\n\nThe BaSyx Python SDK project provides the `basax.aas` Python package with 6 submodules:\n\n* `basyx.aas.model`: The AAS metamodel implemented in python\n* `basyx.aas.adapter`: Adapters for various file formats \n* `basyx.aas.backend`: Backend infrastructure for storing and retrieving AAS objects\n* `basyx.aas.util`: Provides utilities\n* `basyx.aas.examples`: Example data and tutorials\n\n\n## License\n\nThe BaSyx Python SDK project is licensed under the terms of the MIT License.\n\nSPDX-License-Identifier: MIT\n\nFor more information, especially considering the licenses of included third-party works, please consult the `NOTICE`\nfile.\n\n## Dependencies\n\nThe BaSyx Python SDK requires the following Python packages to be installed for production usage. These dependencies are listed in\n`setup.py` to be fetched automatically when installing with `pip`:\n* `lxml` (BSD 3-clause License, using `libxml2` under MIT License)\n* `python-dateutil` (BSD 3-clause License)\n* `pyecma376-2` (Apache License v2.0)\n* `urllib3` (MIT License)\n* `Werkzeug` (BSD 3-clause License)\n\nOptional production usage dependencies:\n* For using the Compliance Tool to validate JSON files against the JSON Schema: `jsonschema` and its\ndependencies (MIT License, Apache License, PSF License)\n\nDevelopment/testing/documentation/example dependencies (see `requirements.txt`):\n* `jsonschema` and its dependencies (MIT License, Apache License, PSF License)\n\nDependencies for building the documentation (see `docs/add-requirements.txt`):\n* `Sphinx` and its dependencies (BSD 2-clause License, MIT License, Apache License)\n* `sphinx-rtd-theme` and its dependencies (MIT License, PSF License)\n* `sphinx-argparse` (MIT License)\n\n\n## Getting Started\n\n### Installation\n\nEclipse BaSyx Python SDK can be installed from PyPI, the Python Package Index, just as nearly every other Python package:\n```bash\npip install basyx-python-sdk\n``` \n\nFor working with the current development version, you can also install the package directly from GitHub, using Pip's Git feature:\n```bash\npip install --no-cache-dir git+https://github.com/eclipse-basyx/basyx-python-sdk@main#subdirectory=sdk\n```\n\nYou may want to use a Python's `venv` or a similar tool to install BaSyx Python SDK and its dependencies only in a project-specific local environment. \n\n\n### Example\n\nThe following code example shows how to create a `Submodel` with a `Property` serialize it into an XML file using the\nEclipse BaSyx Python SDK:\n\nCreate a `Submodel`:\n```python\nfrom basyx.aas import model  # Import all BaSyx Python SDK classes from the model package\n\nidentifier = 'https://acplt.org/Simple_Submodel'\nsubmodel = model.Submodel(identifier)\n```\n\nCreate a `Property` and add it to the `Submodel`:\n```python\n# create an external reference to a semantic description of the property\nsemantic_reference = model.ExternalReference(\n    (model.Key(\n        type_=model.KeyTypes.GLOBAL_REFERENCE,\n        value='http://acplt.org/Properties/SimpleProperty'\n    ),)\n)\nproperty = model.Property(\n    id_short='ExampleProperty',  # Identifying string of the element within the submodel namespace\n    value_type=model.datatypes.String,  # Data type of the value\n    value='exampleValue',  # Value of the property\n    semantic_id=semantic_reference  # set the semantic reference\n)\nsubmodel.submodel_element.add(property)\n```\n\nSerialize the `Submodel` to XML:\n```python\nfrom basyx.aas.adapter.xml import write_aas_xml_file\n\ndata: model.DictObjectStore[model.Identifiable] = model.DictObjectStore()\ndata.add(submodel)\nwrite_aas_xml_file(file='Simple_Submodel.xml', data=data)\n```\n\n\n### Examples and Tutorials\n\nFor further examples and tutorials, check out the `basyx.aas.examples`-package. Here is a quick overview:\n\n* [`tutorial_create_simple_aas`](./basyx/aas/examples/tutorial_create_simple_aas.py): Create an Asset Administration Shell, including an Asset object and a Submodel\n* [`tutorial_storage`](./basyx/aas/examples/tutorial_storage.py): Manage a larger number of Asset Administration Shells in an ObjectStore and resolve references\n* [`tutorial_serialization_deserialization`](./basyx/aas/examples/tutorial_serialization_deserialization.py): Use the JSON and XML serialization/deserialization for single objects or full standard-compliant files\n* [`tutorial_aasx`](./basyx/aas/examples/tutorial_aasx.py): Export Asset Administration Shells with related objects and auxiliary files to AASX package files\n* [`tutorial_backend_couchdb`](./basyx/aas/examples/tutorial_backend_couchdb.py): Use the *Backends* interface (`update()/commit()` methods) to manage and retrieve AAS objects in a CouchDB document database\n\n\n### Documentation\n\nA detailed, complete API documentation is available on Read the Docs: https://basyx-python-sdk.readthedocs.io\n\n### Compliance Tool\n\nThe compliance tool functionality moved to [github.com/rwth-iat/aas-compliance-tool](https://github.com/rwth-iat/aas-compliance-tool).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "The Eclipse BaSyx Python SDK, an implementation of the Asset Administration Shell for Industry 4.0 systems",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/eclipse-basyx/basyx-python-sdk"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ba5f8aca5aa5770bc11494692eec0868ef83da6d8c932517efc2965161720ab8",
                "md5": "74e663562e3c79dcd78e539087492812",
                "sha256": "d9c689f52fd60a4df9523726980b2f5fddd43afdefe5239f1b5c77672d237b1b"
            },
            "downloads": -1,
            "filename": "basyx_python_sdk-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "74e663562e3c79dcd78e539087492812",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 174921,
            "upload_time": "2024-12-11T08:37:14",
            "upload_time_iso_8601": "2024-12-11T08:37:14.523481Z",
            "url": "https://files.pythonhosted.org/packages/ba/5f/8aca5aa5770bc11494692eec0868ef83da6d8c932517efc2965161720ab8/basyx_python_sdk-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2bf94b5a887994da6c725236fb6c8212f453109a658f9a57c58002d116f4c19e",
                "md5": "5f0c947ad7ce2833915ca510590ecd14",
                "sha256": "6f4ce08b673a812a2a330823eaf8cad8ba98e0762b190894597912b400f4229b"
            },
            "downloads": -1,
            "filename": "basyx_python_sdk-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5f0c947ad7ce2833915ca510590ecd14",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 224084,
            "upload_time": "2024-12-11T08:37:16",
            "upload_time_iso_8601": "2024-12-11T08:37:16.983646Z",
            "url": "https://files.pythonhosted.org/packages/2b/f9/4b5a887994da6c725236fb6c8212f453109a658f9a57c58002d116f4c19e/basyx_python_sdk-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-11 08:37:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eclipse-basyx",
    "github_project": "basyx-python-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "basyx-python-sdk"
}
        
Elapsed time: 0.88457s