YAML Import/Export#
Batch import and export of documents and items in YAML format.
- jamb.yaml_io.export_to_yaml(output_path, prefixes=None, root=None)[source]#
Export document tree to YAML file.
- jamb.yaml_io.export_items_to_yaml(output_path, item_uids, include_neighbors=False, prefixes=None, root=None)[source]#
Export specific items (and optionally their neighbors) to YAML file.
- jamb.yaml_io.import_from_yaml(path, dry_run=False, update=False, verbose=False, echo=None)[source]#
Import documents and items from YAML file.
- Parameters:
path (
Path) – Path to YAML file.dry_run (
bool) – If True, don’t make changes, just report what would happen.update (
bool) – If True, update existing items instead of skipping them.verbose (
bool) – If True, print verbose output.echo (
Callable[[str],object] |None) – Optional function for output (defaults to print).
- Returns:
- {‘documents_created’, ‘items_created’,
’items_updated’, ‘skipped’}
- Return type:
Dict with counts