🌊🪢 Pyvider CTY
Pure-Python implementation of the go-cty type system for Terraform tooling
pyvider.cty provides strong type validation and serialization capabilities for configuration data, designed to work seamlessly with Terraform providers and HashiCorp ecosystem tools.
✨ Key Features
- 🎯 Complete Type System - Full implementation of go-cty primitives, collections, and structural types
- 🔄 Cross-Language Compatibility - JSON/MessagePack serialization for Go interoperability
- ✅ Type-Safe Validation - Strong validation with detailed error messages
- 🏷️ Marks System - Attach metadata to values without modification
- 🧭 Path Navigation - Type-safe access to nested data structures
- 📚 Standard Library - Comprehensive collection of type functions
Quick Start
Note: pyvider-cty is in pre-release (v0.x.x). APIs and features may change before 1.0 release.
- Install:
uv add pyvider-cty - Follow the Getting Started guide.
- See the Quick Example below.
Documentation
Comprehensive documentation is available in the docs/ directory:
- Getting Started - Quick start and installation guide
- User Guide - Complete guide to all features
- How-To Guides - Practical task-oriented guides
- API Reference - Complete API documentation
Or start with the documentation index.
Development
Quick Start
# Set up environment
uv sync
# Run common tasks
make test # Run tests
make lint # Check code
make format # Format code
make help # See all available targets
See AGENTS.md for detailed development instructions and architecture information.
Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
License
Apache License 2.0. See LICENSE for details.
Overview
pyvider.cty is a pure-Python implementation of the go-cty type system, providing strong type validation and serialization capabilities for configuration data. It's designed to work seamlessly with Terraform providers and other HashiCorp ecosystem tools.
Key Features: Complete type system, cross-language compatibility via MessagePack, type-safe validation, marks system, path navigation, and comprehensive standard library.
Installation
uv add pyvider-cty
Quick Example
from pyvider.cty import CtyObject, CtyString, CtyNumber, CtyList
# Define a type schema
user_type = CtyObject(
attribute_types={
"name": CtyString(),
"age": CtyNumber(),
"hobbies": CtyList(element_type=CtyString()),
},
optional_attributes={"age"},
)
# Validate data
user_data = {"name": "Alice", "hobbies": ["reading", "hiking"]}
user_val = user_type.validate(user_data)
# Access validated data
print(f"Name: {user_val['name'].raw_value}") # Output: Alice
Known Limitations
- Python 3.11+ Required: Due to modern type features and syntax used.
- Performance: The library is not optimized for performance-critical applications involving very large or deeply nested data structures. Performance is reasonable for typical use cases.
Copyright (c) provide.io LLC.
Metadata
Release files for pyvider-cty 0.6.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyvider_cty-0.6.3.tar.gz | 257.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyvider_cty-0.6.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 558.1 kB
Release files / pyvider_cty-0.6.3.tar.gz
| Download URL | pyvider_cty-0.6.3.tar.gz |
|---|---|
| Size | 257.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0349d989f1849c70edcd8db15bb62315df0422a33a3c2a35f39e213ba2bc07c
|
|
BLAKE2b-256 checksum How to use checksums |
1bd2d54c3218cc5b71f6f64fd65983727d26901ed26f8bbc13fd7adb3ab6faa3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.
Transparency logRelease files / pyvider_cty-0.6.3-py3-none-any.whl
| Download URL | pyvider_cty-0.6.3-py3-none-any.whl |
|---|---|
| Size | 300.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8dccfea865eb9d55199c1c3d4d8fe63a1fcd9f755ffcb6029e8c75e82d205c34
|
|
BLAKE2b-256 checksum How to use checksums |
9a497fee3be9a1b72db5ec64d467b2ffed462b5b906bc5748223a88e9f0c957f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.
Transparency log