AsyncAPI Codegen
This 3rd-party open source tool creates C++ interfaces according to AsyncAPI specifications. Currently, only MQTT is supported.
Python Generator
The Python3 generator interprets a AsyncAPI specification and uses jinja2 templates to create a number of C++ sources and headers.
The AsyncAPI must be format-decoded first, using a JSON or YAML parser. The resulting parsed structure is then passed to the generator.
The generator interprets the specification directly. For example, if the specification defines a publish operation, the generator creates code for publishing.
Output files
The generator creates the following types of output files:
- client interface. This is the main interface for publishing or subscribing to messages.
- servers. Represents a connection to a server. Currently, only unauthenticated MQTT connections are supported. A server object is provided to a client interface to establish the connection to the broker/server.
- parameters. These are just schema objects.
- messages. Currently, these are just schema objects. However, in the future these objects will also take protocol-specific message bindings.
- schemas. These are structures that always enforce schema compliance and provide (de-)serialization methods to rapidjson Value objects (which can thus be used to create JSON strings).
Generated code files should be annotated for doxygen document generation, or at least that is the goal.
Installation
pip3 install asyncapi-codegen
Python requirements for running code generator
See also requirements.txt
- python 3.7
- jinja2
- stringcase
- json-schema-codegen
- pyyaml
Python requirements for generated python code
- python 3.7
- parse
- paho-mqtt
C++ requirements for generated code
- boost (boost::optional and boost::variant among others)
- rapidjson
- C++11
License
GPLv2
Release files for asyncapi-codegen 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| asyncapi-codegen-0.0.7.tar.gz | 7.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| asyncapi_codegen-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.6 kB
Release files / asyncapi-codegen-0.0.7.tar.gz
| Download URL | asyncapi-codegen-0.0.7.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
980057355789426b4f31bdb924c6d3ba0e6c502c9659df5dcfc21e2e84d65491
|
|
BLAKE2b-256 checksum How to use checksums |
a10e188d0871f7e572ef0c8cef7e6d8febaf61545e377c9f7a31f3c52bf205c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.36.1 CPython/3.7.0
|
Release files / asyncapi_codegen-0.0.7-py3-none-any.whl
| Download URL | asyncapi_codegen-0.0.7-py3-none-any.whl |
|---|---|
| Size | 30.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9eb343d0c90cfa89944466232ab1770d38d0e1b1fa31c949c149f5596d5899a9
|
|
BLAKE2b-256 checksum How to use checksums |
2e497fa0763866403c9287a18b98636263d3ad34403f82c77f58aee8f417e3d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.36.1 CPython/3.7.0
|