hydromt.typing.FSSpecFileSystem#

pydantic model hydromt.typing.FSSpecFileSystem[source]#

Pydantic compatible fsspec AbstractFileSystem.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

field protocol: str = 'file'#
field storage_options: dict[str, Any] [Optional]#
property is_local: bool#

Check if the filesystem is local.

get_fs(storage_options: dict[str, Any] | None = None) → AbstractFileSystem[source]#

Get the underlying fsspec filesystem.

This is the single place where driver-level overrides are merged into the filesystem. Readers take the resulting AbstractFileSystem and never see storage_options.

Parameters:

storage_options (dict[str, Any] | None, optional) – Additional storage options to merge with this filesystem’s own storage options. Useful for driver-level options (e.g. set under a driver’s options rather than its filesystem) that weren’t available at filesystem construction time. Default is None, which reuses the filesystem built at construction time.

serialize(include_credentials: bool = False) → dict[str, Any][source]#

Serialize the filesystem to a dict.

Parameters:

include_credentials – Whether to include passwords/secrets in the serialized dict.

static create(input: Any) → FSSpecFileSystem[source]#

Create an fsspec filesystem from various inputs.

model_post_init(context: Any, /) → None#

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Args:

self: The BaseModel instance. context: The context.