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.1102.tar.gz (114.9 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.1102-py3-none-any.whl (173.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyvider-0.0.1102.tar.gz
Algorithm Hash digest
SHA256 93354c6939b15ee9d2a80faa06fd460ccc4ce67120723d9092d45c8c3096e6a1
MD5 6a682cbba4c269764efafdb045ca916e
BLAKE2b-256 cea9c685a9267a76d3d9fec6610a9722e3f40f65d6c66cec11f8644c35d1f5cf

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyvider-0.0.1102-py3-none-any.whl
Algorithm Hash digest
SHA256 e9ac4c43e323ffd9631b3653e1bd2fbccf848740fca6d214a2cfe5f504e1d721
MD5 9b12c1090c7aff28a73d225b52f15d01
BLAKE2b-256 4edb08f845c7f2d80054f69c16beccbdc3cae1e15391184039a2a21fca7688b3

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