Skip to main content

cvsx2mvsx

cvsx2mvsx is a Python library and CLI tool designed to convert CVSX archives into MVSX or MVStory formats.

Installation

pip install cvsx2mvsx

CLI Usage

Convert a CVSX file to an MVSX archive:

uvx cvsx2mvsx --input examples/emd-1832.cvsx --output output.mvsx --format mvsx

Convert a CVSX file to the MVStory format:

uvx cvsx2mvsx --input examples/emd-1832.cvsx --output output.mvstory --format mvstory

Lattice to Mesh Conversion

If your input CVSX contains Lattice segmentations (voxel masks) and you wish to convert them to meshes via Marching Cubes rather than keeping them as volumes:

uvx cvsx2mvsx --input examples/emd-1832.cvsx --output output.mvsx --lattice-to-mesh

Arguments

Argument Description Default
--input Path to the input .cvsx file. Required
--output Path to the output file (.mvsx or .mvstory). Required
--format Output format type (mvsx or mvstory). mvsx
--lattice-to-mesh Enable Marching Cubes conversion for lattice data. False

Python API Usage

MVSX Pipeline

To create an MVSX file, you define a pipeline that extracts, transforms to the internal model, transforms to MVSX state, and loads to disk.

# 1. Declare the pipeline structure
pipeline = Pipeline([
    ExtractCVSX(),
    TransformToInternal(),
    TransformToMVSX(),
    LoadMVSX()
])

# 2. Define run configuration
config = PipelineConfig(
      input_path="path/to/input.cvsx",
      output_path="path/to/output.mvsx",
      lattice_to_mesh=True,
)

# 3. Execute
pipeline.run(config)

MVStory Pipeline

To create a Story, simply swap the transformation and loading steps of the MVSX pipeline:

pipeline = Pipeline([
    ExtractCVSX(),
    TransformToInternal(),
    TransformToMVStory(),
    LoadMVStory()
])

config = PipelineConfig(
      input_path="path/to/input.cvsx",
      output_path="path/to/output.mvstory",
      lattice_to_mesh=True,
)


pipeline.run(config)

Architecture

The library follows a ETL (Extract, Transform, Load) Pipeline pattern.

Core Concepts

  1. Pipeline: A container that executes a list of steps sequentially. It manages the lifecycle of the process.
  2. Context: A shared state object passed between steps. It manages configuration, holds a temporary working directory for intermediate files, and cleans up resources automatically after execution.
  3. Steps: Discrete units of logic that implement a generic interface.

The Pipeline Flow

  1. Extract (ExtractCVSX):
    • Unzips the .cvsx archive into the pipeline context temp directory.
    • Parses index.json, metadata, and BinaryCIF files using ciftools.
  2. Transform (TransformToInternal):
    • Converts CVSX data into a normalized InternalEntry model.
    • Handles complex logic like Lattice-to-Mesh conversion (Marching Cubes).
  3. Transform (TransformToMVSX / TransformToMVStory):
    • Converts the InternalEntry into format-specific representations (MVSX or MVStory).
  4. Load (LoadMVSX / LoadMVStory):
    • Packages the processed assets and state into the final binary output file.

Metadata

Release files for cvsx2mvsx 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cvsx2mvsx 1.0.0
File Size Uploaded
cvsx2mvsx-1.0.0.tar.gz 211.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cvsx2mvsx 1.0.0
File Interpreter ABI Platform
cvsx2mvsx-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 292.1 kB

Release files / cvsx2mvsx-1.0.0.tar.gz

Download URL cvsx2mvsx-1.0.0.tar.gz
Size 211.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f44e0892d8b88879b5521a2d3ebbe6f84b49fba12aff8c4d466627c88c7396b9
BLAKE2b-256 checksum
How to use checksums
27266fbcd737b97443d2f0c33cbaf6ec995cc8f95b9b40bf8b6f84b4c5b01629
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cvsx2mvsx-1.0.0-py3-none-any.whl

Download URL cvsx2mvsx-1.0.0-py3-none-any.whl
Size 80.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
471cc74954a74066e7dc1da9408a31e23b9026257d061e572aea5dccf98e15c7
BLAKE2b-256 checksum
How to use checksums
17249756ee338669c07b9ae21f0b90f73c5cb504e96569b2d8be19859df39507
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page