--- id: pyhcl version: "0.4.5" license: unclear license_treatment: copyleft maintenance: aging --- # pyhcl — HCL configuration parser for python License: copyleft · Maintenance: aging · Downloads: 9.8M/mo ## What it is and what it does pyhcl is a Python parser for HCL (HashiCorp Configuration Language), the configuration syntax used by Terraform and other HashiCorp tools. It reads HCL files and converts them into Python dictionaries, mirroring the interface of Python's built-in json module with load, loads, and dumps functions. The parser is based on the original Go implementation and aims for compatibility with it. The package is designed for HCL1 syntax and has been modified to work with Terraform 0.12, but does not support HCL2, which is used by modern Terraform versions. It includes a command-line tool (hcltool) to convert HCL files to JSON. The output structure is a plain Python dictionary with no built-in schema validation; users are expected to validate the result separately using external tools if needed. Use it for: - Parse Terraform configuration files (0.12 and earlier) for programmatic inspection or transformation. - Convert HCL configuration files to JSON format using the included hcltool command-line utility. - Load HashiCorp tool configuration files into Python applications for dynamic configuration management. - Integrate HCL parsing into legacy systems that predate HCL2 and modern Terraform. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses HCL (HashiCorp Configuration Language) files into Python dictionaries, providing load/loads/dumps functions similar to the json module. Yes, if you need to parse HCL1 or Terraform 0.12 configurations. The package is stable, has no dependencies, and installs easily. However, do not use it for modern Terraform (which requires HCL2 support); maintenance is aging with the last release in 2023-09-01, so expect limited support for new Python versions or edge cases. The copyleft license (MPL 2.0) requires disclosure of modifications if you redistribute derived work. ## Install pip install pyhcl uv add pyhcl poetry add pyhcl ## Installing pyhcl Before you install: Low install friction with no runtime dependencies. Maintenance is aging—last release was 2023-09-01, though the repository remains active with a recent commit in 2026-01-20. License in practice: Licensed under Mozilla Public License 2.0 (MPL 2.0), a copyleft license requiring derivative works to disclose modifications and maintain the same license. Quickstart: pip install pyhcl import pyhcl with open('file.hcl', 'r') as fp: obj = pyhcl.load(fp) Does not support HCL2 syntax used by modern Terraform; designed for HCL1 and Terraform 0.12 and earlier. Verify before relying: - Whether the package works reliably with current Python versions beyond those listed in classifiers. - Whether the Terraform 0.12 compatibility mentioned in the description covers all real-world use cases or only partial syntax. - Current maintenance status and likelihood of updates for edge cases or new Python versions. ## Package facts - License: not declared (copyleft) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 9.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags HCL parser python, hashicorp configuration language, parse terraform config, hcl to json converter, configuration file parsing, hcl syntax parser, configuration-parsing, terraform [View on SkillFed](https://skillfed.io/packages/pyhcl) · [View on PyPI](https://pypi.org/project/pyhcl/)