Skip to main content

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 1.1
  • C++11

License

GPLv2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asyncapi-codegen-0.2.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asyncapi_codegen-0.2.0-py3-none-any.whl (35.8 kB view details)

Uploaded Python 3

File details

Details for the file asyncapi-codegen-0.2.0.tar.gz.

File metadata

  • Download URL: asyncapi-codegen-0.2.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for asyncapi-codegen-0.2.0.tar.gz
Algorithm Hash digest
SHA256 03018dfb56b1b711f3ab5ad36bc42e023232696e4e1dec33b1c3ef602f6fc15b
MD5 3bb86b146c20d0f74e7e779e9f91b9a0
BLAKE2b-256 e3a52de7051f6418c0a01035b13e4632d0466a54d733921c15afa0e71a3015ab

See more details on using hashes here.

File details

Details for the file asyncapi_codegen-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: asyncapi_codegen-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 35.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for asyncapi_codegen-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ee0de0fa55bb1fcc381ace1d39b1cd72855d3659bcb34fcf2f5a8a9f2fb08ac
MD5 54c223ace1202d782dc061f203e79844
BLAKE2b-256 d347ee5a00f94c7854d1e48b72615c5ed401ea494a87efd0510ed39e85c03d02

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