Coding Conventions

While developing PyKaldi, we try our best to adhere to the following coding conventions:

CLIF

Since CLIF C++ API descriptions for Python extensions look very much like Python code with type hints, we try to follow to the Python style guide to the degree it makes sense.

Python

PyKaldi Python source code largely adheres to Google Python Style Guide.

Documentation

Most of PyKaldi documentation is automatically generated with Sphinx autodoc and napoleon extensions by pulling in docstrings from the Python modules. The docstrings in PyKaldi source code mostly follow the Google style.

Since a large part of PyKaldi package consists of raw CLIF wrappers, we extended CLIF C++ API description language to support optional docstrings. This allows us to document PyKaldi modules without wrapping them further in Python. CLIF docstrings are multiline strings enclosed by “”“triple double quotes”“”. They largely follow the usual Python docstring conventions (PEP 257). If a docstring is provided, then it overrides the surrogate docstring generated by CLIF.