Metadata-Version: 2.5
Name: usd-validate
Version: 1.24.0rc10
Summary: USD Validate
Project-URL: Repository, https://github.com/NVIDIA-Omniverse/usd-validate
Project-URL: Changelog, https://github.com/NVIDIA-Omniverse/usd-validate/blob/main/validation/CHANGELOG.md
Project-URL: Documentation, https://nvidia-omniverse.github.io/usd-validate/
Author: NVIDIA
License: Apache-2.0 AND CC-BY-4.0
License-File: LICENSE
License-File: THIRD_PARTY_NOTICES.md
Requires-Python: <3.15,>=3.10
Provides-Extra: numpy
Requires-Dist: numpy<3,>=1; extra == 'numpy'
Provides-Extra: usd
Requires-Dist: usd-core<26.09,>=23.11; (python_version < '3.14') and extra == 'usd'
Requires-Dist: usd-core<26.09,>=26.08; (python_version == '3.14') and extra == 'usd'
Provides-Extra: usdex
Requires-Dist: usd-exchange>=3.0.0; (python_version < '3.14') and extra == 'usdex'
Description-Content-Type: text/markdown

# USD Validate

An extensible framework to validate [OpenUSD](https://openusd.org) assets.
Inspired by Pixar's [usdchecker](https://graphics.pixar.com/usd/release/toolset.html#usdchecker),
this library extends validation capabilities with additional rules and provides automatic issue fixing.

It is the standalone successor to [`omniverse-asset-validator`](https://pypi.org/project/omniverse-asset-validator/) and is intended for use in any USD pipeline.

## Features

- Rule-based validation — Modular rule interface with registration mechanism for custom validators
- Flexible engine — Run validation on a `Usd.Stage`, individual layers, or recursively search folders
- Auto-fixing — Issue fixing interface for applying automated corrections when rules provide suggestions
- Command line interface — Standalone CLI for validation outside of GUI applications
- Lightweight — Pure Python implementation requiring only OpenUSD

## Installation

Install from PyPI:

```bash
pip install usd-validate
```

## Optional Dependencies

For full functionality, install with optional dependencies:

```bash
# Include usd-core
pip install usd-validate[usd]

# Include USD Exchange
pip install usd-validate[usdex]

# Include NumPy (for optimizations)
pip install usd-validate[numpy]

# Install all optional dependencies
pip install usd-validate[usd,numpy]
```

## Repository Layout and Releases

This repository is the single source repository for the shared NSPECT release and publishes
two canonical Python packages from the same commit, both versioned from the shared `VERSION.md`:

- `usd-validate` — the validation engine (source under `validation/src/`, with package docs,
  examples, and tests under `validation/`)
- `usd-profiles` — profile/spec definitions and code generation tooling (`profiles/`
  directory, a `uv` workspace member; formerly a standalone repository)

`uv build --all-packages` produces wheels and sdists for both packages.
The `usd-profiles` Hatchling hook configured in `validation/pyproject.toml` generates the bundled capabilities.
The legacy `usd-validation-nvidia` distribution provides the compatibility imports and the
`nvidia_usd_validate` alias for `usd-validate`.

## Build from Source

Build from the repository root. The build generates capabilities from `specs/` automatically:

```bash
uv build --all-packages -o dist
```

## Basic usage

```python
from usd_validate import ValidationEngine, IssueFixer

engine = ValidationEngine()
asset = "path/to/asset.usda"
results = engine.validate(asset)

for issue in results.issues():
    print(f"{issue.severity}: {issue.message}")

fixer = IssueFixer(asset)
fix_results = fixer.fix(results.issues())

for result in fix_results:
    print(f"{result.status}: {result.issue.message}")

fixer.save()
```

The `ValidationEngine` also supports selecting specific rules with `enable_rule()` / `disable_rule()`.
To filter by category in Python, enable the rules returned by `CategoryRuleRegistry().get_rules(category)`.
The `enable_requirement`, `enable_capability`, `enable_feature`, and `enable_profile` methods and their
`disable_*` counterparts accept objects or registered identifiers, for example
`engine.enable_requirement(Requirements.HI_004_V1_0_0)` or
`engine.enable_requirement("com.nvidia.usd.HI.004@1.0.0")`.

`ValidationEngine` also supports async validation, and rule `Check*` callbacks may be declared
`async def`; see
[Running rules asynchronously](https://nvidia-omniverse.github.io/usd-validate/validation/docs/authoring.html#running-rules-asynchronously).

## Command Line Interface

The `usd-validate` command provides validation from the terminal:

```bash
# Validate a single file
usd-validate asset.usda

# Validate a directory recursively
usd-validate ./assets/

# Apply automatic fixes
usd-validate --fix asset.usda

# Validate specific categories
usd-validate --category Material --category Geometry asset.usda

# Enable specific rules only
usd-validate --no-init-rules --rule StageMetadataChecker asset.usda

# Export results to CSV
usd-validate --csv-output results.csv asset.usda

# Show help
usd-validate --help
```

### Exit codes

By default, `usd-validate` exits with the following status codes:

- `0` when validation completes without issues.
- `1` when validation issues are found or a requested report cannot be written.
- `2` when command-line arguments are invalid.

`--exit-zero` causes validation issues to exit with a status code of `0`. Execution errors and report-write failures
still exit with a status code of `1`, while invalid command-line arguments still exit with a status code of `2`.
Use `--no-exit-zero` to explicitly retain the default behavior.

## Documentation

- [Full Documentation](https://nvidia-omniverse.github.io/usd-validate/)
- [API Reference](https://nvidia-omniverse.github.io/usd-validate/validation/docs/api.html)
- [Available Rules](https://nvidia-omniverse.github.io/usd-validate/validation/docs/rules.html)

## Requirements

- Python 3.10 - 3.13 with OpenUSD 23.11 or later
- Python 3.10 - 3.13 with USD Exchange 3.0.0 or later
- Python 3.14 with OpenUSD 26.08

## License

Apache-2.0 AND CC-BY-4.0

## AI Coding Agents

The [AGENTS.md](https://github.com/NVIDIA-Omniverse/usd-validate/blob/main/AGENTS.md) file and
[.agents/skills](https://github.com/NVIDIA-Omniverse/usd-validate/tree/main/.agents/skills) directory contain
structured guidance for AI coding agents. Start there for Python project setup, local venv setup, and generated
requirement validation workflows.
