pycep-parser
A Python based Bicep parser
What it is and what it does
pycep-parser is a Python library that parses Azure Bicep files—a domain-specific language for defining Azure infrastructure—into an abstract syntax tree (AST) using the Lark parser framework. It lets you programmatically read and analyze Bicep templates rather than treating them as opaque text, enabling tooling, validation, and transformation workflows.
The package is actively maintained and supports modern Python versions (3.10–3.14). Its three runtime dependencies are all lightweight and widely used. However, the documentation notes that support is still incomplete for some Bicep features (custom data types with decorators, union types in objects, and certain built-in functions like CIDR and Lambda), so it may not parse every valid Bicep file yet.
Use it for:
- Validate Bicep templates programmatically before deployment to catch syntax or structural errors early.
- Extract metadata from Bicep files (parameters, outputs, resource definitions) for documentation or inventory tools.
- Build linting or code-quality tools that analyze Bicep templates for best practices and compliance.
- Integrate Bicep parsing into CI/CD pipelines to gate deployments on template analysis results.
- Generate reports or visualizations of infrastructure defined in Bicep files.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses Azure Bicep infrastructure-as-code files into a structured representation using Lark, enabling programmatic analysis and manipulation of Bicep templates.
Yes, if you need to parse Bicep files programmatically. The package is actively maintained, has low install friction, carries a permissive license, and has no known vulnerabilities. Be aware that support for some Bicep language features is still incomplete; check the capabilities documentation to confirm it handles your template syntax before relying on it in production.
Install
pycep-parser on PyPI
pip
pip install pycep-parseruv
uv add pycep-parserpoetry
poetry add pycep-parserInstalling pycep-parser
Before you install
Low friction install with three lightweight runtime dependencies (lark, regex, typing-extensions). Active maintenance with a release within the last week and ongoing development; requires Python 3.10 or later.
License in practice
Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restrictions.
Quickstart
pip install pycep-parser
from pycep_parser import parse_file
ast = parse_file('template.bicep')
Requires Python 3.10 or later; Lark 1.1.2 or later must be available.
Verify before relying
- Whether the parser handles all current Bicep language features or only a subset (docs reference incomplete support for decorators, union types, and some functions).
- Performance characteristics when parsing large or complex Bicep templates.
- Whether the AST output is stable across releases or subject to breaking changes.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — lark, regex, typing-extensions |
| Maintenance | actively maintained — 5 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,641,204/month — #2,265 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pycep_parser-0.7.1-py3-none-any.whl
Keywords: bicep, lark, parser
Tags
More Markup packages
PyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
markdown-it-pyA Python markdown parser that converts markdown…
permissive · top 100 on PyPI
beautifulsoup4Beautiful Soup parses HTML and XML documents…
permissive · top 100 on PyPI
et-xmlfileet_xmlfile writes large XML files with minimal…
permissive · top 1,000 on PyPI
tomlkitParses and edits TOML files while preserving…
permissive · top 1,000 on PyPI
docstring-parserParses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
lark-parserLark is a parsing library that builds abstract…
permissive · top 5,000 on PyPI
lark-jsLark-js is a command-line tool that generates…
permissive · top 15,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
bc-python-hcl2Parses HCL2 configuration files (such as…
permissive · top 5,000 on PyPI
pycoberturaParses Cobertura code coverage reports and…
permissive · top 15,000 on PyPI
azure-mgmt-resource-templatespecsManages Azure Resource Template Specs through a…
permissive · top 5,000 on PyPI
openstep-parserParses Xcode project files (OpenStep format)…
permissive · top 15,000 on PyPI
pyjsparserParses JavaScript source code into an abstract…
permissive · top 15,000 on PyPI
rfc3987-syntaxValidates that strings conform to the ABNF…
permissive · top 1,000 on PyPI
lark-oapiPython SDK for the Feishu Open Platform that…
permissive · top 5,000 on PyPI