tfparse
Python HCL/Terraform parser via extension for AquaSecurity defsec
Decision gist · record as of 2026-08-14
Yes, if you need to parse and evaluate Terraform configurations in Python. The package is actively maintained, has no known vulnerabilities, and uses a permissive license. Install friction is moderate due to compiled extensions, but prebuilt wheels cover common platforms. Note the Windows memory management caveat if that is a deployment target.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires terraform init to have been run on the target directory to resolve module references.
- Medium install friction due to compiled C extensions (cffi-based bindings to Go).
- Prebuilt wheels available for Python 3.10–3.14 on macOS (x86_64, arm64), Linux (x86_64, aarch64), and Windows.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restrictions.
last release 2026-05-28 (78 days) · last repo commit 2026-07-01 · 57 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 156,620 downloads/mo, #10,780 on PyPI
Alternatives
Verify before relying
pip install tfparse
from tfparse import load_from_path
parsed = load_from_path('path_to_terraform_root')
print(parsed.keys())- Memory management on Windows (documentation notes memory is not freed on parse results; impact on long-running or high-volume parsing unclear).
- Exact scope of Terraform version compatibility and which HCL2 features are fully supported.
- Performance characteristics and scalability limits for large module hierarchies.
What it is and what it does
tfparse is a Python extension that wraps Go bindings to Terraform's canonical HCL parser and the defsec evaluation engine. It handles the full complexity of Terraform configuration parsing, including variable interpolation, function evaluation, and expression resolution—going beyond what a standard HCL parser can do. The library exposes a high-level Python interface to load and inspect parsed Terraform modules as dictionaries.
The package is built on cffi bindings to Go code and ships precompiled wheels for common platforms. It is intended for developers who need to programmatically analyze or process Terraform configurations in Python, such as linting tools, policy engines, or infrastructure scanning utilities.
Use it for
- Analyze Terraform modules programmatically to extract resource definitions and validate configurations.
- Build policy-as-code or compliance scanning tools that need to understand Terraform state and expressions.
- Integrate Terraform parsing into Python-based infrastructure-as-code tooling or CI/CD pipelines.
- Extract metadata from Terraform modules for documentation generation or dependency mapping.
- Validate Terraform configurations before deployment by inspecting parsed structure and values.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to parse and evaluate Terraform configurations in Python.
The package is actively maintained, has no known vulnerabilities, and uses a permissive license. Install friction is moderate due to compiled extensions, but prebuilt wheels cover common platforms. Note the Windows memory management caveat if that is a deployment target.
Install
tfparse on PyPI
Before you install
Medium install friction due to compiled C extensions (cffi-based bindings to Go). Prebuilt wheels available for Python 3.10–3.14 on macOS (x86_64, arm64), Linux (x86_64, aarch64), and Windows. Active maintenance with a recent release.
Requires terraform init to have been run on the target directory to resolve module references.
License in practice
Apache-2.0 permissive license allows use in most commercial and open-source projects without significant restrictions.
Quickstart
pip install tfparse
from tfparse import load_from_path
parsed = load_from_path('path_to_terraform_root')
print(parsed.keys())
Verify before relying
- Memory management on Windows (documentation notes memory is not freed on parse results; impact on long-running or high-volume parsing unclear).
- Exact scope of Terraform version compatibility and which HCL2 features are fully supported.
- Performance characteristics and scalability limits for large module hierarchies.
Package facts
| License | Apache-2.0 permissive |
| Python support | Not specified |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagecffi |
| Maintenance | Actively maintained 78 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 156,620 / month, #10,780 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: DevelopersProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: tfparse-0.6.20-cp310-cp310-macosx_10_9_x86_64.whl; tfparse-0.6.20-cp310-cp310-macosx_11_0_arm64.whl; tfparse-0.6.20-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; tfparse-0.6.20-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; tfparse-0.6.20-cp310-cp310-win_amd64.whl; tfparse-0.6.20-cp311-cp311-macosx_10_9_x86_64.whl; tfparse-0.6.20-cp311-cp311-macosx_11_0_arm64.whl; tfparse-0.6.20-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; tfparse-0.6.20-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; tfparse-0.6.20-cp311-cp311-win_amd64.whl; tfparse-0.6.20-cp312-cp312-macosx_10_13_x86_64.whl; tfparse-0.6.20-cp312-cp312-macosx_11_0_arm64.whl; tfparse-0.6.20-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; tfparse-0.6.20-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; tfparse-0.6.20-cp312-cp312-win_amd64.whl; tfparse-0.6.20-cp313-cp313-macosx_10_13_x86_64.whl; tfparse-0.6.20-cp313-cp313-macosx_11_0_arm64.whl; tfparse-0.6.20-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; tfparse-0.6.20-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; tfparse-0.6.20-cp313-cp313-win_amd64.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 › “parse terraform modules”
- tfparsetfparse parses and evaluates Terraform HCL configuration files using…
- bc-python-hcl2Parses HCL2 configuration files (such as Terraform configs) into…
- tftestWraps the Terraform executable to facilitate testing Terraform…
Give your agent the search over MCP, or paste the wish link into any chat.
More Build Tools packages
Provides reusable utilities for Python packaging interoperability, including version handling, specifiers, markers, requirements, tags, and metadata parsing according to standards like PEP 440 and PEP 425.
Wraps any iterable to display a real-time progress bar in the terminal or Jupyter notebook, showing iteration count, elapsed time, and estimated time remaining.
pip is the standard installer for Python packages, enabling you to download and install packages from the Python Package Index and other indexes into your Python environment.
Hatchling is a standards-compliant Python build backend that handles packaging, metadata, and distribution of Python projects when configured in a project's pyproject.toml file.
Generates Python gRPC service stubs and message classes from Protocol Buffer definitions, enabling developers to build gRPC clients and servers.
pre-commit is a framework for installing and running git hooks written in any language before commits are made, automating code quality and validation checks across multi-language projects.
Install it if your team needs consistent, automated validation at commit time.
See also pyhcl · bc-python-hcl2 · tree-sitter-hcl · python-hcl2 · tftest · cdktf · python-terraform · terraform-compliance · terraform-local · cdktf-cdktf-provider-aws