pycognaize.document.snapshot.Snapshot

class Snapshot(path)[source]

Bases: object

A snapshot of annotated documents from one or more collections

Parameters:

path (str)

Methods

download

Downloads snapshot to specified destination

get

Read the snapshot object from local storage and return it

get_by_id

Returns the Snapshot Object

Attributes

documents

Mapping of document ids to documents :return Mapping: LazyDocumentDict Object

property documents: Mapping

Mapping of document ids to documents :return Mapping: LazyDocumentDict Object

classmethod download(snapshot_id, destination_dir, exclude_images=False, exclude_ocr=False, exclude_pdf=False, exclude_html=False, require_login=True, snapshot_root=None)[source]

Downloads snapshot to specified destination

Parameters:
  • snapshot_id (str)

  • destination_dir (str)

  • exclude_images (bool)

  • exclude_ocr (bool)

  • exclude_pdf (bool)

  • exclude_html (bool)

  • require_login (bool)

  • snapshot_root (str)

Return type:

Tuple[Snapshot, str]

classmethod get()[source]

Read the snapshot object from local storage and return it

Return type:

Snapshot

classmethod get_by_id(snapshot_id)[source]

Returns the Snapshot Object

Parameters:

snapshot_id (str)

Return type:

Snapshot