SSMD bundle workspaces
SSMDConvert stores converted books and single documents in one kind-neutral artifact lifecycle. The manifest identifies whether a bundle contains a book or a document; users do not choose a storage type.
Canonical names
An editable workspace is a directory named <name>.ssmd-bundle/. A portable,
immutable archive is named <name>.ssmd-bundle.zip. Both contain the existing
kind-specific manifest format and schema version; the outer artifact name is
shared.
novel.ssmd-bundle/
novel.ssmd-bundle.zip
notes.ssmd-bundle/
notes.ssmd-bundle.zip
Convert and inspect
ssmdconvert bundle inspect novel.epub --json
ssmdconvert bundle convert novel.epub --chapters 2-20 -o novel.ssmd-bundle
ssmdconvert bundle convert notes.md -o notes.ssmd-bundle
ssmdconvert bundle convert reviewed.ssmd.md
ssmdconvert bundle validate novel.ssmd-bundle
When the output is omitted, conversion creates a directory workspace beside the
source using its filename stem. --force replaces the complete existing
workspace atomically. bundle inspect accepts a supported source or a canonical
bundle and reports the detected kind.
--chapters selects original, one-based source chapter numbers for books. A
single document accepts the default all value; another chapter selector is a
usage error. Book chapters remain in source order.
Lifecycle commands
The bundle command group contains exactly these lifecycle operations:
inspect SOURCEinspects a supported source or bundle.convert SOURCEcreates an editable workspace.metadata BUNDLEdisplays stored metadata.refresh WORKSPACEupdates recorded content digests;--checkonly checks whether the workspace is clean.pack WORKSPACEcreates a deterministic.ssmd-bundle.ziparchive.validate BUNDLEstrictly checks the manifest and referenced content.
Only a directory workspace can be refreshed or packed. ZIP archives are
read-only. validate and strict bundle loading verify manifest hashes; analysis
workflows can read current valid content from a dirty directory workspace
without silently refreshing it. Packing reads current valid workspace content
and does not change the workspace manifest.
ssmdconvert bundle metadata notes.ssmd-bundle --json
ssmdconvert bundle refresh notes.ssmd-bundle --check
ssmdconvert bundle refresh notes.ssmd-bundle
ssmdconvert bundle pack notes.ssmd-bundle
ssmdconvert bundle validate notes.ssmd-bundle.zip
Python API
The public storage API is kind-neutral. Internal manifest formats continue to dispatch to their existing validators.
from ssmdconvert import (
convert_bundle,
load_bundle,
pack_bundle,
refresh_bundle_workspace,
validate_bundle,
)
result = convert_bundle("novel.epub", output="novel.ssmd-bundle")
loaded = load_bundle(result.output)
assert loaded.kind == "book"
workspace = refresh_bundle_workspace("novel.ssmd-bundle")
archive = pack_bundle("novel.ssmd-bundle")
assert validate_bundle(archive) == workspace.kind
See the Python API reference, analysis workflows, and manifest implementation details for further information.