Skip to main content

Python Terraform Provider Framework

Project description

🐍 Pyvider: Build Terraform Providers in Pure Python

PyPI CI Status License Python Version

Pyvider is a Python framework for building Terraform providers. Write infrastructure providers using Python's elegance, type safety, and rich ecosystem while maintaining full compatibility with Terraform Plugin Protocol v6.

✨ Key Features

  • 🐍 Pure Python - Write providers using familiar Python patterns and libraries
  • 🎯 Type-Safe - Leverage type hints and attrs for robust code
  • 🚀 Decorator-Based - Simple registration system handles protocol complexity
  • 📦 Protocol v6 - Full Terraform Plugin Protocol v6 implementation
  • ⚡ Async - Built on modern async/await for high performance
  • 🧪 Testable - Comprehensive testing with pytest integration

📦 Installation

# Using pip
pip install pyvider

# Using uv (recommended)
uv add pyvider

🚀 Quick Start

from pyvider.providers import register_provider, BaseProvider
from pyvider.resources import register_resource, BaseResource
from pyvider.schema import s_resource, a_str
import attrs

@register_provider("mycloud")
class MyCloudProvider(BaseProvider):
    """Your cloud provider"""
    pass

@register_resource("server")
class Server(BaseResource):
    """Manages a server"""

    @classmethod
    def get_schema(cls):
        return s_resource({
            "name": a_str(required=True),
            "id": a_str(computed=True),
        })

    async def _create_apply(self, ctx):
        # Create your resource
        return State(id="srv-123", name=ctx.config.name), None

    async def read(self, ctx):
        # Read current state
        return ctx.state

See the full example in the Quick Start Guide →

📚 Documentation

📖 Read the Full Documentation →

Quick Links

🚦 Project Status

Version: 0.0.x (Alpha) Protocol: Terraform Plugin Protocol v6 Python: 3.11+

⚠️ Alpha Software - APIs may change before 1.0 release. Best suited for internal tooling, experimentation, and learning. See the Roadmap for details.

🤝 Contributing

Contributions welcome! See Contributing Guidelines.

# Development setup
uv sync
uv run pytest
uv run ruff check

📄 License

Apache 2.0 - See LICENSE for details.

🔗 Links


Made with ❤️ by Provide

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvider-0.0.1100.tar.gz (114.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvider-0.0.1100-py3-none-any.whl (172.8 kB view details)

Uploaded Python 3

File details

Details for the file pyvider-0.0.1100.tar.gz.

File metadata

  • Download URL: pyvider-0.0.1100.tar.gz
  • Upload date:
  • Size: 114.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for pyvider-0.0.1100.tar.gz
Algorithm Hash digest
SHA256 8b22f4cc3314bb86e47add789e3457f7bf014050934dc15ef163cb75ce823c3a
MD5 48be5754d76a6eef7da413af99a2c37e
BLAKE2b-256 0dd5df548262ed53e0bb3df6f3075ca95054f1b6cf6d9ea9506f796025f3c05d

See more details on using hashes here.

File details

Details for the file pyvider-0.0.1100-py3-none-any.whl.

File metadata

  • Download URL: pyvider-0.0.1100-py3-none-any.whl
  • Upload date:
  • Size: 172.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for pyvider-0.0.1100-py3-none-any.whl
Algorithm Hash digest
SHA256 f2423d482aee12b2598a979cfabf0be12196be72941fc26c6a568fb66e225a60
MD5 ffb1a2a057b4b3f07cdf36d144f998a8
BLAKE2b-256 469018078153bf0a9a311df9e282f0faa1883c0f470e10734f2a2adaaa76459d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page