pycep-parser is a Python library designed to parse Azure Bicep files, leveraging the Lark parsing library. As of version 0.7.0, it supports a wide range of Bicep language features including various functions, decorators, typed variables, and import/extension elements. The project maintains an active development cycle with regular updates, typically every few months, adding new Bicep syntax support and ensuring compatibility with recent Python versions.
pip install pycep-parserVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the BicepParser and parse a simple Bicep content string into an Abstract Syntax Tree (AST). The `ast.pretty()` method provides a human-readable representation of the parsed structure.
Upgrade Python to 3.9 or higher, or restrict `pycep-parser` version to `<0.6.1`.
Upgrade Python to 3.8 or higher, or restrict `pycep-parser` version to `<0.5.1`.
Be aware of the underlying `Lark` dependency. If encountering unexpected parsing behavior, check the `Lark` version and its documentation, or the grammar used by `pycep-parser`.