Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

engiNIR-OPCUA

PyPI Python CI Documentation License: LGPL-3.0-or-later

An OPC UA client and server for Python, built on asyncio and secure from the first line.

engiNIR-OPCUA implements OPC UA (IEC 62541) for Python 3.12 and newer: clients, servers, subscriptions, events, alarms and conditions, history, methods, file transfer, redundancy, certificate management and PubSub, with a synchronous API and a command line program on top. Encrypted connections, certificate trust and user roles are switched on by default, and every one of them can be set up in a few lines.

It is a fork of opcua-asyncio 2.1.0. The import package is enginir_opcua and the commands start with enginir-opcua, so it can be installed next to asyncua.

Installation

uv add enginir-opcua

The command line program on its own:

uv tool install enginir-opcua

Quick start

A server and a client with a secure channel between them, in one process. Both create a PKI directory with a self-signed certificate; nothing is trusted automatically, so each side copies the other's certificate into its trusted/certs folder (enginir-opcua pair does the same on the command line).

import asyncio
import shutil

from enginir_opcua import Client, Server


async def main() -> None:
    url = "opc.tcp://127.0.0.1:4840/enginir-opcua/server/"
    server = Server.quickstart(url, pki="server-pki")
    client = Client.quickstart(url, pki="client-pki")
    await server.init()
    await client.init_pki()
    shutil.copy("client-pki/own/certs/application.der", "server-pki/trusted/certs/client.der")
    shutil.copy("server-pki/own/certs/application.der", "client-pki/trusted/certs/server.der")

    idx = await server.register_namespace("urn:example:quickstart")
    temperature = await server.nodes.objects.add_variable(idx, "Temperature", 21.5)
    async with server, client:
        print(await client.get_node(temperature.nodeid).read_value())


asyncio.run(main())

The same with two programs, a users file and the command line is in A Minimal Server and A Minimal Client.

Secure by default

  • Encrypted endpoints. The quick setup offers only SignAndEncrypt with Basic256Sha256, Aes128_Sha256_RsaOaep and Aes256_Sha256_RsaPss. An endpoint without security exists only when you ask for it.
  • Explicit trust. Both sides check the peer's certificate at every secure channel, in the order of OPC 10000-4, and trust nobody until a certificate is put into the PKI directory.
  • Users and roles. Anonymous sessions may read, browse and subscribe. Writing, calling methods and changing the address space need a user with the right role; passwords are stored as salted hashes.
  • Clear errors. A wrong setting raises a ConfigurationError that names it, and a refused certificate is reported with its thumbprint and the command that trusts it.

Command line

Set up the certificates of a server and a client, make them trust each other, and browse the server once it runs:

enginir-opcua init server srv --endpoint opc.tcp://127.0.0.1:4840/enginir-opcua/server/
enginir-opcua init client cli --application-uri urn:enginir:opcua:client
enginir-opcua pair srv/pki cli/pki
enginir-opcua ls -u opc.tcp://127.0.0.1:4840/enginir-opcua/server/ --pki-dir cli/pki \
    --security Basic256Sha256,SignAndEncrypt -n i=85

enginir-opcua has the subcommands read, write, call, ls, subscribe, history, discover, server, shell and generate-structs, and init, trust, pki, pair and user to set up certificates and users. See Installation & CLI Tools.

Documentation

The documentation is at https://enginir-opcua.readthedocs.io/en/latest/.

Build the documentation locally with uv run --group docs sphinx-build -b html docs docs/_build/html.

Development

uv sync
git submodule update --init --depth 1 nodeset
uv run pytest -q -m "not slow"
uv run ruff check . && uv run ruff format --check . && uv run mypy enginir_opcua tests

The conventions for code and tests are in AGENTS.md and tests/README.md.

License

LGPL-3.0-or-later; see COPYING, COPYING.GPL and NOTICE. The original library was written by Olivier Roulet-Dubonnet and the opcua-asyncio contributors; this fork was made on 2026-10-25.

Metadata

Release files for enginir-opcua 3.0.0rc3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for enginir-opcua 3.0.0rc3
File Size Uploaded Provenance Actions
enginir_opcua-3.0.0rc3.tar.gz 1.1 MB With provenance Details for enginir_opcua-3.0.0rc3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for enginir-opcua 3.0.0rc3
File Interpreter ABI Platform Actions
enginir_opcua-3.0.0rc3-py3-none-any.whl Python 3 none any Details for enginir_opcua-3.0.0rc3-py3-none-any.whl

Total release size: 2.2 MB

Release files / enginir_opcua-3.0.0rc3.tar.gz

Download URL enginir_opcua-3.0.0rc3.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
8a4bb89d0c8ca69f16fb57349db44caf5b0e8ac750f7ba9ea0de1e01f349c10d
BLAKE2b-256 checksum
How to use checksums
27b8b2096bb38df47b02851ac5f61d94d68551d5f1accaf8a6464e747f78f1c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / enginir_opcua-3.0.0rc3-py3-none-any.whl

Download URL enginir_opcua-3.0.0rc3-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d2694524c873dee04f96aa1b352863c553c1daf41a060cf6b84400bd10587e78
BLAKE2b-256 checksum
How to use checksums
081310560daac208ff8c3161ee3f37173cea0ec814e39e3cb3489e52de828cc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for enginir-opcua 3.0.0rc3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for enginir_opcua-3.0.0rc3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page