Skip to main content

Generate code from DSDL using Jinja2 templates.

Project description

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:

Release history Release notifications | RSS feed

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.

nunavut-0.1.2-73-py3-none-any.whl (158.6 kB view details)

Uploaded Python 3

File details

Details for the file nunavut-0.1.2-73-py3-none-any.whl.

File metadata

  • Download URL: nunavut-0.1.2-73-py3-none-any.whl
  • Upload date:
  • Size: 158.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for nunavut-0.1.2-73-py3-none-any.whl
Algorithm Hash digest
SHA256 fd7d4b9fd7495625b844082c08c826c8514cf0c0beec82c310ed4fc00985124a
MD5 e291cc181844b28f446956daf6d05b68
BLAKE2b-256 13cff907fbb779b24146edfa4b8e8a178a591491f414a7f9e0af1659050fe853

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