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.
- 🐍 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
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.stateSee the full example in the Quick Start Guide →
📖 Read the Full Documentation →
- Installation Guide - Get up and running
- Quick Start Tutorial - Build your first provider in 5 minutes
- Architecture Overview - Understand how Pyvider works
- API Reference - Complete API documentation
- Examples - 100+ working examples
# Set up environment
uv sync
# Run common tasks
we run test # Run tests
we run lint # Check code
we run format # Format code
we tasks # See all available commandsThis project uses wrknv for task automation. Run we tasks to see all available commands.
Common tasks:
we run test- Run all testswe run test.coverage- Run tests with coveragewe run test.parallel- Run tests in parallelwe run lint- Check code qualitywe run lint.fix- Auto-fix linting issueswe run format- Format codewe typecheck- Run type checker
See CLAUDE.md for detailed development instructions and architecture information.
Contributions welcome! See Contributing Guidelines and the Development section above for setup instructions.
Apache 2.0 - See LICENSE for details.
# Using uv (recommended)
uv add pyviderVersion: 0.0.x (Alpha) Protocol: Terraform Plugin Protocol v6 Python: 3.11+
- Examples - Working examples
- PyPI - Package repository
- Discussions - Community support
Copyright (c) provide.io LLC.