Skip to content
Generate Code from DSDL using pydsdl and jinja2
Branch: master
Clone or download
thirtytwobits Issue/56 (#59)
* issue #56 adding trim and lstrip to nnvg

* issue 53: fix nnvg coverage\nAlso improve tests

* fixing unique name generation for included templates
Latest commit 8435d4e May 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Issue/56 (#59) May 17, 2019
test Issue/56 (#59) May 17, 2019
.gitignore External Program support #37 (#54) May 15, 2019
.gitmodules Milestone/1.1.0 (#46) May 13, 2019
.travis.yml Feature/22 (#28) Apr 19, 2019
CONTRIBUTING.rst External Program support #37 (#54) May 15, 2019
LICENSE.rst
README.rst External Program support #37 (#54) May 15, 2019
embed_jinja.py rename to nunavut: #45 (#47) May 13, 2019
requirements.txt Handling pydsdl base types as template names Apr 11, 2019
setup.cfg Issue/56 (#59) May 17, 2019
setup.py setup.py made executable (#51) May 14, 2019
subtree.json Initial commit for pydsdlgen. Mar 29, 2019
tox.ini Issue/56 (#59) May 17, 2019

README.rst

Nunavut

UAVCAN forum Documentation Status Codacy reports Codacy coverage reports Build status Supported Python Versions Pypi Release Version MIT license

Nunavut is a UAVCAN DSDL code generator that automates exposing a pydsdl abstract syntax tree to Jinja2 templates allowing authors to generate code, schemas, metadata, documentation, etc.

Partial example: generating a C struct

   /*
    * UAVCAN data structure definition
    *
    * Autogenerated, do not edit.
    *
    * Source file: {{T.source_file_path}}
    */

    #ifndef {{T.full_name | c.macrofy}}
    #define {{T.full_name | c.macrofy}}

    typedef struct {{T.full_name | c.to_snake_case}}Type
    {
{%- for attribute in T.attributes %}
{%- if attribute is constant %}
        const {{ attribute.data_type | c.type_from_primitive(use_standard_types=True) }} {{ attribute.name }} = {{ attribute.value }};
{% endif -%}
{% endfor %}

...

    } {{ T.full_name | c.to_snake_case }};

    #endif // {{T.full_name | c.macrofy}}

Nunavut is named after the Canadian territory. We chose the name because it is a beautiful word to say and read. Also, the name fits with a theme of "places in Canada" started with the Yukon project.

Installation

Nunavut requires Python 3.5 or newer and depends on pydsdl.

Install from PIP:

pip install nunavut

Bundled third-party software

Nunavut embeds the following third-party software libraries into its source (i.e. these are not dependencies and do not need to be installed):

  • Jinja2 by Armin Ronacher and contributors, BSD 3-clause license.
  • markupsafe by Armin Ronacher and contributors, BSD 3-clause license (needed for Jinja).

Documentation

The documentation for Nunavut is hosted on readthedocs.io:

Nunavut is part of the UAVCAN project:

You can’t perform that action at this time.