Skip to main content

Standard Components for the Pyvider Framework

Project description

๐Ÿงฉ๐Ÿ”ง 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.

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_components-0.4.0.tar.gz (99.3 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.4.0-py3-none-any.whl (150.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyvider_components-0.4.0.tar.gz
  • Upload date:
  • Size: 99.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyvider_components-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a46fef39ca3e7024787948ef5d2052d715f0f6d69611a7e39fcd8a874ddc5aea
MD5 0eefd29992f04e8aad66617827b41139
BLAKE2b-256 81d9aadbc143f0f6bf92954714be3c403466cae285bb1922129740e3d92de795

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyvider_components-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 150.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pyvider_components-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10122a6b54dfe310fb2167c35b1ee2858d7c1aa3a6fdabc0f00e1a44431ee80e
MD5 c9b9448b178da408602e178eb2c67dc8
BLAKE2b-256 8cef87f7327ff4deb78677aa9ecfdc273cdacf7c4706a947bf9d38de94d60a3c

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