bc-python-hcl2
A parser for HCL2
Decision gist · record as of 2026-08-14
Yes, if you need to parse HCL2 files programmatically. The package has low install friction, permissive licensing, and no known vulnerabilities. However, note that maintenance is aging (last release 396 days ago) and the project has minimal community activity (5 stars). It remains suitable for stable use cases but may not receive rapid updates for new HCL2 features or edge cases.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or higher.
- Low install friction with only two runtime dependencies (lark and importlib-resources).
- Maintenance status is aging—last release was 396 days ago and the repo shows minimal activity (5 stars), though it remains actively maintained and not archived.
License · maintenance · safety
MIT (permissive) — MIT license is permissive, allowing use in both open-source and commercial projects with minimal restrictions.
last release 2025-07-14 (396 days) · last repo commit 2025-07-14 · 5 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,595,690 downloads/mo, #2,278 on PyPI
Alternatives
Verify before relying
pip install bc-python-hcl2
import hcl2
with open('foo.tf', 'r') as file:
config = hcl2.load(file)- Completeness of HCL2 spec coverage beyond basic parsing—which features or edge cases may not be fully supported
- Performance characteristics when parsing large or deeply nested configuration files
- Whether the fork divergence from upstream python-hcl2 introduces breaking changes for existing users
What it is and what it does
bc-python-hcl2 is a HCL2 parser for Python that converts HashiCorp Configuration Language v2 files into native Python dictionaries. It uses Lark, a parsing toolkit, to handle the HCL2 grammar and is commonly used to programmatically read and process Terraform configuration files. The package is a maintained fork of the original python-hcl2 project, officially supported by Bridgecrew, and supports Python 3.8 through 3.12.
The parser is designed specifically for HCL2 and does not support the older HCL v1 syntax. It provides a simple API—typically just calling `hcl2.load()` on an open file—making it straightforward to integrate into tools that need to inspect or manipulate infrastructure-as-code configurations programmatically.
Use it for
- Parse Terraform .tf files to extract resource definitions and configuration values for analysis or validation
- Build tooling that reads HCL2 configs to generate documentation or reports about infrastructure
- Integrate HCL2 parsing into policy-as-code or security scanning tools that inspect infrastructure definitions
- Convert HCL2 configurations to other formats (JSON, YAML) for interoperability with non-Terraform tools
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to parse HCL2 files programmatically.
The package has low install friction, permissive licensing, and no known vulnerabilities. However, note that maintenance is aging (last release 396 days ago) and the project has minimal community activity (5 stars). It remains suitable for stable use cases but may not receive rapid updates for new HCL2 features or edge cases.
Install
bc-python-hcl2 on PyPI
Before you install
Low install friction with only two runtime dependencies (lark and importlib-resources). Maintenance status is aging—last release was 396 days ago and the repo shows minimal activity (5 stars), though it remains actively maintained and not archived.
Requires Python 3.8 or higher.
License in practice
MIT license is permissive, allowing use in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install bc-python-hcl2
import hcl2
with open('foo.tf', 'r') as file:
config = hcl2.load(file)
Verify before relying
- Completeness of HCL2 spec coverage beyond basic parsing—which features or edge cases may not be fully supported
- Performance characteristics when parsing large or deeply nested configuration files
- Whether the fork divergence from upstream python-hcl2 introduces breaking changes for existing users
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packageslarkimportlib-resources |
| Maintenance | Aging 396 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,595,690 / month, #2,278 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: bc_python_hcl2-0.4.3-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “infrastructure as code parsing”
- bc-python-hcl2Parses HCL2 configuration files (such as Terraform configs) into…
- tfparsetfparse parses and evaluates Terraform HCL configuration files using…
- pycep-parserParses Azure Bicep infrastructure-as-code files into a structured…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also python-hcl2 · pyhcl · tfparse · tree-sitter-hcl · pycep-parser · cdktf · lark-parser · lark-js · python-terraform · lark