Metadata-Version: 2.5
Name: o6-ncc
Version: 1.0.0
Summary: Generate C code for open62541 and Python packages for o6 from OPC UA NodeSet XML.
Project-URL: Homepage, https://www.o6-automation.com/
Project-URL: Documentation, https://docs.o6-automation.com/o6-nodeset-compiler-collection/
Author: o6-Automation GmbH
License-Expression: MPL-2.0 AND MIT
License-File: LICENSE
License-File: src/o6_nodeset_compiler/bundle/LICENSE-MIT.txt
Keywords: code-generation,industrial-automation,nodeset,opcua,open62541
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.10
Requires-Dist: argcomplete>=3.1
Requires-Dist: numpy>=1.24
Provides-Extra: graphviz
Requires-Dist: graphviz>=0.20; extra == 'graphviz'
Description-Content-Type: text/markdown

# o6-ncc

Your OPC UA information model describes the machine. **`ncc` turns that model
into code you can build an application around:** C source for **open62541** and
Python namespace packages for **o6\Python**.

Types, instances, references, custom datatypes: the XML has already done the
introductions. Let the compiler handle the repetitive declarations while you
write the behavior that makes your application useful. There are better ways to
spend an afternoon than copying NodeIds.

## From information model to application

Keep the NodeSet as the source of truth for your model. Generate the code, connect
it to your SDK, and keep application logic in your own modules. When the model
changes, regenerate its output.

```bash
# Build the model's address space with open62541.
ncc c MyMachine.NodeSet2.xml -e Opc.Ua.NodeSet2.xml \
    --shortname mymachine -o generated/c

# Generate a namespace package for o6\Python.
ncc python MyMachine.NodeSet2.xml -e ns0 \
    --shortname mymachine -o generated/python
```

The C output gives your server an initializer to call. The Python output gives
your application a namespace package to import and use. Dependencies stay
explicit: C generation takes XML paths; Python generation accepts bundled model
names or custom XML declarations with package locations.

## Make open62541 development flow

- **Generate address spaces:** turn one or more NodeSet XML files into C source
  and headers, with a named server initializer.
- **Bring your custom types:** generate C structs and datatype tables from BSD
  definitions and NodeId CSVs, plus NodeId headers for application code.
- **Generate a complete model:** `ncc c model` coordinates address-space code,
  datatype tables, and NodeId constants in one command.
- **Put generation in the build:** the supplied CMake helper tracks model inputs,
  regenerates changed outputs, and carries include paths and link dependencies
  through a model target.

Change the model. Build the project. Get back to the interesting part.

## Make o6\Python models feel at home

- **Generate organized packages:** reference types, datatypes, variable types,
  object types, and instances have their own modules.
- **Keep editors in the loop:** datatype `.pyi` stubs provide signatures for
  completion and static analysis.
- **Carry initial values into code:** supported XML values become Python
  expressions, including nested structures, arrays, enums, unions, and composite
  OPC UA values.
- **Use companion specifications offline:** bundled dependency XML is available
  through names such as `ns0`, `di`, and `machinery`.
- **Fit your project layout:** declare where custom dependency packages belong
  and generate the corresponding imports.

Work with your model as Python classes: generated object and variable types
preserve the model's inheritance and expose child nodes as typed attributes.
The structure you designed in the NodeSet is ready to use in application code.

## Inspect before you integrate

A reference graph occasionally needs a picture. Occasionally, it needs a very
large picture.

```bash
# Inspect nodes, namespace URIs, and references as JSON.
ncc inventory MyMachine.NodeSet2.xml -e ns0 -o inventory.json

# Visualize the model with Graphviz.
ncc graphviz MyMachine.NodeSet2.xml -e ns0 -o model.dot
```

Inventory and Graphviz work independently of the chosen language backend.
Graphviz supports DOT output, optional PDF/SVG/PNG rendering, and a selectable
root node for focused diagrams. Shell completion covers commands, options, and
dependency names in bash, zsh, fish, and PowerShell. `cncc` and `pyncc` are also
available as shortcuts for `ncc c` and `ncc python`.

## SDK compatibility

| Generated code | SDK baseline |
| --- | --- |
| C address spaces and datatype tables | **open62541 1.5 and later** |
| Python namespace packages | **o6\Python 2.2.0 and later** |

Neither SDK is needed to generate code. Your application uses the corresponding
SDK to compile or run the generated output; the compiler is not an application
runtime dependency.

Model features can require SDK configuration—for example,
`UA_ENABLE_XML_ENCODING` in open62541 preserves XML initial values. Consult your
SDK's documentation for its configuration and runtime APIs.

## SDK documentation

- [Official o6\Python documentation](https://docs.o6-automation.com/o6-python/)
  — build your Python application around its models, server APIs, and runtime.
- [Official open62541 documentation](https://open62541.org/doc/master/)
  — explore the C SDK, server configuration, tutorials, and API reference.

## License

Developed by [o6-Automation GmbH](https://www.o6-automation.com/).

The compiler is licensed under the [Mozilla Public License 2.0](https://mozilla.org/MPL/2.0/).
Bundled NodeSet XML includes MIT-licensed material and retains its upstream notices.
