Skip to main content

Python Terraform Provider Framework

Project description

🐍 Pyvider: Build Terraform Providers in Pure Python

License Python 3.11+ uv Ruff CI

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.

🛠️ Development

Quick Start

# Set up environment
uv sync

# Run common tasks
we test           # Run tests
we lint           # Check code
we format         # Format code
we tasks          # See all available commands

Available Commands

This project uses wrknv for task automation. Run we tasks to see all available commands.

Common tasks:

  • we test - Run all tests
  • we test coverage - Run tests with coverage
  • we test parallel - Run tests in parallel
  • we lint - Check code quality
  • we lint fix - Auto-fix linting issues
  • we format - Format code
  • we typecheck - Run type checker

See CLAUDE.md for detailed development instructions and architecture information.

🤝 Contributing

Contributions welcome! See Contributing Guidelines and the Development section above for setup instructions.

📄 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.1111.tar.gz (116.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.1111-py3-none-any.whl (174.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyvider-0.0.1111.tar.gz
Algorithm Hash digest
SHA256 48ab7660ee4ec42fdaa38c954dcfe8038fb42dd6c0b1a16a330a0eaca8f97e91
MD5 ae9ec6f373a57094fc901a71f86cd265
BLAKE2b-256 6347bcaf7accc90514edae7e6bb79f7040827f60228cbcac8489053128a60df5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pyvider-0.0.1111-py3-none-any.whl
Algorithm Hash digest
SHA256 e00bff97d19808fab18e36cd3d72d8609d39708c096933b975f05cadadf103c6
MD5 cfac224672faa0e6668caeef04260799
BLAKE2b-256 ee1ff30377982e6e270243648b6b92783f2722fb28315bdd34d8ab6d346fc5d0

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