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.1026.tar.gz (112.3 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.1026-py3-none-any.whl (154.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyvider-0.0.1026.tar.gz
Algorithm Hash digest
SHA256 26fb493fefb9afcf21bd378551e23da12fa7be2700f1727404b64f5fc3cd05d7
MD5 957c2a3599e0897a0b5a6eb105e7769d
BLAKE2b-256 1638383a4e8f7b4ce8221af2e9e400812663eb4727a8063e91ff44b2abab4eef

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyvider-0.0.1026-py3-none-any.whl
Algorithm Hash digest
SHA256 d1a8bf696cdb49eced8195041acbef614da24ad3121f5b0c982da1f28809b74d
MD5 97ba640874950cd36ef0dbdeab05e30e
BLAKE2b-256 7f47d56f43f4f3f778f347cb0c3f5a63766fb7ac0746dd0c434151621e0237e9

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