Skip to main content

🧩🔧 Pyvider Components

License Python 3.11+ uv Ruff CI

Example components for the Pyvider Terraform provider framework

This repository provides a standard set of example components for the Pyvider framework, demonstrating how to build Terraform providers in Python.

✨ Key Features

  • 📚 Learning Resources - Real-world examples of Pyvider components
  • 🔧 Reusable Components - Data sources, resources, and functions ready to use
  • 🧪 Test Patterns - Reference implementations for provider testing
  • 🏗️ Build Templates - Fork and customize for your own providers

Quick Start

  1. Install: uv add pyvider-components
  2. Read the Documentation
  3. Explore Examples

Getting Started

To use the pyvider-components provider, configure it in your Terraform project:

terraform {
  required_providers {
    pyvider = {
      source  = "local/providers/pyvider"
      version = ">= 0.0.0"  # For development/learning
      # For specific versions: version = "~> 0.1"
    }
  }
}

provider "pyvider" {
  # Provider configuration options go here
}

Documentation

Development

Quick Start

# 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

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

pytest

Contributing

See CONTRIBUTING.md for contribution guidelines.

License

See LICENSE for license details.

What is pyvider-components?

pyvider-components is a learning and reference library that demonstrates how to build Terraform provider components using the Pyvider framework. It contains working examples of resources, data sources, and functions that you can:

  • 📚 Learn from - See real-world examples of Pyvider components
  • 🔍 Reference - Use as templates for your own providers
  • 🧪 Test with - Try out Pyvider features without writing code
  • 🏗️ Build on - Fork and customize for your needs

Note: This is primarily an example/learning library, not a production provider. For production use, the terraform-provider-pyvider packages these components into a deployable provider.

Relationship to terraform-provider-pyvider

┌─────────────────────────┐
│   pyvider (framework)   │  ← Core framework for building providers
└───────────┬─────────────┘
            │
            ├─────────────────────────────────────┐
            │                                     │
┌───────────▼─────────────┐     ┌───────────────▼──────────────┐
│   pyvider-components    │────▶│  terraform-provider-pyvider  │
│   (example library)     │     │  (pre-release/testing provider)      │
│                         │     │                              │
│  • Learning resources   │     │  • Uses components from ←    │
│  • Reference examples   │     │  • Packaged & tested         │
│  • Component demos      │     │  • Pre-release learning tool         │
└─────────────────────────┘     └──────────────────────────────┘

Key Difference:

  • pyvider-components: Learn how to build components (this repo)
  • terraform-provider-pyvider: Pre-release provider for testing and learning (terraform-provider-pyvider)

When to use pyvider-components

Use this repository when you want to:

✅ Learn how to build Pyvider providers ✅ See working examples of resources, data sources, and functions ✅ Experiment with Pyvider features ✅ Reference implementation patterns ✅ Build your own custom provider

When to use terraform-provider-pyvider

Use the provider when you want to:

✅ Learn and experiment with Pyvider in Terraform ✅ Test provider functions and resources ✅ Follow a getting started tutorial ✅ Build sample configurations


Part of the provide.io Ecosystem

This project is part of a larger ecosystem of tools for Python and Terraform development.

View Ecosystem Overview →

Understand how provide-foundation, pyvider, flavorpack, and other projects work together.


Components

Data Sources

  • pyvider_env_variables: Provides access to environment variables.
  • pyvider_file_info: Provides metadata about a file or directory.
  • pyvider_http_api: Makes an HTTP request and returns the response.
  • pyvider_lens_jq: Transforms data using a JQ expression.

Resources

  • pyvider_file_content: Manages the content of a file.
  • pyvider_local_directory: Manages a directory on the local filesystem.
  • pyvider_private_state_verifier: Verifies the private state of a resource (for testing).
  • pyvider_timed_token: Manages a short-lived token (for testing).
  • pyvider_warning_example: Demonstrates how to return warnings (for testing).

Functions

A rich set of utility functions are provided for common data manipulations.

  • Numeric: add, subtract, multiply, divide, sum, min, max, round
  • String: upper, lower, split, join, replace, format, truncate, format_size, pluralize, to_snake_case, to_kebab_case, to_camel_case
  • Collection: length, contains, lookup
  • Type Conversion: tostring
  • Transformation: lens_jq

Examples

Read Environment Variables

data "pyvider_env_variables" "shell" {
  keys = ["SHELL"]
}

output "shell_path" {
  value = data.pyvider_env_variables.shell.values["SHELL"]
}

Manage a File

resource "pyvider_file_content" "example" {
  filename = "/tmp/example.txt"
  content  = "This file is managed by Terraform."
}

output "file_hash" {
  value = pyvider_file_content.example.content_hash
}

Use a String Function

output "uppercase_example" {
  value = provider::pyvider::upper("hello world")
}

Copyright (c) provide.io LLC.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvider_components-0.6.1.tar.gz (154.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvider_components-0.6.1-py3-none-any.whl (197.1 kB view details)

Uploaded Python 3

File details

Details for the file pyvider_components-0.6.1.tar.gz.

File metadata

  • Download URL: pyvider_components-0.6.1.tar.gz
  • Upload date:
  • Size: 154.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyvider_components-0.6.1.tar.gz
Algorithm Hash digest
SHA256 b35da0390412ed5f840f162ba5b3e97405297c7f22432a842f2eca527ebef33e
MD5 f6a4da462e4e194d533f179047120c1a
BLAKE2b-256 1adb423972df3dfb7f9a178bfa673ef95cf12091c6bfd2edb1c33d4bdac0f7d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvider_components-0.6.1.tar.gz:

Publisher: release.yml on provide-io/pyvider-components

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvider_components-0.6.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pyvider_components-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 43028e740059ede1308bc69694f881bf3e79654b60a0a30f1b5bc7db8fad0bbe
MD5 f7ab4244262fe7d372e8c2096e645113
BLAKE2b-256 fecd87495e9db5bada2b0c80f127cc4474664d1cf0a86f8d3b9e840f313bed2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvider_components-0.6.1-py3-none-any.whl:

Publisher: release.yml on provide-io/pyvider-components

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

This release

0.6.1 This release

2 files

0.6.0

2 files

0.5.3

2 files

0.5.2

2 files

0.5.0

2 files

0.4.0

2 files

0.3.32

2 files

0.3.31.post1

2 files

0.3.31

2 files

0.0.1102

2 files

0.0.1100

2 files

0.0.1026

2 files

0.0.1000

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page