Metadata-Version: 2.4
Name: cuvis-ai-schemas
Version: 0.4.0
Summary: Lightweight schema definitions for cuvis-ai ecosystem
Author-email: "Cubert GmbH, Ulm, Germany" <cuvis.ai@cubert-gmbh.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://www.cubert-hyperspectral.com/
Project-URL: Repository, https://github.com/cubert-hyperspectral/cuvis-ai-schemas
Project-URL: Documentation, https://cubert-hyperspectral.github.io/cuvis-ai-schemas/
Project-URL: Issues, https://github.com/cubert-hyperspectral/cuvis-ai-schemas/issues
Project-URL: Changelog, https://github.com/cubert-hyperspectral/cuvis-ai-schemas/blob/main/CHANGELOG.md
Project-URL: Source, https://github.com/cubert-hyperspectral/cuvis-ai-schemas
Keywords: schema,validation,pydantic,pipeline,hyperspectral,cuvis,grpc,protobuf,ai,machine-learning,type-safety
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Distributed Computing
Classifier: Framework :: Pydantic
Classifier: Framework :: Pydantic :: 2
Classifier: Typing :: Typed
Classifier: Operating System :: OS Independent
Requires-Python: <3.12,>=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic<3.0.0,>=2.0.0
Requires-Dist: pyyaml>=6.0
Provides-Extra: proto
Requires-Dist: grpcio>=1.56.0; extra == "proto"
Requires-Dist: protobuf<8,>=6.33.5; extra == "proto"
Requires-Dist: grpcio-tools>=1.56.0; extra == "proto"
Provides-Extra: torch
Requires-Dist: torch>=2.0.0; extra == "torch"
Requires-Dist: torchvision; extra == "torch"
Provides-Extra: numpy
Requires-Dist: numpy>=1.21.0; extra == "numpy"
Provides-Extra: lightning
Requires-Dist: pytorch-lightning>=2.0.0; extra == "lightning"
Provides-Extra: full
Requires-Dist: cuvis-ai-schemas[lightning,numpy,proto,torch]; extra == "full"
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: mypy>=1.8.0; extra == "dev"
Requires-Dist: types-protobuf; extra == "dev"
Requires-Dist: types-grpcio; extra == "dev"
Requires-Dist: types-PyYAML; extra == "dev"
Requires-Dist: interrogate>=1.7.0; extra == "dev"
Requires-Dist: twine>=6.2.0; extra == "dev"
Requires-Dist: pip-audit>=2.7.0; extra == "dev"
Requires-Dist: bandit[toml]>=1.7.0; extra == "dev"
Requires-Dist: detect-secrets>=1.4.0; extra == "dev"
Requires-Dist: pip-licenses>=4.0.0; extra == "dev"
Requires-Dist: cyclonedx-bom>=4.0.0; extra == "dev"
Dynamic: license-file

# cuvis-ai-schemas

Lightweight schema definitions for the cuvis-ai ecosystem.

[![PyPI version](https://img.shields.io/pypi/v/cuvis-ai-schemas.svg)](https://pypi.org/project/cuvis-ai-schemas/)
[![CI Status](https://github.com/cubert-hyperspectral/cuvis-ai-schemas/actions/workflows/ci.yml/badge.svg)](https://github.com/cubert-hyperspectral/cuvis-ai-schemas/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/cubert-hyperspectral/cuvis-ai-schemas/branch/main/graph/badge.svg)](https://codecov.io/gh/cubert-hyperspectral/cuvis-ai-schemas)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![Python](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/)

## Overview

`cuvis-ai-schemas` is a centralized, dependency-light package of schema definitions used across the cuvis-ai ecosystem. It enables type-safe communication between services without heavy runtime requirements.

Key points:
- Minimal deps (pydantic + pyyaml)
- Full Pydantic validation
- Optional extras for proto, torch, numpy, lightning

## Installation

```bash
uv add cuvis-ai-schemas
uv add "cuvis-ai-schemas[proto]"
uv add "cuvis-ai-schemas[full]"
```

Extras:
- `proto`: gRPC and protobuf support
- `torch`: PyTorch dtype handling (validation only)
- `numpy`: NumPy array support
- `lightning`: PyTorch Lightning training configs
- `full`: All features
- `dev`: Development dependencies

## Usage

```python
from cuvis_ai_schemas.pipeline import PipelineConfig, NodeConfig

pipeline = PipelineConfig(
    nodes=[NodeConfig(id="node_1", class_name="DataLoader", params={"batch_size": 32})],
    connections=[],
)

pipeline_json = pipeline.to_json()
pipeline = PipelineConfig.from_json(pipeline_json)
```

## Development

```bash
uv sync --extra dev
uv run pytest tests/ -v
uv run ruff check cuvis_ai_schemas/ tests/
uv run ruff format cuvis_ai_schemas/ tests/
uv run mypy cuvis_ai_schemas/
```

## Contributing

Contributions are welcome. Please:
1. Ensure tests pass
2. Run ruff format and ruff check
3. Keep type hints and update docs as needed

## License

Licensed under the Apache License 2.0. See [LICENSE](LICENSE) for details.
