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.0-62-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 854fdb0221860026837a9b8e2bcb7a32cf899d1ef951c3864e490148186e9e46 |
|
MD5 | 38b6031633928e2d496ecc6d863437d6 |
|
BLAKE2b-256 | f964ac892cc655bee243a48980e21368c32e1d3926201635b1aec51f22dfda0a |
Hashes for nunavut-0.1.0-61-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff5dabbea8209d2f826d4fd428f0d2648f4f6821f80db734a773b2670157e744 |
|
MD5 | 1164fd73ddfd59280bf10e03c85b6c3c |
|
BLAKE2b-256 | 7180d648421ffe4af2e7660cae39bc2b446688f7cfb4398bb58cd779878c4a75 |
Hashes for nunavut-0.1.0-60-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c70262e76d116f7a3771c1081640581a74ad71717563089fb34404895e34e921 |
|
MD5 | ff91c53074afa5ede0580a848f6cf199 |
|
BLAKE2b-256 | e3b5ef1e569d4a3ac25ce9e47bf46770baf3af447fccad5524da093e7f34cd1e |
Hashes for nunavut-0.1.0-59-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f704f1043f5de440d0b95c0aa6f0413e393d6bab6bbdc744ac89413ebd5fc049 |
|
MD5 | a40a7b42492e93a74f6dd050d9b29988 |
|
BLAKE2b-256 | 9bbc432793f990e41c274cc7546906323a44468c1dbcbf7404554966126d51ad |
Hashes for nunavut-0.1.0-57-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1142d458d95face7a11f8098f6ee66d63be532f391f5d11742b6a4ff67433025 |
|
MD5 | 095bd65a5ed8d00c23223a9c35f3544a |
|
BLAKE2b-256 | 2385bcecfed5d3ae9ca2f2e57febb30a447e32e62e591080715c8129d44eb7f4 |