Generate code from DSDL using Jinja2 templates.
Project description
tox build (master) |
|
generated cpp verification |
|
static analysis |
|
unit test code coverage |
|
Python versions supported |
|
latest released version |
|
documentation |
|
license |
|
community/support |
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
*
* Auto-generated, 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 }} {{ 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 - The python library provided by this project.
nnvg – Command-line script for using nunavut directly or as part of a build system.
nunavut template guide – Documentation for authors of nunavut templates.
nunavut contributors guide – Documentation for contributors to the Nunavut project.
nunavut licenses – Licenses and copyrights
Nunavut is part of the UAVCAN project:
Project details
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 Distribution
Built Distributions
Hashes for nunavut-0.2.0-21-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51f96b8a78a0662b0b4c86036b0c89daac2cac57760cc0efa4567a2ae6017d3c |
|
MD5 | 8a4fe704219598acb427e5f23abbac49 |
|
BLAKE2b-256 | dcd439f05706051648e2ee787a61d2f40af8d2ebfded62f263e7d43210cf64ac |
Hashes for nunavut-0.2.0-20-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85d1280a31059eb32b58b060581f5f0f9dfe370fb032af72ed53044f41518011 |
|
MD5 | c14e954a8be760f9fcb194bf32e13d38 |
|
BLAKE2b-256 | 21ee01d446a6c5a76acf9d06c8843a477450e8733a83a158e77527e4fc110c9b |