Generate code from DSDL using Jinja2 templates.
Project description
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 - 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 Distributions
Built Distributions
Hashes for nunavut-0.1.1-71-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51a3f212bdf3110956337edb13fe332003ccf364b67359c6b557b30fdd7349e2 |
|
MD5 | 3eb1564642fdf85ca35b2418489a1aff |
|
BLAKE2b-256 | 2faa1bf2917c0a55234d89ae8ead2cdfb4361af2211194ddf191ad6adef43d7a |
Hashes for nunavut-0.1.1-68-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 215da634c5cf1f5b4cbf0a25de7887387946c22bbb87dc4b8473ee45d7022bf2 |
|
MD5 | ef7f7610e637df9acbfb381bdc112620 |
|
BLAKE2b-256 | 44ba50aa536f9fc634358d79ffa35c991101eaf69c6ea0963a1e606041c0425c |
Hashes for nunavut-0.1.1-66-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 125c3a1f59d6db98f861461f1cbe0b2112632caac456192b7823c4bf55d3b892 |
|
MD5 | 98ab27d99ea08075ae4a14f92fceec52 |
|
BLAKE2b-256 | c3b299fd94739e2cdddca7d8ffba7f747d9fd8f323b38a92b11fb55e059fa489 |