Framework-agnostic storage primitives for scientific applications.
PolyStore owns backend interfaces, execution-local backend registries,
FileManager routing, storage formats, ROI values, virtual-workspace source
references, and viewer-streaming payload mechanics. Applications retain
ownership of domain artifact names and materialization policy.
Pass an explicit mapping of backend names to instances. FileManager has no
global fallback and does not infer a backend from a path.
frompathlibimportPathimportnumpyasnpfrompolystoreimportDiskBackend, FileManager, MemoryBackendregistry= {
"disk": DiskBackend(),
"memory": MemoryBackend(),
}
files=FileManager(registry)
data=np.arange(6).reshape(2, 3)
files.save(data, Path("output.npy"), backend="disk")
loaded=files.load(Path("output.npy"), backend="disk")For application startup where every discoverable context-free backend is wanted, use the package-owned lazy registry:
frompolystoreimportFileManager, ensure_storage_registry, storage_registryensure_storage_registry()
files=FileManager(dict(storage_registry))Backends requiring context-specific construction, including virtual workspaces and OMERO, must be instantiated by the application and added to its registry.
Concrete backends inherit DataSource, DataSink, StorageBackend, or
ReadOnlyBackend and declare their backend key. The authoritative class
catalog is BackendBase.__registry__ (also exported as
STORAGE_BACKENDS). Do not build a second backend class table.
python -m pip install polystoreThe core install includes NumPy, ArrayBridge, metaclass-registry, file locking, image I/O, and Zarr/OME-Zarr support. Framework and streaming extras add their corresponding optional runtimes.
Full documentation: polystore.readthedocs.io