Skip to main content

🌊🪢 Pyvider CTY

License Python 3.11+ uv Ruff CI

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.

  1. Install: uv add pyvider-cty
  2. Follow the Getting Started guide.
  3. See the Quick Example below.

Documentation

Comprehensive documentation is available in the docs/ directory:

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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyvider-cty 0.6.1
File Size Uploaded
pyvider_cty-0.6.1.tar.gz 256.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyvider-cty 0.6.1
File Interpreter ABI Platform
pyvider_cty-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 555.1 kB

Release files / pyvider_cty-0.6.1.tar.gz

Download URL pyvider_cty-0.6.1.tar.gz
Size 256.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ecdb96467f46e722c3cbddd7237719e86ca1ab822106360a65275fe7563c8f7a
BLAKE2b-256 checksum
How to use checksums
3bb514976721dea759b5d916590d6e0a29a7cce0f164b58d6fb697c0ce97887a
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 13, 2026.

Transparency log

Release files / pyvider_cty-0.6.1-py3-none-any.whl

Download URL pyvider_cty-0.6.1-py3-none-any.whl
Size 299.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9d1135f5e8f0ac95f12c1d08331fcab45327d59652f4b16b6f71dd0b829a0673
BLAKE2b-256 checksum
How to use checksums
389f014fbb7c371ae700dd573acb335069f6f89ad24542ebbd92add546d6a309
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 13, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.3

2 release files

0.6.2

2 release files

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.21

2 release 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