Metadata-Version: 2.4
Name: libterraform
Version: 0.10.0
Summary: Python binding for Terraform.
Project-URL: Homepage, https://github.com/Prodesire/py-libterraform
Project-URL: Repository, https://github.com/Prodesire/py-libterraform
Author-email: Prodesire <wangbinxin001@126.com>
License: MIT
License-File: LICENSE.txt
Keywords: libterraform,terraform
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: BSD
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown

<h1 align="center">Python libterraform</h1>

<p align="center">
  <em>Python binding for <a href="https://www.terraform.io/">Terraform</a>. Bundles Terraform as a shared library so you can run Terraform commands and parse configurations from Python without a separate <code>terraform</code> binary.</em>
</p>

<p align="center">
  <a href="https://github.com/Prodesire/py-libterraform/actions/workflows/test.yml"><img src="https://github.com/Prodesire/py-libterraform/actions/workflows/test.yml/badge.svg" alt="Test"></a>
  <a href="https://pypi.python.org/pypi/libterraform"><img src="https://img.shields.io/pypi/v/libterraform.svg" alt="PyPI"></a>
  <a href="https://pypi.python.org/pypi/libterraform"><img src="https://img.shields.io/pypi/pyversions/libterraform.svg" alt="Python"></a>
  <a href="https://pypi.python.org/pypi/libterraform"><img src="https://img.shields.io/pypi/dm/libterraform" alt="Downloads"></a>
</p>

<p align="center">
  <strong>Language:</strong> English | <a href="README.zh-CN.md">中文</a>
</p>

> **Documentation:** https://prodesire.github.io/py-libterraform/

## Installation

```bash
pip install libterraform
```

> **Note:** This library does not support multithreading.

## Usage

```python
from libterraform import TerraformCommand, TerraformConfig

# Run Terraform commands
cli = TerraformCommand("path/to/module")
cli.init(check=True)
cli.plan(check=True)

# Parse Terraform configuration
module, diagnostics = TerraformConfig.load_config_dir("path/to/module")
```

## Contributing

Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then:

```bash
make install        # Install dependencies and Git hooks
make build          # Build the shared library
make test           # Run tests
make lint           # Run linters
make doc-serve      # Preview documentation site
```

See the [Development Guide](https://prodesire.github.io/py-libterraform/development/) for details.
