You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+20-16Lines changed: 20 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,27 +4,31 @@ Utilities for interacting with object storage, based on [obspec](https://github.
4
4
5
5
## Background
6
6
7
-
`obspec-utils` provides helpful utilities for working with object storage in Python, built on top of obspec and obstore. The library includes:
7
+
`obspec-utils` provides helpful utilities for working with object storage in Python, built on top of obspec and obstore. The library is organized into subpackages:
8
8
9
-
1.**ObjectStoreRegistry**: A registry for managing multiple object stores, allowing you to resolve URLs to the appropriate store and path. This is particularly useful when working with datasets that span multiple storage backends or buckets.
10
-
11
-
2.**ReadableStore Protocol**: A minimal protocol defining the read-only interface required for object storage access. This allows alternative backends (like aiohttp) to be used instead of obstore.
12
-
13
-
3.**File Handlers**: Wrappers around obstore's file reading capabilities that provide a familiar file-like interface.
-**`obspec_utils.stores`**: Alternative store implementations (e.g., [`AiohttpStore`][obspec_utils.stores.AiohttpStore] for generic HTTP access)
15
+
-**`obspec_utils.wrappers`**: Composable store wrappers for caching, tracing, and parallel fetching
16
+
-**`obspec_utils.registry`**: [`ObjectStoreRegistry`][obspec_utils.registry.ObjectStoreRegistry] for managing multiple stores and resolving URLs
14
17
15
18
## Design Philosophy
16
19
17
20
The library is designed around **protocols rather than concrete classes**. The `ObjectStoreRegistry` accepts any object that implements the `ReadableStore` protocol, which means:
18
21
19
-
-**obstore classes** (S3Store, HTTPStore, GCSStore, etc.) work out of the box
20
-
-**Custom implementations** (like the included `AiohttpStore`) can be used as alternatives
For generic HTTPS access where obstore's HTTPStore may not be ideal, you can use the `AiohttpStore`:
62
+
For generic HTTPS access where obstore's HTTPStore may not be ideal, you can use the [`AiohttpStore`][obspec_utils.stores.AiohttpStore]:
59
63
60
64
```python
61
65
from obspec_utils.registry import ObjectStoreRegistry
62
-
from obspec_utils.aiohttpimport AiohttpStore
66
+
from obspec_utils.storesimport AiohttpStore
63
67
64
68
# Create an aiohttp-based store for a THREDDS server
65
69
store = AiohttpStore(
@@ -77,18 +81,18 @@ data = await store.get_range_async(path, start=0, end=1000)
77
81
78
82
### File Handlers
79
83
80
-
The file handlers provide file-like interfaces (read, seek, tell) for reading from object stores. They work with **any** ReadableStore implementation:
84
+
The file handlers provide file-like interfaces (read, seek, tell) for reading from object stores. They work with **any**[`ReadableStore`][obspec_utils.readers.ReadableStore] implementation:
81
85
82
86
```python
83
-
from obspec_utils.obspecimport BufferedStoreReader, EagerStoreReader, ParallelStoreReader
87
+
from obspec_utils.readersimport BufferedStoreReader, EagerStoreReader, ParallelStoreReader
0 commit comments