Registry / type-stubs / guardrails-hub-types

guardrails-hub-types

JSON →
library0.0.4pypypiunverified

Guardrails Hub Types provides Pydantic models and type definitions used across the Guardrails Hub ecosystem. It encapsulates data structures for hub manifests, workflows, and other configuration, ensuring consistency and validation. Currently at version 0.0.4, it is part of a rapidly evolving project, with frequent updates likely as Guardrails Hub matures.

pip install guardrails-hub-types
INSTALL
IMPORT
SIG · GUARDRAILS-HUB-TYP
G
guardrails-hub-types
type-stubspythonv0.0.4
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HubManifest
from guardrails_hub_types import HubManifest
from guardrails_hub_types import HubManifest

This quickstart demonstrates how to import and instantiate a `HubManifest` using `guardrails-hub-types`. Since it uses Pydantic, data validation is automatic, and `ValidationError` is raised for malformed input, as shown with the invalid data example.

from guardrails_hub_types.models.hub import HubManifest from pydantic import ValidationError # Example of creating a HubManifest instance hub_data = { "name": "my-hub-rail", "version": "0.1.0", "description": "A simple rail for demonstration.", "authors": ["John Doe <john.doe@example.com>"], "tags": ["demo", "llm"], "docs_url": "https://example.com/docs", "config": {"type": "llm_rail"}, "inputs": {"prompt": {"type": "string"}}, "outputs": {"result": {"type": "string"}} } try: manifest = HubManifest(**hub_data) print("HubManifest created successfully!") print(f"Manifest Name: {manifest.name}") print(f"Manifest Version: {manifest.version}") except ValidationError as e: print(f"Validation Error: {e}") # Example of invalid data (missing required field 'name') invalid_hub_data = { "version": "0.1.0", "description": "Missing name." } try: invalid_manifest = HubManifest(**invalid_hub_data) except ValidationError as e: print(f"\nFailed to create invalid manifest as expected: {e}")
Debug
Known issues
gotchaThis library is version 0.0.x and is subject to rapid change. The API may not be stable and breaking changes are highly likely in future minor versions (e.g., 0.1.0, 0.2.0) before a 1.0.0 release.
fix
Always pin to specific versions (`guardrails-hub-types==0.0.4`) in production environments and review release notes carefully for updates.
affects: <1.0.0
gotchaAs a types-only library, `guardrails-hub-types` provides Pydantic models for data validation and structure, but does not contain any runtime logic or execution capabilities. It is intended for schema definition and validation.
fix
Do not expect this library to provide functional components; it is a dependency for Guardrails Hub's data management, not an executable part of the Guardrails runtime itself.
affects: *
breakingThe internal structure of the `models` submodules might change, leading to `ModuleNotFoundError` if you import directly from paths like `guardrails_hub_types.hub` instead of `guardrails_hub_types.models.hub`.
fix
Always refer to the latest source code or documentation to confirm exact import paths. Stick to the documented `guardrails_hub_types.models.<submodule>.<Type>` pattern.
affects: All versions prior to 1.0.0
Upgrade
Version history
0.0.4latest on PyPI · released Aug 12, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
33 hits · last 30 days
node
30
OpenAI (training)
1
Resources
guardrails-hub-types — pip install guardrails-hub-types · libregistry