Skip to content

aegean.bundle

Portable, deterministic, SHA-256-verified research bundles (aegean-research-bundle/1). Packages a corpus (or license-clean retrieval pointer for non-commercial datasets), citations (citations.json, CITATIONS.bib, CITATIONS.txt), workbench workspace state, editable review tables (with .companion.json snapshots), and analysis receipts into a single verifiable .zip archive.

bundle

Portable, verifiable research bundles (aegean-research-bundle/1).

Packages a reproducible research snapshot into a single deterministic .zip archive with SHA-256 member verification, license-clean corpus handling, citations, optional workbench workspace state, review tables (with editable companion snapshots), and analysis receipts.

License-clean by construction: corpora carrying non-commercial (CC BY-NC*) or restricted licenses are never embedded in redistributable bundles by default. Instead, create_bundle records a retrieval pointer (CorpusReference) with the dataset id, version, upstream URL, license, SHA-256, and filter spec so hydrate_bundle can reconstruct the exact corpus under its upstream license. Pass embed_corpus="always" for a private, non-redistributable archive (which stamps redistributable=False in manifest.json).

CorpusReference dataclass

CorpusReference(dataset: str, version: str = '', script_id: str = '', sha256: str = '', url: str = '', license: str = '', filter_spec: dict[str, Any] = dict())

Retrieval pointer for a non-embedded (or NC-licensed) corpus.

BundleMember dataclass

BundleMember(path: str, sha256: str, size: int, kind: str)

Manifest record for one file stored inside the zip bundle.

BundleManifest dataclass

BundleManifest(format: str, pyaegean_version: str, created_at: str, title: str, description: str, redistributable: bool, license_notes: tuple[str, ...], corpus_embedded: bool, corpus_ref: CorpusReference | None, pipeline_config: dict[str, Any] | None, members: tuple[BundleMember, ...])

Top-level manifest stored at manifest.json inside a research bundle.

BundleVerification dataclass

BundleVerification(ok: bool, path: str, format: str, redistributable: bool, checked_members: int, errors: tuple[str, ...] = (), warnings: tuple[str, ...] = ())

Result of verifying a research bundle archive's integrity and safety.

ResearchBundle dataclass

ResearchBundle(manifest: BundleManifest, corpus: 'Corpus | None' = None, workbench_state: 'WorkbenchBackup | None' = None, review_files: dict[str, Path] = dict(), receipts: dict[str, Any] = dict(), citations: list[dict[str, Any]] = list(), metadata: dict[str, Any] = dict())

Hydrated in-memory representation of a research bundle.

is_redistributable_license

is_redistributable_license(license_text: str) -> bool

Return False if license_text indicates NC or restricted terms.

create_bundle

create_bundle(output: str | Path, *, corpus: 'Corpus | None' = None, dataset: str | None = None, dataset_version: str = '', filter_spec: Mapping[str, Any] | None = None, title: str = '', description: str = '', pipeline_config: Any = None, workbench_state: 'WorkbenchBackup | str | Path | None' = None, review_paths: Sequence[str | Path] = (), receipts: Sequence[str | Path | Mapping[str, Any] | Any] = (), citations: Sequence[Mapping[str, Any] | str] = (), metadata: Mapping[str, Any] | None = None, embed_corpus: Literal['auto', 'always', 'never'] = 'auto', created_at: str | None = None) -> BundleManifest

Create a deterministic, SHA-256-verified .zip research bundle.

embed_corpus controls whether the corpus text is packed as corpus.json.gz:

  • "auto" (default): embeds the corpus when its license is redistributable; switches to a license-clean CorpusReference retrieval pointer when the corpus carries a non-commercial (CC BY-NC*) or restricted license.
  • "never": always emits a retrieval pointer without embedding corpus text.
  • "always": embeds the corpus even under non-commercial terms and marks manifest.redistributable = False with an explicit license notice.

inspect_bundle

inspect_bundle(path: str | Path) -> BundleManifest

Read and parse manifest.json from a research bundle without extracting.

verify_bundle

verify_bundle(path: str | Path) -> BundleVerification

Verify bundle structure, path safety, and SHA-256 digests of every member.

extract_bundle

extract_bundle(path: str | Path, dest: str | Path, *, verify: bool = True) -> BundleManifest

Safely verify and unpack all members of a research bundle into dest.

hydrate_bundle

hydrate_bundle(path: str | Path, *, dest: str | Path | None = None, allow_fetch: bool = False, verify: bool = True) -> ResearchBundle

Verify and load a research bundle back into live pyaegean objects.

Loads the embedded corpus (or reconstructs a pointer-referenced corpus via aegean.load, fetching only when allow_fetch=True), workbench workspace backup, citations, receipts, and metadata. When dest is provided, all archive files (including editable review CSVs and .companion.json snapshots) are unpacked there and indexed in ResearchBundle.review_files.