zcollection.create_view#

zcollection.create_view(path, view_ref, *, filesystem=None, filters=None, synchronizer=None)[source]#

Create a new view.

Parameters:
  • path (str) – View storage directory.

  • view_ref (ViewReference) – Access properties for the reference view.

  • filesystem (AbstractFileSystem | str | None) – The file system used to access the view.

  • filters (str | Callable[[Dict[str, int]], bool] | None) – The filters used to select the partitions of the reference view. If not provided, all partitions are selected.

  • synchronizer (Sync | None) – The synchronizer used to synchronize the view.

Return type:

View

Example

>>> view_ref = ViewReference(
...     partition_base_dir="/data/mycollection")
>>> view = create_view("/home/user/myview", view_ref)
Returns:

The created view.

Raises:

ValueError – If the path already exists.

Parameters:
Return type:

View