{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/4"}],"enrichment":{"capability":"Parses HCL2 configuration files (used by Terraform and other HashiCorp tools) into Python data structures, and converts Python dicts back to HCL2 format. Includes CLI tools for format conversion and querying.","skillfed_tags":["terraform","configuration-parsing","infrastructure-as-code"],"use_cases":["Convert Terraform .tf files to JSON for programmatic inspection or transformation in a Python application.","Build HCL2 configuration files dynamically from Python code without hand-writing HCL syntax.","Query specific values from HCL2 files using the hq CLI tool for compliance checks or configuration audits.","Integrate HCL2 parsing into infrastructure-as-code tooling or configuration management scripts.","Round-trip HCL2 \u2194 JSON for data pipeline or API integration workflows."],"what_it_does":"python-hcl2 is a parser that reads HCL2 configuration syntax\u2014the language used by Terraform and other HashiCorp tools\u2014and converts it into Python dictionaries, or vice versa. It uses the Lark parsing library and the regex module as its core dependencies. The package supports HCL2 only (not the older HCL v1) and works with any HCL2 config file, including Terraform configurations.\n\nBeyond basic parsing, the package provides a Builder API for constructing HCL2 documents programmatically from Python, and ships three CLI tools: hcl2tojson and jsontohcl2 for format conversion, and hq\u2014a jq-like query tool for extracting and inspecting parts of HCL2 files. It is actively maintained, supports Python 3.8 through 3.13, and carries no known security vulnerabilities.","worth_installing":"Yes. The package is actively maintained, has no known vulnerabilities, installs with minimal friction (two lightweight dependencies), supports current Python versions, and solves a real problem for anyone working with Terraform or other HCL2-based tools. The permissive MIT license poses no barrier. Install it if you need to parse, query, or generate HCL2 files from Python."},"id":"python-hcl2","links":{"html":"https://skillfed.io/packages/python-hcl2","md":"https://skillfed.io/packages/python-hcl2.md","pypi":"https://pypi.org/project/python-hcl2/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-10","license_spdx":null,"license_treatment":"permissive","name":"python-hcl2","python_support":"supports_current","summary":"A parser for HCL2"},"popularity":{"monthly_downloads":6339437,"position":1929,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"8.1.2"}
