Skip to main content

Objdictgen (odg)

This is python tools for working with Object Dictionary (OD) files for the CanFestival communication library. CanFestival is an open source implementation of the CANopen communication protocol.

This repo is located:

https://github.com/Laerdal/python-objdictgen

objdictgen includes tools to generate c code that works in tandem with a canfestival library. This tool has been built to work together with the Laerdal Medical fork for the canfestival library:

https://github.com/Laerdal/canfestival-laerdal

objdictgen is a tool to parse, view and manipulate files containing object dictionary (OD). An object dictionary is entries with data and configuration in CANopen devices. The odg executable is installed. It supports reading and writing OD files in .json/.jsonc format, in legacy XML .od and .eds files. It can generate c code for use with the canfestival library.

Install

To use this package Python3 must be installed. Use the package manager of choice to install the package in a virtual manager. We recommend the uv package manager.

Using uv (one of many methods)

$ uv venv
$ uv pip install objdictgen[ui]  # [ui] will install GUI tools
$ uv run odg

Using pip (for Windows)

$ py -3 -mvenv venv
$ venv/Scripts/pip install objdictgen[ui]

After this venv/Scripts/odg.exe (on Windows) or venv\bin\odg executable exists and can be called directly to run the command.

The objdictgen[ui] suffix will install the wx dependency needed for the UI odg edit. If no UI is needed, this suffix can be omitted.

odg command-line tool

odg is a command-line tool which is installed when the python package objdictgen is installed.

Invocation:

$ odg <options>
$ python -mobjdictgen <options>   # <-- If odg is unavailable

odg --help and odg <command> --help exists and shows the command options. The most useful commands are:

$ odg list <od-files...>              # List contents of the OD
$ odg convert <od-file1> <od-file2>   # Convert OD file
$ odg convert <od-file> <c-file>      # Convert OD to c code
$ odg diff <od-file1> <od-file2>      # Show differences between OD

Legacy commands

The legacy commands objdictgen and objdictedit are no longer available. The commands are available under odg gen and odg edit respectively.

JSON schema

src/objdictgen/schema/od.schema.json provides a JSON schema for the JSON OD format. This can be used for validation in editors.

To use the schema in VS Code, the following configuration must be added to your settings.json. After this is is installed, IntelliSense will show field descriptions, help with values and validate the file.

    "json.schemas": [
      {
        "fileMatch": [
          "**.jsonc"
        ],
        "url": "./src/objdictgen/schema/od.schema.json"
      }
    ],

Conversion

The recommended way to convert existing/legacy .od files to the new JSON format is:

$ odg generate <file.od> <file.jsonc> --fix --drop-unused [--nosort]

The --fix option might be necessary if the OD-file contains internal inconsistencies. It is safe to run this option as it will not delete any active parameters. The --drop-unused will remove any unused profile and DS-302 parameter that might be used in the file.

Motivation

The biggest improvement with the new tool over the original implementation is the introduction of a new .jsonc based format to store the object dictionary. The JSON format is well-known and easy to read. The tool use jsonc, allowing comments in the json file. odg will process the file in a repeatable manner, making it possible support diffing of the .jsonc file output. odg remains 100% compatible with the legacy .od format on both input and output.

The original objdictedit and objdictgen tool were written in legacy python 2 and and this is a port to python 3.

This tool is a fork from upstream canfestival-3-asc repo:

https://github.com/Laerdal/canfestival-3-asc

Making objdictedit excutable

To be able build an executable that can be run from anywhere:

$ pip install pyinstaller
$ pyinstaller packaging/objdictedit.spec

The file dist/objdictedit.exe can now be used anywhere. It does not need any pre-installed software.

License

Objdictgen has been based on the python tool included in CanFestival. This original work from CanFestival is:

Copyright (C): Edouard TISSERANT, Francis DUPIN and Laurent BESSARD

The Python 3 port and tool improvements have been implemented under

Copyright (C) 2022-2025 Svein Seldal, Laerdal Medical AS

Release files for objdictgen 3.5.5

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

Source distribution (sdist)

Source distribution for objdictgen 3.5.5
File Size Uploaded
objdictgen-3.5.5.tar.gz 160.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for objdictgen 3.5.5
File Interpreter ABI Platform
objdictgen-3.5.5-py3-none-any.whl Python 3 none any Details

Total release size: 318.8 kB

Release files / objdictgen-3.5.5.tar.gz

Download URL objdictgen-3.5.5.tar.gz
Size 160.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e04353cd93916f8091637d911ccbfdd8961ea7a0b348136f76c411fb97c76746
BLAKE2b-256 checksum
How to use checksums
1b8927f6dca1472f5bfca6fadddbd09793fc9e6c34d0074cff1432ecd444a6e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 21, 2026.

Transparency log

Release files / objdictgen-3.5.5-py3-none-any.whl

Download URL objdictgen-3.5.5-py3-none-any.whl
Size 158.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef29efad87602220a2016b4b0345f4b413527cd9855ca432c3a7b002e2e9f039
BLAKE2b-256 checksum
How to use checksums
98177cc035ee39f14ae68febace17ee356736a4f10828911501e951b3587a16c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.5.5 This release

2 release files

3.5.4

2 release files

3.5.2

2 release files

3.5.1

2 release files

3.5

2 release files

3.4

2 release files

3.3

3 release files

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