OpenSMI-Server 0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. opensmi_server-0.1/.github/workflows/python-publish.yml +70 -0
  2. opensmi_server-0.1/.gitignore +18 -0
  3. opensmi_server-0.1/LICENSE +18 -0
  4. opensmi_server-0.1/LICENSES/CC0-1.0.txt +121 -0
  5. opensmi_server-0.1/LICENSES/MIT.txt +18 -0
  6. opensmi_server-0.1/MANIFEST.in +2 -0
  7. opensmi_server-0.1/PKG-INFO +239 -0
  8. opensmi_server-0.1/README.md +200 -0
  9. opensmi_server-0.1/docs/development.md +65 -0
  10. opensmi_server-0.1/docs/faq.md +26 -0
  11. opensmi_server-0.1/docs/machinery_item.md +62 -0
  12. opensmi_server-0.1/docs/methods.md +38 -0
  13. opensmi_server-0.1/docs/migration.md +308 -0
  14. opensmi_server-0.1/docs/skills.md +161 -0
  15. opensmi_server-0.1/examples/dummy/__init__.py +3 -0
  16. opensmi_server-0.1/examples/dummy/composite_skill.py +82 -0
  17. opensmi_server-0.1/examples/dummy/config.toml +89 -0
  18. opensmi_server-0.1/examples/dummy/continuous_skill.py +85 -0
  19. opensmi_server-0.1/examples/dummy/continuous_skill_self_halting.py +66 -0
  20. opensmi_server-0.1/examples/dummy/dummy_component.py +95 -0
  21. opensmi_server-0.1/examples/dummy/dummy_machine.py +98 -0
  22. opensmi_server-0.1/examples/dummy/dummy_method.py +53 -0
  23. opensmi_server-0.1/examples/dummy/dummy_skill.py +82 -0
  24. opensmi_server-0.1/examples/dummy/dummy_skill_resources.py +60 -0
  25. opensmi_server-0.1/examples/dummy/dummy_skill_simple.py +51 -0
  26. opensmi_server-0.1/examples/dummy/main.py +19 -0
  27. opensmi_server-0.1/examples/dummy/resources.py +21 -0
  28. opensmi_server-0.1/examples/dummy/startup_skill.py +14 -0
  29. opensmi_server-0.1/examples/dummy/suspendable_dummy_skill.py +72 -0
  30. opensmi_server-0.1/examples/quick_start/main.py +69 -0
  31. opensmi_server-0.1/pyproject.toml +186 -0
  32. opensmi_server-0.1/setup.cfg +4 -0
  33. opensmi_server-0.1/src/OpenSMI_Server.egg-info/PKG-INFO +239 -0
  34. opensmi_server-0.1/src/OpenSMI_Server.egg-info/SOURCES.txt +85 -0
  35. opensmi_server-0.1/src/OpenSMI_Server.egg-info/dependency_links.txt +1 -0
  36. opensmi_server-0.1/src/OpenSMI_Server.egg-info/requires.txt +14 -0
  37. opensmi_server-0.1/src/OpenSMI_Server.egg-info/scm_file_list.json +85 -0
  38. opensmi_server-0.1/src/OpenSMI_Server.egg-info/scm_version.json +8 -0
  39. opensmi_server-0.1/src/OpenSMI_Server.egg-info/top_level.txt +1 -0
  40. opensmi_server-0.1/src/opensmi/server/__init__.py +45 -0
  41. opensmi_server-0.1/src/opensmi/server/_server.py +454 -0
  42. opensmi_server-0.1/src/opensmi/server/access_control.py +257 -0
  43. opensmi_server-0.1/src/opensmi/server/base_callable.py +137 -0
  44. opensmi_server-0.1/src/opensmi/server/base_feasibility_check.py +18 -0
  45. opensmi_server-0.1/src/opensmi/server/base_machine.py +90 -0
  46. opensmi_server-0.1/src/opensmi/server/base_machinery_item.py +447 -0
  47. opensmi_server-0.1/src/opensmi/server/base_method.py +57 -0
  48. opensmi_server-0.1/src/opensmi/server/base_precondition_check.py +20 -0
  49. opensmi_server-0.1/src/opensmi/server/base_skill.py +299 -0
  50. opensmi_server-0.1/src/opensmi/server/base_startup_skill.py +111 -0
  51. opensmi_server-0.1/src/opensmi/server/common.py +93 -0
  52. opensmi_server-0.1/src/opensmi/server/config.py +124 -0
  53. opensmi_server-0.1/src/opensmi/server/interfaces.py +280 -0
  54. opensmi_server-0.1/src/opensmi/server/lock.py +347 -0
  55. opensmi_server-0.1/src/opensmi/server/mixins/__init__.py +22 -0
  56. opensmi_server-0.1/src/opensmi/server/mixins/lockable_mixin.py +37 -0
  57. opensmi_server-0.1/src/opensmi/server/mixins/notification_mixins.py +78 -0
  58. opensmi_server-0.1/src/opensmi/server/mixins/parent_mixin.py +79 -0
  59. opensmi_server-0.1/src/opensmi/server/mixins/requirements_mixin.py +77 -0
  60. opensmi_server-0.1/src/opensmi/server/mixins/skill_logic_mixins.py +470 -0
  61. opensmi_server-0.1/src/opensmi/server/mixins/spatial_object_mixin.py +88 -0
  62. opensmi_server-0.1/src/opensmi/server/mixins/ua_object_container_mixins.py +131 -0
  63. opensmi_server-0.1/src/opensmi/server/mixins/ua_variable_container_mixins.py +294 -0
  64. opensmi_server-0.1/src/opensmi/server/nodesets/Opc.Ua.Di.NodeSet2.xml +5719 -0
  65. opensmi_server-0.1/src/opensmi/server/nodesets/Opc.Ua.Machinery.NodeSet2.xml +1713 -0
  66. opensmi_server-0.1/src/opensmi/server/nodesets/Opc.Ua.RSL.NodeSet2.xml +601 -0
  67. opensmi_server-0.1/src/opensmi/server/nodesets/Opc.Ua.SmartFactory.MachineSet.NodeSet2.xml +2886 -0
  68. opensmi_server-0.1/src/opensmi/server/nodesets/Opc.Ua.SmartFactory.SkillSet.NodeSet2.xml +856 -0
  69. opensmi_server-0.1/src/opensmi/server/nodesets/__init__.py +26 -0
  70. opensmi_server-0.1/src/opensmi/server/nodesets/di.py +74 -0
  71. opensmi_server-0.1/src/opensmi/server/nodesets/machinery.py +36 -0
  72. opensmi_server-0.1/src/opensmi/server/nodesets/rsl.py +31 -0
  73. opensmi_server-0.1/src/opensmi/server/nodesets/smart_factory_machine_set.py +52 -0
  74. opensmi_server-0.1/src/opensmi/server/nodesets/smart_factory_skill_set.py +32 -0
  75. opensmi_server-0.1/src/opensmi/server/notification.py +112 -0
  76. opensmi_server-0.1/src/opensmi/server/protocols.py +165 -0
  77. opensmi_server-0.1/src/opensmi/server/resource.py +104 -0
  78. opensmi_server-0.1/src/opensmi/server/spatial_object.py +328 -0
  79. opensmi_server-0.1/src/opensmi/server/ua_fsm.py +261 -0
  80. opensmi_server-0.1/src/opensmi/server/ua_object.py +212 -0
  81. opensmi_server-0.1/src/opensmi/server/ua_object_containers.py +181 -0
  82. opensmi_server-0.1/src/opensmi/server/ua_variable.py +450 -0
  83. opensmi_server-0.1/src/opensmi/server/ua_variable_containers.py +331 -0
  84. opensmi_server-0.1/src/opensmi/server/user.py +154 -0
  85. opensmi_server-0.1/tools/auto_generate_nodesets.py +205 -0
  86. opensmi_server-0.1/tools/create_password.py +32 -0
  87. opensmi_server-0.1/tools/nodeset.py.template +27 -0
@@ -0,0 +1,70 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ release-build:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.11"
28
+
29
+ - name: Build release distributions
30
+ run: |
31
+ # NOTE: put your own distribution build steps here.
32
+ python -m pip install build
33
+ python -m build
34
+
35
+ - name: Upload distributions
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: release-dists
39
+ path: dist/
40
+
41
+ pypi-publish:
42
+ runs-on: ubuntu-latest
43
+ needs:
44
+ - release-build
45
+ permissions:
46
+ # IMPORTANT: this permission is mandatory for trusted publishing
47
+ id-token: write
48
+
49
+ # Dedicated environments with protections for publishing are strongly recommended.
50
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
+ environment:
52
+ name: pypi
53
+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
+ # url: https://pypi.org/p/YOURPROJECT
55
+ #
56
+ # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
+ # ALTERNATIVE: exactly, uncomment the following line instead:
58
+ # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
59
+
60
+ steps:
61
+ - name: Retrieve release distributions
62
+ uses: actions/download-artifact@v4
63
+ with:
64
+ name: release-dists
65
+ path: dist/
66
+
67
+ - name: Publish release distributions to PyPI
68
+ uses: pypa/gh-action-pypi-publish@release/v1
69
+ with:
70
+ packages-dir: dist/
@@ -0,0 +1,18 @@
1
+ *.pyc
2
+ /.idea
3
+ /.vs
4
+ /.vscode
5
+ *.egg-info
6
+ /dist
7
+ *.log
8
+ /build
9
+ /tools/UNECE_to_OPCUA.csv
10
+ /.venv/
11
+ /uv.lock
12
+ /*.xml
13
+ /*.html
14
+ *.coverage
15
+ /apidocs
16
+ *.der
17
+ *.pem
18
+ *.sql
@@ -0,0 +1,18 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OpenSMI Contributors.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6
+ associated documentation files (the "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial
12
+ portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
16
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,121 @@
1
+ Creative Commons Legal Code
2
+
3
+ CC0 1.0 Universal
4
+
5
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12
+ HEREUNDER.
13
+
14
+ Statement of Purpose
15
+
16
+ The laws of most jurisdictions throughout the world automatically confer
17
+ exclusive Copyright and Related Rights (defined below) upon the creator
18
+ and subsequent owner(s) (each and all, an "owner") of an original work of
19
+ authorship and/or a database (each, a "Work").
20
+
21
+ Certain owners wish to permanently relinquish those rights to a Work for
22
+ the purpose of contributing to a commons of creative, cultural and
23
+ scientific works ("Commons") that the public can reliably and without fear
24
+ of later claims of infringement build upon, modify, incorporate in other
25
+ works, reuse and redistribute as freely as possible in any form whatsoever
26
+ and for any purposes, including without limitation commercial purposes.
27
+ These owners may contribute to the Commons to promote the ideal of a free
28
+ culture and the further production of creative, cultural and scientific
29
+ works, or to gain reputation or greater distribution for their Work in
30
+ part through the use and efforts of others.
31
+
32
+ For these and/or other purposes and motivations, and without any
33
+ expectation of additional consideration or compensation, the person
34
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35
+ is an owner of Copyright and Related Rights in the Work, voluntarily
36
+ elects to apply CC0 to the Work and publicly distribute the Work under its
37
+ terms, with knowledge of his or her Copyright and Related Rights in the
38
+ Work and the meaning and intended legal effect of CC0 on those rights.
39
+
40
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
41
+ protected by copyright and related or neighboring rights ("Copyright and
42
+ Related Rights"). Copyright and Related Rights include, but are not
43
+ limited to, the following:
44
+
45
+ i. the right to reproduce, adapt, distribute, perform, display,
46
+ communicate, and translate a Work;
47
+ ii. moral rights retained by the original author(s) and/or performer(s);
48
+ iii. publicity and privacy rights pertaining to a person's image or
49
+ likeness depicted in a Work;
50
+ iv. rights protecting against unfair competition in regards to a Work,
51
+ subject to the limitations in paragraph 4(a), below;
52
+ v. rights protecting the extraction, dissemination, use and reuse of data
53
+ in a Work;
54
+ vi. database rights (such as those arising under Directive 96/9/EC of the
55
+ European Parliament and of the Council of 11 March 1996 on the legal
56
+ protection of databases, and under any national implementation
57
+ thereof, including any amended or successor version of such
58
+ directive); and
59
+ vii. other similar, equivalent or corresponding rights throughout the
60
+ world based on applicable law or treaty, and any national
61
+ implementations thereof.
62
+
63
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
64
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
65
+ irrevocably and unconditionally waives, abandons, and surrenders all of
66
+ Affirmer's Copyright and Related Rights and associated claims and causes
67
+ of action, whether now known or unknown (including existing as well as
68
+ future claims and causes of action), in the Work (i) in all territories
69
+ worldwide, (ii) for the maximum duration provided by applicable law or
70
+ treaty (including future time extensions), (iii) in any current or future
71
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
72
+ including without limitation commercial, advertising or promotional
73
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74
+ member of the public at large and to the detriment of Affirmer's heirs and
75
+ successors, fully intending that such Waiver shall not be subject to
76
+ revocation, rescission, cancellation, termination, or any other legal or
77
+ equitable action to disrupt the quiet enjoyment of the Work by the public
78
+ as contemplated by Affirmer's express Statement of Purpose.
79
+
80
+ 3. Public License Fallback. Should any part of the Waiver for any reason
81
+ be judged legally invalid or ineffective under applicable law, then the
82
+ Waiver shall be preserved to the maximum extent permitted taking into
83
+ account Affirmer's express Statement of Purpose. In addition, to the
84
+ extent the Waiver is so judged Affirmer hereby grants to each affected
85
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
86
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
87
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
88
+ maximum duration provided by applicable law or treaty (including future
89
+ time extensions), (iii) in any current or future medium and for any number
90
+ of copies, and (iv) for any purpose whatsoever, including without
91
+ limitation commercial, advertising or promotional purposes (the
92
+ "License"). The License shall be deemed effective as of the date CC0 was
93
+ applied by Affirmer to the Work. Should any part of the License for any
94
+ reason be judged legally invalid or ineffective under applicable law, such
95
+ partial invalidity or ineffectiveness shall not invalidate the remainder
96
+ of the License, and in such case Affirmer hereby affirms that he or she
97
+ will not (i) exercise any of his or her remaining Copyright and Related
98
+ Rights in the Work or (ii) assert any associated claims and causes of
99
+ action with respect to the Work, in either case contrary to Affirmer's
100
+ express Statement of Purpose.
101
+
102
+ 4. Limitations and Disclaimers.
103
+
104
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
105
+ surrendered, licensed or otherwise affected by this document.
106
+ b. Affirmer offers the Work as-is and makes no representations or
107
+ warranties of any kind concerning the Work, express, implied,
108
+ statutory or otherwise, including without limitation warranties of
109
+ title, merchantability, fitness for a particular purpose, non
110
+ infringement, or the absence of latent or other defects, accuracy, or
111
+ the present or absence of errors, whether or not discoverable, all to
112
+ the greatest extent permissible under applicable law.
113
+ c. Affirmer disclaims responsibility for clearing rights of other persons
114
+ that may apply to the Work or any use thereof, including without
115
+ limitation any person's Copyright and Related Rights in the Work.
116
+ Further, Affirmer disclaims responsibility for obtaining any necessary
117
+ consents, permissions or other rights required for any use of the
118
+ Work.
119
+ d. Affirmer understands and acknowledges that Creative Commons is not a
120
+ party to this document and has no duty or obligation with respect to
121
+ this CC0 or use of the Work.
@@ -0,0 +1,18 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OpenSMI Contributors.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6
+ associated documentation files (the "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial
12
+ portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
16
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18
+ USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,2 @@
1
+ recursive-include pyuaadapter *.py *.xml *.avsc *.pickle
2
+ recursive-exclude tests *
@@ -0,0 +1,239 @@
1
+ Metadata-Version: 2.4
2
+ Name: OpenSMI-Server
3
+ Version: 0.1
4
+ Summary: Asynchronous Python framework for building Smart Machine Interface-compliant OPC UA servers.
5
+ Author-email: Carsten Harms <Carsten.Harms@dfki.de>, Simon Jungbluth <Simon.Jungbluth@smartfactory.de>
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/SmartFactory-KL/opensmi-server
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Framework :: AsyncIO
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Information Technology
12
+ Classifier: Intended Audience :: Manufacturing
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Communications
20
+ Classifier: Topic :: Scientific/Engineering
21
+ Classifier: Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator
22
+ Classifier: Topic :: Software Development :: Embedded Systems
23
+ Classifier: Topic :: Software Development :: Libraries
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.11
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSES/MIT.txt
28
+ Requires-Dist: OpenSMI-Core>=0.1
29
+ Requires-Dist: asyncua<3,>=2.0.1
30
+ Requires-Dist: transitions<1,>=0.9
31
+ Requires-Dist: structlog>=26
32
+ Requires-Dist: typing-extensions>=4.16.0
33
+ Provides-Extra: rich
34
+ Requires-Dist: rich>=15.0.0; extra == "rich"
35
+ Requires-Dist: colorama>=0.4; sys_platform == "win32" and extra == "rich"
36
+ Provides-Extra: json
37
+ Requires-Dist: orjson<4,>=3; extra == "json"
38
+ Dynamic: license-file
39
+
40
+ # OpenSMI Server
41
+
42
+ **Open Smart Machine Interface (SMI)** provides an abstract, standardized, vendor-neutral way to interact safely
43
+ with real (or simulated) machines. **OpenSMI** is an asynchronous Python framework, built on top of
44
+ [asyncua](https://github.com/FreeOpcUa/opcua-asyncio) for building SMI-compliant OPC UA servers.
45
+
46
+ It gives you the building blocks for exposing manufacturing capabilities — axes, grippers, robots, conveyors, whole
47
+ machines — over a standardized, hierarchical OPC UA information model, without having to hand-roll everything yourself.
48
+
49
+ ## Why OpenSMI
50
+
51
+ A common real-world use case is as an **adapter in front of a Programmable Logic Controller (PLC)**: many PLCs can speak
52
+ OPC UA but don't natively expose SMI's richer skill model — suspendable/resumable skills, composite orchestration,
53
+ feasibility/precondition checks, standardized locking. OpenSMI lets you sit in front of such a PLC and:
54
+
55
+ - **Adapt** what the PLC already exposes into proper SMI skills/methods, so any SMI-aware client can talk to it
56
+ uniformly regardless of vendor or PLC platform.
57
+ - **Extend** it: if the PLC only implements simple atomic skills (e.g. `MoveTo`, `Open`, `Close`), compose them into
58
+ higher-level composite skills (e.g. `PickAndPlace`) in Python — where orchestration logic is faster to write,
59
+ test, and iterate on than in PLC ladder/structured text.
60
+
61
+ This keeps low-level, safety-critical motion on the PLC where it belongs, while higher-level sequencing and
62
+ coordination logic lives in a language better suited for rapid development.
63
+
64
+ ## Requirements
65
+
66
+ - Python 3.11+
67
+
68
+ ## Installation
69
+
70
+ ```bash
71
+ pip install opensmi-server
72
+ ```
73
+
74
+ ## Quick Start
75
+
76
+ Define a skill, add it to a machine, and start the OPC UA server:
77
+
78
+ ```python
79
+ import asyncio
80
+
81
+ from asyncua import ua
82
+ from opensmi.core import Unit
83
+
84
+ from opensmi.server import BaseMachine, BaseSkillFinalResultData, BaseSkillFinite, ParameterSet, Server, UaVariable
85
+ from opensmi.server.mixins import FinalResultDataMixin, ParameterSetMixin, ParentMixin
86
+
87
+
88
+ class ExampleSkillParameterSet(ParameterSet):
89
+ """Parameters of the example skill."""
90
+
91
+ x = UaVariable(0, unit=Unit.NANOAMPERE, range=(0, 10))
92
+ y = UaVariable(0, unit="nA", range=(0, 10))
93
+
94
+
95
+ class ExampleSkillSimpleFinalResultData(BaseSkillFinalResultData):
96
+ """Final result data of the example skill."""
97
+
98
+ ComputationResult = UaVariable(0, unit="nA", range=(0, 20))
99
+
100
+
101
+ class ExampleSkill(
102
+ ParentMixin["ExampleMachine"], # provides type-checkable parent type
103
+ ParameterSetMixin[ExampleSkillParameterSet], # provides type-checkable parameters
104
+ FinalResultDataMixin[ExampleSkillSimpleFinalResultData], # provides type-checkable results
105
+ BaseSkillFinite, # provides finite skill logic etc.
106
+ ):
107
+ async def _handle_running(self) -> None:
108
+ # define logic that is executed in the RUNNING state
109
+
110
+ # read our parameters
111
+ x = await self.parameter_set.x.read()
112
+ y = await self.parameter_set.y.read()
113
+
114
+ # simulate long-running calculation etc.
115
+ await asyncio.sleep(1)
116
+
117
+ # we are done, write return variables
118
+ await self.final_result_data.ComputationResult.write(x + y)
119
+
120
+
121
+ class ExampleMachine(BaseMachine):
122
+ async def _init(self) -> None:
123
+ await super()._init()
124
+
125
+ await self.add_skill(ExampleSkill())
126
+
127
+ async def _write_identification(self) -> None:
128
+ # These identification variables must be set for machines
129
+ await self.identification.SerialNumber.write("1234-56789-abc")
130
+ await self.identification.ProductInstanceUri.write(
131
+ "urn:smartfactory.de-model:snr-1234-56789-abc"
132
+ )
133
+ await self.identification.Manufacturer.write(
134
+ ua.LocalizedText("Technologie-Initiative SmartFactory-KL e. V.", "de-DE")
135
+ )
136
+
137
+
138
+ async def main() -> None:
139
+ async with Server() as server: # will properly shut down the server
140
+ await server.add_machine(ExampleMachine()) # add machine(s)
141
+ await server.start(blocking=True) # start the server and block while it is running
142
+
143
+
144
+ if __name__ == "__main__":
145
+ asyncio.run(main())
146
+ ```
147
+
148
+ ### Usage
149
+
150
+ 1. Connect to the server with any OPC UA client
151
+ (e.g. [UaExpert](https://www.unified-automation.com/products/development-tools/uaexpert.html))
152
+ at `opc.tcp://localhost:4841`, authenticating as user `operator` with password `operator`.
153
+ 2. Navigate to `Objects/Machines/ExampleMachine`.
154
+ 3. Under `ExampleMachine/Lock`, call the `InitLock()` method to acquire exclusive access — required before you can
155
+ write parameters or call skill methods.
156
+ 4. Navigate to `ExampleMachine/SkillSet/ExampleSkill/SkillExecution`. This is where the skill's `ParameterSet`,
157
+ `StateMachine`, and `FinalResultData` etc. live.
158
+ 5. Under `ParameterSet`, write values for `x` and `y`.
159
+ 6. Under `StateMachine`, call `Reset()`. Skills start in the `Halted` state and must be reset to `Ready` before
160
+ they can run.
161
+ 7. Call `Start()`. The skill moves through `Starting` → `Running` → `Completing` → `Completed`.
162
+ 8. Once `StateMachine`'s `CurrentState` reads `Completed`, read the result from `ComputationResult` under
163
+ `FinalResultData`.
164
+
165
+ Or simply use our [OpenSMI-Client](https://github.com/SmartFactory-KL/opensmi-client).
166
+
167
+ **Explore the safety features:**
168
+
169
+ - Try writing parameters or calling skill methods *without* holding the Lock — it will be rejected.
170
+ - Try writing `x` or `y` outside their allowed range — it will be rejected.
171
+ - Try acquiring the Lock while authenticated as user `visitor` with password `visitor` — it will be rejected.
172
+
173
+ See [here](examples) for more OpenSMI server examples.
174
+
175
+ ## Core Concepts
176
+
177
+ | Concept | What it is |
178
+ |-----------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
179
+ | [**Machinery Items**](docs/machinery_item.md) | Common base for `Machines` and `Components`: attributes, identification, parameters, monitoring, sub-components, skills, methods, etc. |
180
+ | [**Components**](docs/machinery_item.md#components) | One piece of a machine's hierarchy, e.g. an axis or a gripper. May nest further sub-components. |
181
+ | [**Machines**](docs/machinery_item.md#machines) | The top-level unit a client addresses as "the machine," e.g. a robot + storage + transport port. A single server can expose several machines. |
182
+ | [**Skills**](docs/skills.md) | Asynchronous, stateful capabilities — finite (run once, complete) or continuous (run indefinitely), atomic or composite. |
183
+ | [**Methods**](docs/methods.md) | Synchronous, quick operations — no state machine, just `call()` in, result out. |
184
+
185
+ ## Project Status
186
+
187
+ OpenSMI began as a closed-source project at [SmartFactory-KL](https://smartfactory.de/), in active use in our model
188
+ factory since 2020. Its OPC UA information model has been refined across many iterations of research and
189
+ demonstrator use. The framework was open-sourced in 2026 following substantial refactoring and cleanup.
190
+
191
+ Most of the framework is stable and well-tested, but it remains pre-1.0 — expect minor API changes before the 1.0
192
+ release.
193
+
194
+ > [!warning]
195
+ > Currently, OpenSMI is a research and prototyping framework. Python is well suited for rapid development and
196
+ experimentation, but is generally **not recommended for industrial deployment**. Given sufficient interest and
197
+ (financial) support, we'd like to port OpenSMI's concepts to languages better suited for industrial use —
198
+ e.g. C# on the [official OPC Foundation .NET stack](https://github.com/OPCFoundation/UA-.NETStandard), or C++ using
199
+ > [open62541](https://open62541.org/). Get in touch if that's something you'd want to support.
200
+
201
+ <!--
202
+ ## OPC UA Nodesets
203
+ -->
204
+
205
+ ## Publications
206
+
207
+ Get more information of OpenSMI by reading our publications:
208
+
209
+ ### Scientific Publications
210
+
211
+ | Title | Content |
212
+ |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------|
213
+ | [**Seamless Machine Integration in Smart Manufacturing: Utilizing OPC UA for Machinery with Skill-Based Engineering of Varying Granularity**](https://ieeexplore.ieee.org/abstract/document/11599075) | Application of skills in robotics and an introduction to OpenSMI's OPC UA modeling |
214
+ | [**Developing a skill-based flexible transport system using OPC UA**](https://www.degruyterbrill.com/de/document/doi/10.1515/auto-2022-0115) | Application of skills in intralogistic |
215
+ | [**Interaction between FeasibilityCheck, PreconditionCheck and SkillExecution in skill-based machining**](https://ieeexplore.ieee.org/abstract/document/10275520) | Application of skills in machining |
216
+
217
+ ### Joint Publications
218
+
219
+ | Title | Content |
220
+ |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
221
+ | [**Capabilities and Skills in Production Automation**](https://www.vdma.eu/documents/34570/77803117/Capabilities_and_Skills_in_Production_Automation_EN.pdf) | Guidline for capabilities and skills with a focus on OPC UA |
222
+ | [**Information Model for Capabilities, Skills & Services**](https://www.plattform-i40.de/IP/Redaktion/DE/Downloads/Publikation/CapabilitiesSkillsServices.pdf) | Presenting an information model for flexible manufacturing in Industry 4.0 based on capabilities, skills and services |
223
+ | [**Capabilities, Skills and Services CSS Model Extensions and Engineering Methodology**](https://www.plattform-i40.de/IP/Redaktion/DE/Downloads/Publikation/2025-i40-capabilities.pdf) | Refinement of the information model for capabilities, skills and services |
224
+
225
+ <!--
226
+ ## Contributing
227
+ -->
228
+
229
+ ## License
230
+
231
+ The library itself is licensed under the [MIT License](LICENSES/MIT.txt).
232
+
233
+ Example code contained in the [examples](examples) directory is dedicated to the public domain under
234
+ the [CC0 1.0 Universal license](LICENSES/CC0-1.0.txt).
235
+
236
+ ---
237
+
238
+ *This text was drafted with AI assistance (Claude, Anthropic) and reviewed/edited by the author before
239
+ publication.*