Python Interface for the Multi-Level Intermediate Representation
pyMLIR is a full Python interface to parse, process, and output MLIR files according to the syntax described in the MLIR documentation. pyMLIR supports the basic dialects and can be extended with other dialects. It uses Lark to parse the MLIR syntax, and mirrors the classes into Python classes. Custom dialects can also be implemented with a Python string-format-like syntax, or via direct parsing.
Note that the tool does not depend on LLVM or MLIR. It can be installed and invoked directly from Python.