Storage Options¶
Storage options are structured configuration objects for local, cloud, and Git providers. This page explains how to choose and configure them. For exact signatures, see fsspeckit.storage_options.
Cloud providers require their respective extra. See the extras matrix.
Provider classes¶
Each provider has a dedicated options class. All inherit from
BaseStorageOptions.
| Provider | Class | Extra | Notes |
|---|---|---|---|
| Local | LocalStorageOptions |
none | Default; no credentials |
| AWS S3 | AwsStorageOptions |
aws |
Region, profile, anonymous access |
| Google Cloud Storage | GcsStorageOptions |
gcp |
Project, token |
| Azure Blob / Data Lake | AzureStorageOptions |
azure |
Account, connection string |
| GitHub | GitHubStorageOptions |
none | Org, repo, token |
| GitLab | GitLabStorageOptions |
none | Project, token |
Import from the root package or from fsspeckit.storage_options:
Configuring options¶
Direct construction¶
Pass credentials and settings as keyword arguments:
From environment variables¶
The module-level from_env(protocol) factory reads standard environment
variables for each provider:
Each provider class also has a from_env() classmethod (for example,
AwsStorageOptions.from_env()), which reads provider-specific environment
variables.
From a URI¶
storage_options_from_uri(uri) infers the protocol from the scheme and extracts
available configuration:
From a dictionary¶
from_dict(protocol, mapping) builds the right class for a protocol from a
plain dictionary. This is useful when options arrive as configuration data:
Merging configurations¶
merge_storage_options(*options, overwrite=True) combines several sources into
one. Later sources win when overwrite is true (the default):
Protocol inference¶
infer_protocol_from_uri(uri) returns the protocol string for a URI without
building an options object:
Using options with a filesystem¶
Pass an options object (or its dict form) to filesystem():
For a walkthrough of cloud setup, see Configure Cloud Storage.
Related documentation¶
- API Guide - import selection across all packages.
- Installation - extras matrix and provider dependencies.
- Generated API: storage_options - signatures.