Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

voraus_opcua_generator-0.14.0-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

Details for the file voraus_opcua_generator-0.14.0-py3-none-any.whl.

File metadata

File hashes

Hashes for voraus_opcua_generator-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 884ef01b8d1d78218a8f0c4bdc28d89da497247fcdff167074c7576532ba811b
MD5 9bb934fe267e51f2c755c9543ea9d4e6
BLAKE2b-256 a4b9966f7ec905958b6a5c26af546fb720ddbdbfdf0513a7b5f88cf7499047a7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page