polystore 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tristan Simas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,249 @@
1
+ Metadata-Version: 2.4
2
+ Name: polystore
3
+ Version: 0.1.2
4
+ Summary: Framework-agnostic multi-backend storage abstraction for ML and scientific computing
5
+ Author-email: Tristan Simas <tristan.simas@mail.mcgill.ca>
6
+ License: MIT License
7
+ Project-URL: Homepage, https://github.com/trissim/polystore
8
+ Project-URL: Documentation, https://polystore.readthedocs.io
9
+ Project-URL: Bug Reports, https://github.com/trissim/polystore/issues
10
+ Project-URL: Source, https://github.com/trissim/polystore
11
+ Keywords: storage,backend,multi-framework,numpy,pytorch,jax,tensorflow,zarr,io,data
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: numpy>=1.26.0
25
+ Requires-Dist: portalocker>=2.8.0
26
+ Requires-Dist: metaclass-registry>=0.1.0
27
+ Provides-Extra: zarr
28
+ Requires-Dist: zarr<3.0,>=2.18.0; extra == "zarr"
29
+ Requires-Dist: ome-zarr>=0.11.0; extra == "zarr"
30
+ Provides-Extra: torch
31
+ Requires-Dist: torch>=2.0.0; extra == "torch"
32
+ Provides-Extra: jax
33
+ Requires-Dist: jax>=0.4.0; extra == "jax"
34
+ Provides-Extra: tensorflow
35
+ Requires-Dist: tensorflow>=2.12.0; extra == "tensorflow"
36
+ Provides-Extra: cupy
37
+ Requires-Dist: cupy>=12.0.0; extra == "cupy"
38
+ Provides-Extra: streaming
39
+ Requires-Dist: pyzmq>=25.0.0; extra == "streaming"
40
+ Provides-Extra: all
41
+ Requires-Dist: zarr<3.0,>=2.18.0; extra == "all"
42
+ Requires-Dist: ome-zarr>=0.11.0; extra == "all"
43
+ Requires-Dist: torch>=2.0.0; extra == "all"
44
+ Requires-Dist: jax>=0.4.0; extra == "all"
45
+ Requires-Dist: tensorflow>=2.12.0; extra == "all"
46
+ Requires-Dist: cupy>=12.0.0; extra == "all"
47
+ Requires-Dist: pyzmq>=25.0.0; extra == "all"
48
+ Provides-Extra: dev
49
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
50
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
51
+ Requires-Dist: coverage>=7.3.2; extra == "dev"
52
+ Requires-Dist: genbadge[coverage]; extra == "dev"
53
+ Requires-Dist: black>=23.0.0; extra == "dev"
54
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
55
+ Provides-Extra: docs
56
+ Requires-Dist: sphinx>=4.0.0; extra == "docs"
57
+ Requires-Dist: sphinx-rtd-theme>=1.0.0; extra == "docs"
58
+ Requires-Dist: sphinx-toolbox>=3.0.0; extra == "docs"
59
+ Requires-Dist: sphinx-design>=0.5.0; extra == "docs"
60
+ Dynamic: license-file
61
+
62
+ # polystore
63
+
64
+ **Framework-agnostic multi-backend storage abstraction for ML and scientific computing**
65
+
66
+ [![PyPI version](https://badge.fury.io/py/polystore.svg)](https://badge.fury.io/py/polystore)
67
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
68
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
69
+
70
+ ## Features
71
+
72
+ - **Pluggable Backends**: Disk, memory, Zarr, and streaming backends with auto-registration
73
+ - **Multi-Framework I/O**: Seamless support for NumPy, PyTorch, JAX, TensorFlow, CuPy
74
+ - **Atomic Operations**: Cross-platform atomic file writes with automatic locking
75
+ - **Batch Operations**: Efficient batch loading and saving
76
+ - **Format Detection**: Automatic format detection and routing
77
+ - **Type-Safe**: Full type hints and mypy support
78
+ - **Zero Dependencies**: Core requires only NumPy (framework support is optional)
79
+
80
+ ## Quick Start
81
+
82
+ ```python
83
+ from polystore import FileManager, BackendRegistry
84
+
85
+ # Create registry and file manager
86
+ registry = BackendRegistry()
87
+ fm = FileManager(registry)
88
+
89
+ # Save data to disk
90
+ import numpy as np
91
+ data = np.array([[1, 2], [3, 4]])
92
+ fm.save(data, "output.npy", backend="disk")
93
+
94
+ # Load data back
95
+ loaded = fm.load("output.npy", backend="disk")
96
+
97
+ # Use memory backend for testing
98
+ fm.save(data, "test.npy", backend="memory")
99
+ cached = fm.load("test.npy", backend="memory")
100
+ ```
101
+
102
+ ## Installation
103
+
104
+ ```bash
105
+ # Base installation (NumPy only)
106
+ pip install polystore
107
+
108
+ # With specific frameworks
109
+ pip install polystore[zarr]
110
+ pip install polystore[torch]
111
+ pip install polystore[jax]
112
+ pip install polystore[tensorflow]
113
+ pip install polystore[cupy]
114
+
115
+ # With streaming support
116
+ pip install polystore[streaming]
117
+
118
+ # With all optional dependencies
119
+ pip install polystore[all]
120
+ ```
121
+
122
+ ## Supported Backends
123
+
124
+ | Backend | Description | Storage | Dependencies |
125
+ |---------|-------------|---------|--------------|
126
+ | **disk** | Local filesystem | Persistent | None |
127
+ | **memory** | In-memory cache | Volatile | None |
128
+ | **zarr** | Zarr/OME-Zarr arrays | Persistent | zarr, ome-zarr |
129
+ | **streaming** | ZeroMQ streaming | None | pyzmq |
130
+
131
+ ## Supported Formats
132
+
133
+ | Format | Extensions | Frameworks |
134
+ |--------|-----------|------------|
135
+ | **NumPy** | `.npy`, `.npz` | NumPy, PyTorch, JAX, TensorFlow, CuPy |
136
+ | **TIFF** | `.tif`, `.tiff` | NumPy, PyTorch, JAX, TensorFlow, CuPy |
137
+ | **Zarr** | `.zarr` | NumPy, PyTorch, JAX, TensorFlow, CuPy |
138
+ | **PyTorch** | `.pt`, `.pth` | PyTorch |
139
+ | **CSV** | `.csv` | NumPy, pandas |
140
+ | **JSON** | `.json` | Python dicts |
141
+
142
+ ## Architecture
143
+
144
+ ```
145
+ polystore/
146
+ ├── base.py # Abstract interfaces (DataSink, DataSource, StorageBackend)
147
+ ├── backend_registry.py # Auto-registration system
148
+ ├── disk.py # Disk storage backend
149
+ ├── memory.py # In-memory backend
150
+ ├── zarr.py # Zarr backend
151
+ ├── streaming.py # ZeroMQ streaming backend
152
+ ├── filemanager.py # High-level API
153
+ ├── atomic.py # Atomic file operations
154
+ └── exceptions.py # Custom exceptions
155
+ ```
156
+
157
+ ## Advanced Usage
158
+
159
+ ### Custom Backends
160
+
161
+ ```python
162
+ from polystore import StorageBackend
163
+
164
+ class MyBackend(StorageBackend):
165
+ _backend_type = 'my_backend' # Auto-registers
166
+
167
+ def save(self, data, file_path, **kwargs):
168
+ # Your save logic
169
+ pass
170
+
171
+ def load(self, file_path, **kwargs):
172
+ # Your load logic
173
+ pass
174
+ ```
175
+
176
+ ### Batch Operations
177
+
178
+ ```python
179
+ # Save multiple files
180
+ data_list = [np.random.rand(100, 100) for _ in range(10)]
181
+ paths = [f"image_{i}.npy" for i in range(10)]
182
+ fm.save_batch(data_list, paths, backend="disk")
183
+
184
+ # Load multiple files
185
+ loaded_list = fm.load_batch(paths, backend="disk")
186
+ ```
187
+
188
+ ### Atomic Writes
189
+
190
+ ```python
191
+ from polystore import atomic_write, atomic_write_json
192
+
193
+ # Atomic file write with automatic locking
194
+ with atomic_write("output.txt") as f:
195
+ f.write("data")
196
+
197
+ # Atomic JSON write
198
+ atomic_write_json({"key": "value"}, "config.json")
199
+ ```
200
+
201
+ ## Why polystore?
202
+
203
+ **Before** (Manual backend management):
204
+ ```python
205
+ if backend == 'disk':
206
+ np.save(path, data)
207
+ elif backend == 'memory':
208
+ cache[path] = data
209
+ elif backend == 'zarr':
210
+ zarr.save(path, data)
211
+ # ... 50 more lines of if/elif ...
212
+ ```
213
+
214
+ **After** (polystore):
215
+ ```python
216
+ fm.save(data, path, backend=backend)
217
+ ```
218
+
219
+ ## Documentation
220
+
221
+ Full documentation available at [polystore.readthedocs.io](https://polystore.readthedocs.io)
222
+
223
+ ## Addons
224
+
225
+ Extend polystore with additional backends:
226
+
227
+ - **polystore-napari**: Napari viewer streaming backend
228
+ - **polystore-fiji**: Fiji/ImageJ streaming backend
229
+ - **polystore-omero**: OMERO server backend
230
+
231
+ ## Performance
232
+
233
+ - **Zero-copy** conversions between frameworks via DLPack (when possible)
234
+ - **Lazy loading** for optional dependencies
235
+ - **Batch operations** for efficient I/O
236
+ - **Atomic writes** with minimal overhead
237
+
238
+ ## License
239
+
240
+ MIT License - see LICENSE file for details
241
+
242
+ ## Contributing
243
+
244
+ Contributions welcome! Please see CONTRIBUTING.md for guidelines.
245
+
246
+ ## Credits
247
+
248
+ Developed by Tristan Simas. Extracted from the [OpenHCS](https://github.com/trissim/openhcs) project.
249
+
@@ -0,0 +1,188 @@
1
+ # polystore
2
+
3
+ **Framework-agnostic multi-backend storage abstraction for ML and scientific computing**
4
+
5
+ [![PyPI version](https://badge.fury.io/py/polystore.svg)](https://badge.fury.io/py/polystore)
6
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+
9
+ ## Features
10
+
11
+ - **Pluggable Backends**: Disk, memory, Zarr, and streaming backends with auto-registration
12
+ - **Multi-Framework I/O**: Seamless support for NumPy, PyTorch, JAX, TensorFlow, CuPy
13
+ - **Atomic Operations**: Cross-platform atomic file writes with automatic locking
14
+ - **Batch Operations**: Efficient batch loading and saving
15
+ - **Format Detection**: Automatic format detection and routing
16
+ - **Type-Safe**: Full type hints and mypy support
17
+ - **Zero Dependencies**: Core requires only NumPy (framework support is optional)
18
+
19
+ ## Quick Start
20
+
21
+ ```python
22
+ from polystore import FileManager, BackendRegistry
23
+
24
+ # Create registry and file manager
25
+ registry = BackendRegistry()
26
+ fm = FileManager(registry)
27
+
28
+ # Save data to disk
29
+ import numpy as np
30
+ data = np.array([[1, 2], [3, 4]])
31
+ fm.save(data, "output.npy", backend="disk")
32
+
33
+ # Load data back
34
+ loaded = fm.load("output.npy", backend="disk")
35
+
36
+ # Use memory backend for testing
37
+ fm.save(data, "test.npy", backend="memory")
38
+ cached = fm.load("test.npy", backend="memory")
39
+ ```
40
+
41
+ ## Installation
42
+
43
+ ```bash
44
+ # Base installation (NumPy only)
45
+ pip install polystore
46
+
47
+ # With specific frameworks
48
+ pip install polystore[zarr]
49
+ pip install polystore[torch]
50
+ pip install polystore[jax]
51
+ pip install polystore[tensorflow]
52
+ pip install polystore[cupy]
53
+
54
+ # With streaming support
55
+ pip install polystore[streaming]
56
+
57
+ # With all optional dependencies
58
+ pip install polystore[all]
59
+ ```
60
+
61
+ ## Supported Backends
62
+
63
+ | Backend | Description | Storage | Dependencies |
64
+ |---------|-------------|---------|--------------|
65
+ | **disk** | Local filesystem | Persistent | None |
66
+ | **memory** | In-memory cache | Volatile | None |
67
+ | **zarr** | Zarr/OME-Zarr arrays | Persistent | zarr, ome-zarr |
68
+ | **streaming** | ZeroMQ streaming | None | pyzmq |
69
+
70
+ ## Supported Formats
71
+
72
+ | Format | Extensions | Frameworks |
73
+ |--------|-----------|------------|
74
+ | **NumPy** | `.npy`, `.npz` | NumPy, PyTorch, JAX, TensorFlow, CuPy |
75
+ | **TIFF** | `.tif`, `.tiff` | NumPy, PyTorch, JAX, TensorFlow, CuPy |
76
+ | **Zarr** | `.zarr` | NumPy, PyTorch, JAX, TensorFlow, CuPy |
77
+ | **PyTorch** | `.pt`, `.pth` | PyTorch |
78
+ | **CSV** | `.csv` | NumPy, pandas |
79
+ | **JSON** | `.json` | Python dicts |
80
+
81
+ ## Architecture
82
+
83
+ ```
84
+ polystore/
85
+ ├── base.py # Abstract interfaces (DataSink, DataSource, StorageBackend)
86
+ ├── backend_registry.py # Auto-registration system
87
+ ├── disk.py # Disk storage backend
88
+ ├── memory.py # In-memory backend
89
+ ├── zarr.py # Zarr backend
90
+ ├── streaming.py # ZeroMQ streaming backend
91
+ ├── filemanager.py # High-level API
92
+ ├── atomic.py # Atomic file operations
93
+ └── exceptions.py # Custom exceptions
94
+ ```
95
+
96
+ ## Advanced Usage
97
+
98
+ ### Custom Backends
99
+
100
+ ```python
101
+ from polystore import StorageBackend
102
+
103
+ class MyBackend(StorageBackend):
104
+ _backend_type = 'my_backend' # Auto-registers
105
+
106
+ def save(self, data, file_path, **kwargs):
107
+ # Your save logic
108
+ pass
109
+
110
+ def load(self, file_path, **kwargs):
111
+ # Your load logic
112
+ pass
113
+ ```
114
+
115
+ ### Batch Operations
116
+
117
+ ```python
118
+ # Save multiple files
119
+ data_list = [np.random.rand(100, 100) for _ in range(10)]
120
+ paths = [f"image_{i}.npy" for i in range(10)]
121
+ fm.save_batch(data_list, paths, backend="disk")
122
+
123
+ # Load multiple files
124
+ loaded_list = fm.load_batch(paths, backend="disk")
125
+ ```
126
+
127
+ ### Atomic Writes
128
+
129
+ ```python
130
+ from polystore import atomic_write, atomic_write_json
131
+
132
+ # Atomic file write with automatic locking
133
+ with atomic_write("output.txt") as f:
134
+ f.write("data")
135
+
136
+ # Atomic JSON write
137
+ atomic_write_json({"key": "value"}, "config.json")
138
+ ```
139
+
140
+ ## Why polystore?
141
+
142
+ **Before** (Manual backend management):
143
+ ```python
144
+ if backend == 'disk':
145
+ np.save(path, data)
146
+ elif backend == 'memory':
147
+ cache[path] = data
148
+ elif backend == 'zarr':
149
+ zarr.save(path, data)
150
+ # ... 50 more lines of if/elif ...
151
+ ```
152
+
153
+ **After** (polystore):
154
+ ```python
155
+ fm.save(data, path, backend=backend)
156
+ ```
157
+
158
+ ## Documentation
159
+
160
+ Full documentation available at [polystore.readthedocs.io](https://polystore.readthedocs.io)
161
+
162
+ ## Addons
163
+
164
+ Extend polystore with additional backends:
165
+
166
+ - **polystore-napari**: Napari viewer streaming backend
167
+ - **polystore-fiji**: Fiji/ImageJ streaming backend
168
+ - **polystore-omero**: OMERO server backend
169
+
170
+ ## Performance
171
+
172
+ - **Zero-copy** conversions between frameworks via DLPack (when possible)
173
+ - **Lazy loading** for optional dependencies
174
+ - **Batch operations** for efficient I/O
175
+ - **Atomic writes** with minimal overhead
176
+
177
+ ## License
178
+
179
+ MIT License - see LICENSE file for details
180
+
181
+ ## Contributing
182
+
183
+ Contributions welcome! Please see CONTRIBUTING.md for guidelines.
184
+
185
+ ## Credits
186
+
187
+ Developed by Tristan Simas. Extracted from the [OpenHCS](https://github.com/trissim/openhcs) project.
188
+
@@ -0,0 +1,167 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "polystore"
7
+ dynamic = ["version"]
8
+ description = "Framework-agnostic multi-backend storage abstraction for ML and scientific computing"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = {text = "MIT License"}
12
+ authors = [
13
+ {name = "Tristan Simas", email = "tristan.simas@mail.mcgill.ca"}
14
+ ]
15
+ keywords = [
16
+ "storage",
17
+ "backend",
18
+ "multi-framework",
19
+ "numpy",
20
+ "pytorch",
21
+ "jax",
22
+ "tensorflow",
23
+ "zarr",
24
+ "io",
25
+ "data",
26
+ ]
27
+ classifiers = [
28
+ "Development Status :: 3 - Alpha",
29
+ "Intended Audience :: Developers",
30
+ "Intended Audience :: Science/Research",
31
+ "License :: OSI Approved :: MIT License",
32
+ "Programming Language :: Python :: 3",
33
+ "Programming Language :: Python :: 3.11",
34
+ "Programming Language :: Python :: 3.12",
35
+ "Topic :: Scientific/Engineering",
36
+ "Topic :: Software Development :: Libraries :: Python Modules",
37
+ ]
38
+
39
+ dependencies = [
40
+ "numpy>=1.26.0",
41
+ "portalocker>=2.8.0", # Cross-platform file locking
42
+ "metaclass-registry>=0.1.0",
43
+ ]
44
+
45
+ [project.optional-dependencies]
46
+ zarr = [
47
+ "zarr>=2.18.0,<3.0",
48
+ "ome-zarr>=0.11.0",
49
+ ]
50
+
51
+ torch = [
52
+ "torch>=2.0.0",
53
+ ]
54
+
55
+ jax = [
56
+ "jax>=0.4.0",
57
+ ]
58
+
59
+ tensorflow = [
60
+ "tensorflow>=2.12.0",
61
+ ]
62
+
63
+ cupy = [
64
+ "cupy>=12.0.0",
65
+ ]
66
+
67
+ streaming = [
68
+ "pyzmq>=25.0.0",
69
+ ]
70
+
71
+ all = [
72
+ "zarr>=2.18.0,<3.0",
73
+ "ome-zarr>=0.11.0",
74
+ "torch>=2.0.0",
75
+ "jax>=0.4.0",
76
+ "tensorflow>=2.12.0",
77
+ "cupy>=12.0.0",
78
+ "pyzmq>=25.0.0",
79
+ ]
80
+
81
+ dev = [
82
+ "pytest>=7.4.0",
83
+ "pytest-cov>=4.1.0",
84
+ "coverage>=7.3.2",
85
+ "genbadge[coverage]",
86
+ "black>=23.0.0",
87
+ "ruff>=0.1.0",
88
+ ]
89
+
90
+ docs = [
91
+ "sphinx>=4.0.0",
92
+ "sphinx-rtd-theme>=1.0.0",
93
+ "sphinx-toolbox>=3.0.0",
94
+ "sphinx-design>=0.5.0",
95
+ ]
96
+
97
+ [project.urls]
98
+ Homepage = "https://github.com/trissim/polystore"
99
+ Documentation = "https://polystore.readthedocs.io"
100
+ "Bug Reports" = "https://github.com/trissim/polystore/issues"
101
+ Source = "https://github.com/trissim/polystore"
102
+
103
+ [tool.setuptools.packages.find]
104
+ where = ["src"]
105
+ include = ["polystore*"]
106
+
107
+ [tool.setuptools.dynamic]
108
+ version = {attr = "polystore.__version__"}
109
+
110
+ [tool.pytest.ini_options]
111
+ testpaths = ["tests"]
112
+ python_files = ["test_*.py"]
113
+ python_classes = ["Test*"]
114
+ python_functions = ["test_*"]
115
+ addopts = [
116
+ "--strict-markers",
117
+ "--strict-config",
118
+ "--cov=polystore",
119
+ "--cov-report=term-missing",
120
+ "--cov-report=html",
121
+ "--cov-report=xml",
122
+ ]
123
+
124
+ [tool.coverage.run]
125
+ source = ["polystore"]
126
+ omit = [
127
+ "*/tests/*",
128
+ "*/test_*.py",
129
+ ]
130
+
131
+ [tool.coverage.report]
132
+ exclude_lines = [
133
+ "pragma: no cover",
134
+ "def __repr__",
135
+ "raise AssertionError",
136
+ "raise NotImplementedError",
137
+ "if __name__ == .__main__.:",
138
+ "if TYPE_CHECKING:",
139
+ "class .*\\bProtocol\\):",
140
+ "@(abc\\.)?abstractmethod",
141
+ ]
142
+
143
+ [tool.black]
144
+ line-length = 100
145
+ target-version = ["py311", "py312"]
146
+
147
+ [tool.ruff]
148
+ line-length = 100
149
+ target-version = "py311"
150
+ select = [
151
+ "E", # pycodestyle errors
152
+ "W", # pycodestyle warnings
153
+ "F", # pyflakes
154
+ "I", # isort
155
+ "B", # flake8-bugbear
156
+ "C4", # flake8-comprehensions
157
+ "UP", # pyupgrade
158
+ ]
159
+ ignore = [
160
+ "E501", # line too long (handled by black)
161
+ "B008", # do not perform function calls in argument defaults
162
+ "C901", # too complex
163
+ ]
164
+
165
+ [tool.ruff.per-file-ignores]
166
+ "__init__.py" = ["F401"] # unused imports
167
+
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,80 @@
1
+ """
2
+ Polystore - Framework-agnostic multi-backend storage abstraction.
3
+
4
+ Provides pluggable storage backends with multi-framework I/O support for
5
+ NumPy, PyTorch, JAX, TensorFlow, CuPy, and Zarr.
6
+ """
7
+
8
+ __version__ = "0.1.2"
9
+
10
+ # Core abstractions
11
+ from .base import (
12
+ DataSink,
13
+ DataSource,
14
+ StorageBackend,
15
+ VirtualBackend,
16
+ ReadOnlyBackend,
17
+ )
18
+
19
+ # Concrete backends
20
+ from .memory import MemoryBackend
21
+ from .disk import DiskBackend
22
+
23
+ # Optional backends
24
+ try:
25
+ from .zarr import ZarrBackend
26
+ except ImportError:
27
+ ZarrBackend = None
28
+
29
+ # File manager
30
+ from .filemanager import FileManager
31
+
32
+ # Registry
33
+ from .backend_registry import BackendRegistry, create_storage_registry
34
+
35
+ # Atomic operations
36
+ from .atomic import atomic_write, atomic_write_json
37
+
38
+ # Exceptions
39
+ from .exceptions import (
40
+ StorageError,
41
+ StorageResolutionError,
42
+ BackendNotFoundError,
43
+ UnsupportedFormatError,
44
+ )
45
+
46
+ # Streaming (optional)
47
+ try:
48
+ from .streaming import StreamingBackend
49
+ except ImportError:
50
+ StreamingBackend = None
51
+
52
+ __all__ = [
53
+ # Version
54
+ "__version__",
55
+ # Core abstractions
56
+ "DataSink",
57
+ "DataSource",
58
+ "StorageBackend",
59
+ "VirtualBackend",
60
+ "ReadOnlyBackend",
61
+ # Backends
62
+ "MemoryBackend",
63
+ "DiskBackend",
64
+ "ZarrBackend",
65
+ # File manager
66
+ "FileManager",
67
+ # Registry
68
+ "BackendRegistry",
69
+ # Atomic operations
70
+ "atomic_write",
71
+ "atomic_write_json",
72
+ # Exceptions
73
+ "StorageError",
74
+ "StorageResolutionError",
75
+ "BackendNotFoundError",
76
+ "UnsupportedFormatError",
77
+ # Streaming
78
+ "StreamingBackend",
79
+ ]
80
+