fsspeckit.storage_options.base API Documentation¶
This module defines the base class for filesystem storage configuration options.
BaseStorageOptions¶
Base class for filesystem storage configuration options.
Provides common functionality for all storage option classes including:
- YAML serialization/deserialization
- Dictionary conversion
- Filesystem instance creation
- Configuration updates
Attributes:
protocol(str): Storage protocol identifier (e.g., "s3", "gs", "file")
Example:
to_dict()¶
Convert storage options to dictionary.
| Parameter | Type | Description |
|---|---|---|
with_protocol |
bool |
Whether to include protocol in output dictionary |
| Returns | Type | Description |
|---|---|---|
dict |
dict |
Dictionary of storage options with non-None values |
Example:
from_yaml()¶
Load storage options from YAML file.
| Parameter | Type | Description |
|---|---|---|
path |
str |
Path to YAML configuration file |
fs |
AbstractFileSystem |
Filesystem to use for reading file |
| Returns | Type | Description |
|---|---|---|
BaseStorageOptions |
BaseStorageOptions |
Loaded storage options instance |
Example:
to_yaml()¶
Save storage options to YAML file.
| Parameter | Type | Description |
|---|---|---|
path |
str |
Path where to save configuration |
fs |
AbstractFileSystem |
Filesystem to use for writing |
Example:
to_filesystem()¶
Create fsspec filesystem instance from options.
| Returns | Type | Description |
|---|---|---|
AbstractFileSystem |
AbstractFileSystem |
Configured filesystem instance |
Example:
update()¶
Update storage options with new values.
| Parameter | Type | Description |
|---|---|---|
**kwargs |
Any |
New option values to set |
| Returns | Type | Description |
|---|---|---|
BaseStorageOptions |
BaseStorageOptions |
Updated instance |
Example: