A library for robots that helps with a lot of things.
Project description
A library to generate OPC UA artifacts based on an xml nodeset (or a server) and target nodes, as well as an automated OPC UA server documentation builder.
Install the module in editable mode for development:
pip install -e .[dev]
OPC UA Client Generator (Python)
This generates a typed client for a voraus OPC UA specification in form of a nodeset.
voraus-opcua-generator build-client-package motion_nodes.xml /tmp/my_robot_control_package/
OPC UA Server XML Builder
The XML builder creates a OPC UA specification of a running OPC UA Server.
voraus-opcua-generator build-xml motion_nodes.xml
OPC UA Server Documentation Builder
The documentation builder for OPC UA server XML files creates RST files for all nodes including methods and variables. Code examples for each node are also generated. Note that the documentation builder will create a subdirectory including the documentation folder, which must not be committed. You also have to include the base rst file to the doctree of your index.rst file.
voraus-opcua-generator build-docs motion_nodes.xml docs/
How to use
Use the tools to configure own generator, all classes can be generated to a single file or multiple schemas can be generated to multiple files
# setup parser
schema_parser = NodesetParser("nodeset.xml") # or ClientParser("opc.tcp://<ip>:<port>")
# select target nodes
target_nodes: List[ua.NodeId] = [
ua.NodeId(8100104, 1), # classify camera image
ua.NodeId(8200101, 1), # detect objects
ua.NodeId(8310101, 1), # find qr codes
ua.NodeId(4200102, 1), # apply camera setting
]
# parse schema
schema = schema_parser.parse(target_nodes)
# set override options
override_options: List[OverrideOptions] = [
OverrideOptions(
node_id=ua.NodeId.from_string("ns=1;i=100210"),
name="Motion",
),
]
# generate code
code = generate_code(schema, override_options)
# write to file
with open(<filename>, "w") as file:
file.write(code)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file voraus_opcua_generator-0.13.1-py3-none-any.whl.
File metadata
- Download URL: voraus_opcua_generator-0.13.1-py3-none-any.whl
- Upload date:
- Size: 46.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bd8bb6a8262ea0fd90941cdf00cd49b2df1a1825f9a0d977048c296c904e4ae
|
|
| MD5 |
e1c4b8e3d7217339104cac58e133d704
|
|
| BLAKE2b-256 |
ae9beaad9046f594dd415a074b4866fcf380e4a023f95c8adb4c5a4a7bc46e09
|