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.
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 β
π Read the Full Documentation β
# 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 commands
This 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 checkerSee 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 pyvider
Version: 0.0.x (Alpha)
Protocol: Terraform Plugin Protocol v6
Python: 3.11+
β οΈ Pre-release - APIs may change before 1.0 release. Best suited for internal tooling, experimentation, and learning.
Copyright Β© provide.io LLC.