Metadata-Version: 2.4
Name: mgf-vm-interchange
Version: 0.2.5
Summary: Magogi Foundation VM-interchange — OVA / OVF import/export. Sibling library extracted from vm-vmanager-app.
Project-URL: Documentation, https://codeberg.org/magogi-admin/vm-vmanager-docs
Project-URL: Source, https://codeberg.org/magogi-admin/mgf-vm-interchange
Author: Bassam Alsanie, mgf-vm-interchange contributors
License: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: export,import,mgf,ova,ovf,vm
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: System :: Emulators
Requires-Python: >=3.11
Requires-Dist: defusedxml<0.8,>=0.7
Requires-Dist: mgf-common<1.0,>=0.41
Requires-Dist: mgf-vm-core<0.2,>=0.1.9
Provides-Extra: dev
Requires-Dist: hypothesis<7,>=6.100; extra == 'dev'
Requires-Dist: import-linter<3,>=2.0; extra == 'dev'
Requires-Dist: mgf-test-supervisor<0.2,>=0.1.2; extra == 'dev'
Requires-Dist: mypy<2,>=1.10; extra == 'dev'
Requires-Dist: pytest-cov<7,>=5.0; extra == 'dev'
Requires-Dist: pytest-timeout<3,>=2.3; extra == 'dev'
Requires-Dist: pytest<9,>=8.0; extra == 'dev'
Requires-Dist: ruff<0.16,>=0.4; extra == 'dev'
Provides-Extra: standards
Requires-Dist: mgf-common[standards]<1.0,>=0.46; extra == 'standards'
Description-Content-Type: text/markdown

# mgf-vm-interchange

> **OVA / OVF import-export sibling library for the Magogi Foundation
> distributed vm-vmanager-app.** Parse an `.ova`, extract the OVF spec
> + disk images, translate to engine-neutral `VmSpec`. And the reverse:
> export a `VmSpec` + disks to a portable `.ova`.

| Field | Value |
|---|---|
| **Status** | Pre-`0.1.0`. Extracted per D-C9. |
| **Federation sibling.** | Depends on `mgf-common` + `mgf-vm-core` + `defusedxml`. |
| **Conformance level.** | **L2 — Standard.** Per-rule ledger: [`docs/inprogress/MGF_STANDARDS_CONFORMANCE.md`](docs/inprogress/MGF_STANDARDS_CONFORMANCE.md). |
| **License.** | MIT. |
| **Python.** | 3.11 / 3.12 / 3.13. |

---

## Where the docs live

> **`vm-vmanager-docs`** — `~/PycharmProjects/vm-vmanager-docs/` ·
> Codeberg: `vm-vmanager-docs`

| What | Where |
|---|---|
| Why this is its own sibling (D-C9) | `vm-vmanager-docs/DECISIONS.md` |
| Architecture (registry consumer) | `vm-vmanager-docs/ARCHITECTURE.md` §8 (registry is the cross-platform backbone) |
| Roadmap (Phase 0 Stream F → consumed by CP in Phase 2) | `vm-vmanager-docs/ROADMAP.md` |

---

## What this library is — and why it's a sibling

OVA/OVF is a **portable, vendor-neutral VM packaging format** that
exists outside any one hypervisor. Parsing it well is a real,
reusable capability — incident response tools, migration tools,
cloud-image bakers all want it.

That makes it a sibling per D-C9: lifted out of the old vm-vmanager-app
interchange subsystem, consumed by `vm-vmanager-control-plane`
(for `vmanager image import file.ova`) and available to anyone
else.

## What this library contains

(Phase 0 — sibling extraction from `mgf-vm/src/mgf/vm/interchange/`.)

```
src/mgf/vm/interchange/
├── __init__.py
├── py.typed
├── ova/                 # tar (un)packing with safe-tar discipline (SH-04)
├── ovf/                 # OVF XML parse/render via defusedxml (SH-03)
├── translate.py         # OVF spec ↔ mgf.vm.core.VmSpec
└── exceptions.py        # typed errors at the import/export seam
```

---

## What this library does NOT contain

- **No VM driving.** Translation is to/from `VmSpec`; instantiating
  is the consumer's job (via the SDK + adapters).
- **No registry storage.** Blobs go to the registry's S3 backend
  (`vm-vmanager-control-plane.ImageRegistry`); this library handles
  format conversion, not bytes-at-rest.

---

## Install

```bash
pip install mgf-vm-interchange
```

## Develop

```bash
cd ~/PycharmProjects/mgf_vm_interchange
uv venv --python 3.12
uv sync --extra dev
uv run pytest -q
uv run mypy --strict src/
uv run ruff check src tests
uv run lint-imports
```

## Federation context

Sibling library. Per discipline: `USERS.md`, `STANDARDS_NOTE.md`,
`docs/inprogress/MGF_STANDARDS_CONFORMANCE.md`.

Security: parses OVF from attacker-controlled input. `defusedxml`
mandatory (SH-03). OVA tar extraction validates paths (SC-15).
