$npx skillfedfor your agent

python-terraform

This is a python module provide a wrapper of terraform command line tool

With conditionsPyPI Python ModulesReleased Jun 2019236.9K downloads / moMITSource build

Decision gist · record as of 2026-08-14

sdist only — python-terraform-0.10.1.tar.gz · builds from source
v0.10.1 · released 2019-06-21

Yes, if you need to invoke Terraform from Python and can tolerate aging maintenance. The package is stable and has no known vulnerabilities, but the last release was 2019-06-21. It works for basic Terraform automation, but verify compatibility with your Terraform version and Python environment before production use. High install friction (requires Terraform on PATH) is expected for this use case.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Terraform must be installed and available on the system PATH for this wrapper to function.
  • High install friction: no runtime dependencies but requires Terraform itself to be installed and available on the system PATH.
  • Maintenance is aging—last release was 2019-06-21, though the repository remains active with recent commits (2025-09-04).

License · maintenance · safety

MIT (permissive) — MIT license is permissive, imposing no significant restrictions on use or redistribution. You can use this package freely in commercial and private projects.

last release 2019-06-21 (2611 days) · last repo commit 2025-09-04 · 486 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 236,851 downloads/mo, #8,973 on PyPI

Verify before relying

from python_terraform import Terraform, IsFlagged

tf = Terraform(working_dir='/path/to/terraform')
return_code, stdout, stderr = tf.apply(no_color=IsFlagged, refresh=False, var={'key': 'value'})
  • Whether the package works reliably with modern Terraform versions (last release 2019-06-21).
  • Python version compatibility beyond classifiers (Python 2 and 3 listed, but Python 2 is end-of-life).
  • Whether real-time output capture (capture_output parameter) works as documented across all platforms.
Same gist for agents: .md · .json

What it is and what it does

python-terraform is a thin wrapper around the Terraform CLI that lets you run Terraform commands from Python code instead of shell scripts. It handles argument and option mapping (converting Python method calls and keyword arguments into Terraform CLI syntax) and captures stdout, stderr, and return codes for programmatic inspection. The wrapper supports all Terraform commands and provides special handling for flag-style options, boolean values, and multi-value parameters like `-target` and `-var`.

You instantiate a Terraform object, optionally specifying a working directory and default variables, then call methods named after Terraform commands (e.g., `.apply()`, `.plan()`, `.destroy()`). The package handles the syntactic quirks of Terraform's option design—distinguishing between flag-style options (like `-no-color`) and value options (like `-refresh=true`)—so you don't have to construct command strings manually. By default it captures output; you can disable capture to see real-time output in the terminal.

Use it for

  • Automate infrastructure provisioning workflows in Python applications without shelling out to Terraform directly.
  • Build CI/CD pipelines that apply or plan Terraform configurations and parse the results programmatically.
  • Wrap Terraform operations in Python error handling and logging for better observability.
  • Generate Terraform commands dynamically based on runtime configuration and pass them through the wrapper.
  • Test Terraform configurations by running plan/validate commands and inspecting their output from Python.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need to invoke Terraform from Python and can tolerate aging maintenance.

The package is stable and has no known vulnerabilities, but the last release was 2019-06-21. It works for basic Terraform automation, but verify compatibility with your Terraform version and Python environment before production use. High install friction (requires Terraform on PATH) is expected for this use case.

Install

python-terraform on PyPI

Before you install

High install friction: no runtime dependencies but requires Terraform itself to be installed and available on the system PATH. Maintenance is aging—last release was 2019-06-21, though the repository remains active with recent commits (2025-09-04). Beta-status package with modest adoption.

Terraform must be installed and available on the system PATH for this wrapper to function.

License in practice

MIT license is permissive, imposing no significant restrictions on use or redistribution. You can use this package freely in commercial and private projects.

Quickstart

from python_terraform import Terraform, IsFlagged

tf = Terraform(working_dir='/path/to/terraform')
return_code, stdout, stderr = tf.apply(no_color=IsFlagged, refresh=False, var={'key': 'value'})

Verify before relying

  • Whether the package works reliably with modern Terraform versions (last release 2019-06-21).
  • Python version compatibility beyond classifiers (Python 2 and 3 listed, but Python 2 is end-of-life).
  • Whether real-time output capture (capture_output parameter) works as documented across all platforms.

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionHigh. Source build required
Runtime dependenciesNone
MaintenanceAging 2,611 days since the last release
Last repo commit
First released
Downloads236,851 / month, #8,973 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 4 - BetaEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules

Evidence: python-terraform-0.10.1.tar.gz

Tags

Capabilities
terraform python wrappercall terraform from pythoninfrastructure as code automationterraform cli python interfaceinvoke terraform commands programmaticallyterraform output capturepython terraform integration
Topics
infrastructure-as-codeterraform-wrappercli-automation

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 › “terraform python wrapper”

  • python-terraformWraps the Terraform command-line tool, allowing you to invoke…
  • terraform-localA wrapper script that runs Terraform against LocalStack by…
  • tftestWraps the Terraform executable to facilitate testing Terraform…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

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.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

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.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

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.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

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…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also tftest · EasyProcess · cdktf · python-vagrant · terraform-local · scripttest · terraform-compliance · tfparse · python-hcl2 · codemagic-cli-tools