Standard Components for the Pyvider Framework
Project description
Pyvider Components
This repository provides a standard set of components for the Pyvider framework, a Python-based framework for building Terraform providers.
Components
The following components are available:
Data Sources
pyvider_env_variables: Provides access to environment variables.pyvider_file_info: Provides information about a file.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.pyvider_timed_token: Manages a timed token.pyvider_warning_example: An example resource that demonstrates how to return warnings.
Functions
Numeric Functions
add: Adds two numbers.subtract: Subtracts two numbers.multiply: Multiplies two numbers.divide: Divides two numbers.sum: Sums a list of numbers.min: Returns the minimum of a list of numbers.max: Returns the maximum of a list of numbers.round: Rounds a number to specified precision.
String Functions
upper: Converts a string to uppercase.lower: Converts a string to lowercase.split: Splits a string into a list of strings.join: Joins a list of strings.replace: Replaces a substring in a string.format: Formats a string using positional arguments.truncate: Truncates text to specified length.format_size: Formats bytes as human-readable size.pluralize: Pluralizes a word based on count.to_snake_case: Converts a string to snake_case.to_kebab_case: Converts a string to kebab-case.to_camel_case: Converts a string to camelCase.
Collection Functions
length: Returns the length of a string, list, or map.contains: Checks if a list contains a given element.lookup: Looks up a value in a map.
Type Conversion Functions
tostring: Converts any value to a string.
Transformation Functions
lens_jq: Transforms data using a JQ expression.
Getting Started
To use the pyvider-components provider, you need to configure it in your Terraform project.
terraform {
required_providers {
pyvider = {
source = "local/providers/pyvider"
version = "0.1.0"
}
}
}
provider "pyvider" {
# Configuration options here
}
Examples
Here are a few examples of how to use the components:
pyvider_env_variables
# Filter by a specific list of keys
data "pyvider_env_variables" "by_keys" {
keys = ["TEST_VAR1", "TEST_VAR2", "TEST_SENSITIVE_TOKEN", "NON_EXISTENT_VAR"]
}
output "by_keys_result" {
description = "Result of filtering by specific keys."
value = data.pyvider_env_variables.by_keys.values
}
pyvider_file_content
# Create file
resource "pyvider_file_content" "test_create" {
filename = "/tmp/pyvider_test_create.txt"
content = "This is a test file created by Pyvider"
}
output "created_file" {
value = {
filename = pyvider_file_content.test_create.filename
content = pyvider_file_content.test_create.content
exists = pyvider_file_content.test_create.exists
content_hash = pyvider_file_content.test_create.content_hash
}
}
upper function
output "upper_result" {
value = provider::pyvider::upper("hello world")
}
Development
To contribute to the development of the pyvider-components provider, you need to set up the development environment.
Environment Setup
# Set up the development environment (creates virtual env, installs dependencies)
source ./env.sh
Testing
# Run all tests
pytest
Building
# Build the package
uv build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyvider_components-0.0.1000.tar.gz.
File metadata
- Download URL: pyvider_components-0.0.1000.tar.gz
- Upload date:
- Size: 181.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf3122ac726e0379c1ab571bf5ebad1d5818cbcb11189a350431e2e186297b79
|
|
| MD5 |
b76d7530c9ffab5b098683734e734da4
|
|
| BLAKE2b-256 |
cfe2b9bbebaf5c38026631903679818b46c1419b303fcb80f87b5931cdb2b73e
|
File details
Details for the file pyvider_components-0.0.1000-py3-none-any.whl.
File metadata
- Download URL: pyvider_components-0.0.1000-py3-none-any.whl
- Upload date:
- Size: 232.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
126e5766dd5bf571177a895d8b5b8512c9ede37c56a86fe32ecbd93cd7b10e30
|
|
| MD5 |
bb219dc72bcb2370230a0b949b89049b
|
|
| BLAKE2b-256 |
951cf97e8a801e10786fbebc34f1a49e04ba6dcc10ae3501b59bc70a1d6ab7c2
|