Metadata-Version: 2.4
Name: simready-package
Version: 2026.10.0
Summary: SimReady asset packaging and workspaces: package versions, editable installs, provenance
Author: NVIDIA Corporation
License-Expression: Apache-2.0
Project-URL: Homepage, https://www.nvidia.com
Keywords: nvidia,simready,package,workspace
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: ovpackage>=0.2.0
Requires-Dist: simready.validate>=2026.10.0-rc0
Requires-Dist: usd-validation-nvidia>=1.23.0
Provides-Extra: usd
Requires-Dist: usd-core>=22.11; extra == "usd"
Dynamic: license-file

# simready-package

SimReady asset packaging and workspaces: an immutable **package space**, a
writable **install space**, packaging and provenance.

Version `2026.10.0` replaces the earlier `simready-package` (`2026.7.x` and
before: `Packager`, pre/post validation, WRAPP publish), which has a different
API. Its users stay on
`2026.7.x`. Packages are the same as the legacy ones (validation included);
batch packaging is being brought over.

The documentation is installed with the package, in `simready/package/docs/`
under your Python environment's `site-packages`:

| Document | Content |
|----------|---------|
| `guides/simready-package-workflow.md` | Workflow guide |
| `cli.md` | CLI reference |
| `api.md` | Python API reference |

## Workspace layout

```
<ws>/
  simready-workspace.toml     # marker + config (edited by hand)
  ledger.json                 # state (written by simready-package only)
  ledger.lock                 # only while a command writes the ledger
  .packages/<name>/<version>/ # immutable packages (SimReady package standard)
  installs/<name>/<version>/  # writable content, bound to that package version
```

A command uses the workspace given with `--workspace`, else
`$SIMREADY_WORKSPACE`, else the current folder (parent folders are not
searched).

## CLI

```bash
simready-package init ./acme-ws --license cc-by-4.0
cd acme-ws

# Validate and package a folder (new name: version 1.0.0)
simready-package package ../assets/crate_a01/simready_usd --name simready.hf.acme.simready-assets.crate_a01 \
    --root-usd sm_crate_a01.usd

# Or import a downloaded package folder unchanged (hashes verified)
simready-package import-package ../download/crate_a01 --remote-uri https://huggingface.co/datasets/...

# Install, edit, check, package the install as a new version
simready-package install simready.hf.acme.simready-assets.crate_a01@1.0.0
simready-package status
simready-package package simready.hf.acme.simready-assets.crate_a01@1.0.0 --bump minor --dry-run
simready-package package simready.hf.acme.simready-assets.crate_a01@1.0.0 --bump minor

# Move to the new version
simready-package uninstall simready.hf.acme.simready-assets.crate_a01@1.0.0 --discard
simready-package install simready.hf.acme.simready-assets.crate_a01

# Without a workspace
simready-package package ./crate_a01 --name ... --license cc-by-4.0 --root-usd sm_crate_a01.usd --out ./dist/crate_a01
simready-package package ./crate_a01 --name ... --license cc-by-4.0 --root-usd sm_crate_a01.usd --in-place
```

Other commands: `info`, `doctor [--fix]`, `list-packages [--name]`, `show`,
`remove`, `list-installs`, `set-asset-metadata`, `get-asset-metadata`, `history`.

Pushing to Hugging Face and submitting to SimReady Central is done by
simready-publish.

## Rules

- **Package entries never change.** Re-importing identical content is a no-op;
  different content under an existing `name@version` is refused. `install`
  (and simready-publish `push`) re-hash the entry first and refuse a modified one.
- **One package command.** `package SOURCE`: a folder (needs `--name`,
  `--license`, which must match the SR.004 `asset_license` of the root USDs
  when they declare one) or an install (`name@version`; name, license and origin come
  from the install's package). Same content as an existing version -> no new
  version.
- **Versions**: SemVer 2.0.0 (no build metadata) is recommended and is what
  new names get; a bump applies to `max(origin, latest existing version)`.
  Assets on date versions (`YYYY.MM.DD_NN`) keep getting
  dates: today (UTC) by default, `--bump` refused, with a warning recommending
  SemVer; `--version X.Y.Z` moves them to SemVer, one-way. SemVer versions are
  newer than date versions. See "Versions" in the CLI reference.
- **Installs** are bound to one package version for life. `uninstall` needs
  `--discard` if the install has changes.
- **Packaging an install** writes `.metadata/com.nvidia.simready.origin.json`
  (origin package, recorded derivations, change counts), and adds
  `revision_of` / `origin_publisher` to the SR.004 sidecar of the root USDs, in
  the new package only.
- **Every package is validated** (as the legacy simready-package did): the root
  USDs against `Package-Candidate` before the package files are written, the
  package definition against `Package` after. The conformance files and
  `com.nvidia.simready.root_usds.json` are stored in `.metadata/`. A failure
  creates nothing. Root USDs: `--root-usd`, else the source's (or the origin's)
  `.metadata/com.nvidia.simready.root_usds.json`.
- **Asset metadata** (`set-asset-metadata INSTALL KEY=VALUE...`): only on an
  install. Written into the SR.004 sidecar `<usd_stem>.json` of every root
  USD, replacing existing values; a key also set in the USD is removed from
  it (warning). Package the install to make a new version.
- **Exclude list** (`[packaging] exclude` in `simready-workspace.toml`): files
  that are neither packaged nor compared. Empty by default (the
  simready-validate receipt `.simready/validation.json` is packaged).
- **Files only:** packaging fails when the source holds a symbolic link (or a
  Windows junction), whatever it points to; nothing outside the source gets
  into a package. Links matching the exclude list are ignored.
- **Lock:** if `ledger.lock` exists, a writing command fails and prints who
  holds it. `doctor --fix` removes a stale lock, deletes leftover `.tmp-*`
  folders and updates the package index (existing records are kept).

## Python API

```python
from simready.package import PackageSpec, Workspace, package_to

ws = Workspace.init("acme-ws", license_id="cc-by-4.0")  # or Workspace.find()
spec = PackageSpec("assets/crate_a01", "simready.hf.acme.simready-assets.crate_a01", root_usds=["sm_crate_a01.usd"])
ref = ws.packages.package(spec).ref
inst = ws.installs.install(ref)
ws.installs.record_derivation(inst.key, {"tool": "simready-derive", "profile_id": "Prop-Robotics"})
result = ws.installs.package(inst.key, bump="minor")  # created / unchanged

package_to(
    PackageSpec("assets/crate_a01", "name", "cc-by-4.0", "1.0.0", root_usds=["sm_crate_a01.usd"]),
    out_dir="dist/crate_a01",
)
```

## Dependencies

- `ovpackage` (module `wrapp`): only its package-standard hash functions and
  file models are used, so packages are byte-compatible with ovpackage's. No
  `.<name>.wrapp` file is ever written or read.
- `simready-validate` and `usd-validation-nvidia`: validation. The profiles
  (`Package-Candidate`, `Package`) come from an installed validation tier such
  as `simready-foundation-tier-core` (not a dependency), or from the paths in
  `[validation]` of `simready-workspace.toml`.
- OpenUSD (`pxr`): supplied by the host environment (Kit, USD Exchange) or by
  the `[usd]` extra, which installs `usd-core`. Do not combine `usd-core` with
  USD Exchange.

## Not in this first pass

- Batch packaging.
