skillfed

pycep-parser

A Python based Bicep parser

pycep-parser v0.7.1 4.6M downloads/30d#2,265 on PyPI14
Permissive license Apache-2.0 Active released

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-parser

uv

uv add pycep-parser

poetry

poetry add pycep-parser

Installing 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

Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Tags

bicep file parserazure bicep parsinginfrastructure as code parserbicep template analysisbicep syntax treelark-based bicep parserbicep ast extraction
bicepinfrastructure-as-codeparser

More Markup packages