Skip to content

Implementations 📁

Universal Pathlib provides specialized UPath subclasses for different filesystem protocols. Each implementation is optimized for its respective filesystem and may provide additional protocol-specific functionality.

upath.implementations.cloud

S3Path

S3Path(
    *args: JoinablePathLike,
    protocol: Literal["s3", "s3a"] | None = None,
    chain_parser: FSSpecChainParser = DEFAULT_CHAIN_PARSER,
    **storage_options: Unpack[S3StorageOptions],
)

Bases: CloudPath

Source code in upath/implementations/cloud.py
143
144
145
146
147
148
149
150
151
152
153
154
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["s3", "s3a"] | None = None,
    chain_parser: FSSpecChainParser = DEFAULT_CHAIN_PARSER,
    **storage_options: Unpack[S3StorageOptions],
) -> None:
    super().__init__(
        *args, protocol=protocol, chain_parser=chain_parser, **storage_options
    )
    if not self.drive and len(self.parts) > 1:
        raise ValueError("non key-like path provided (bucket/container missing)")

Protocols: s3://, s3a://

Amazon S3 compatible object storage implementation.

GCSPath

GCSPath(
    *args: JoinablePathLike,
    protocol: Literal["gcs", "gs"] | None = None,
    chain_parser: FSSpecChainParser = DEFAULT_CHAIN_PARSER,
    **storage_options: Unpack[GCSStorageOptions],
)

Bases: CloudPath

Source code in upath/implementations/cloud.py
110
111
112
113
114
115
116
117
118
119
120
121
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["gcs", "gs"] | None = None,
    chain_parser: FSSpecChainParser = DEFAULT_CHAIN_PARSER,
    **storage_options: Unpack[GCSStorageOptions],
) -> None:
    super().__init__(
        *args, protocol=protocol, chain_parser=chain_parser, **storage_options
    )
    if not self.drive and len(self.parts) > 1:
        raise ValueError("non key-like path provided (bucket/container missing)")

Protocols: gs://, gcs://

Google Cloud Storage implementation.

AzurePath

AzurePath(
    *args: JoinablePathLike,
    protocol: Literal["abfs", "abfss", "adl", "az"]
    | None = None,
    chain_parser: FSSpecChainParser = DEFAULT_CHAIN_PARSER,
    **storage_options: Unpack[AzureStorageOptions],
)

Bases: CloudPath

Source code in upath/implementations/cloud.py
184
185
186
187
188
189
190
191
192
193
194
195
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["abfs", "abfss", "adl", "az"] | None = None,
    chain_parser: FSSpecChainParser = DEFAULT_CHAIN_PARSER,
    **storage_options: Unpack[AzureStorageOptions],
) -> None:
    super().__init__(
        *args, protocol=protocol, chain_parser=chain_parser, **storage_options
    )
    if not self.drive and len(self.parts) > 1:
        raise ValueError("non key-like path provided (bucket/container missing)")

Protocols: abfs://, abfss://, adl://, az://

Azure Blob Storage and Azure Data Lake implementation.

HfPath

HfPath(
    *args: JoinablePathLike,
    protocol: Literal["hf"] | None = None,
    chain_parser: FSSpecChainParser = DEFAULT_CHAIN_PARSER,
    **storage_options: Unpack[HfStorageOptions],
)

Bases: CloudPath

Source code in upath/implementations/cloud.py
201
202
203
204
205
206
207
208
209
210
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["hf"] | None = None,
    chain_parser: FSSpecChainParser = DEFAULT_CHAIN_PARSER,
    **storage_options: Unpack[HfStorageOptions],
) -> None:
    super().__init__(
        *args, protocol=protocol, chain_parser=chain_parser, **storage_options
    )

Protocols: hf://

Hugging Face Hub implementation for accessing models, datasets, and spaces.


upath.implementations.local

PosixUPath

PosixUPath(
    *args,
    protocol: str | None = None,
    chain_parser: FSSpecChainParser = DEFAULT_CHAIN_PARSER,
    **storage_options: Any,
)

Bases: LocalPath, PosixPath

Source code in upath/implementations/local.py
195
196
197
198
199
200
201
202
203
204
205
def __init__(
    self,
    *args,
    protocol: str | None = None,
    chain_parser: FSSpecChainParser = DEFAULT_CHAIN_PARSER,
    **storage_options: Any,
) -> None:
    _warn_protocol_storage_options(type(self), protocol, storage_options)
    self._drv, self._root, self._parts = self._parse_args(args)  # type: ignore[attr-defined] # noqa: E501
    self._init()
    self._chain_parser = chain_parser

POSIX-style local filesystem paths (Linux, macOS, Unix).

WindowsUPath

WindowsUPath(
    *args,
    protocol: str | None = None,
    chain_parser: FSSpecChainParser = DEFAULT_CHAIN_PARSER,
    **storage_options: Any,
)

Bases: LocalPath, WindowsPath

Source code in upath/implementations/local.py
195
196
197
198
199
200
201
202
203
204
205
def __init__(
    self,
    *args,
    protocol: str | None = None,
    chain_parser: FSSpecChainParser = DEFAULT_CHAIN_PARSER,
    **storage_options: Any,
) -> None:
    _warn_protocol_storage_options(type(self), protocol, storage_options)
    self._drv, self._root, self._parts = self._parse_args(args)  # type: ignore[attr-defined] # noqa: E501
    self._init()
    self._chain_parser = chain_parser

Windows-style local filesystem paths.

FilePath

FilePath(
    *args: JoinablePathLike,
    protocol: Literal["file", "local"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[FileStorageOptions],
)

Bases: UPath

Source code in upath/implementations/local.py
796
797
798
799
800
801
802
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["file", "local"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[FileStorageOptions],
) -> None: ...

Protocols: file://, local://

File URI implementation for local filesystem.


upath.implementations.http

HTTPPath

HTTPPath(
    *args: JoinablePathLike,
    protocol: Literal["http", "https"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[HTTPStorageOptions],
)

Bases: UPath

Source code in upath/implementations/http.py
40
41
42
43
44
45
46
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["http", "https"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[HTTPStorageOptions],
) -> None: ...

Protocols: http://, https://

HTTP/HTTPS read-only filesystem implementation.


upath.implementations.sftp

SFTPPath

SFTPPath(
    *args: JoinablePathLike,
    protocol: Literal["sftp"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[SFTPStorageOptions],
)

Bases: UPath

Source code in upath/implementations/sftp.py
28
29
30
31
32
33
34
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["sftp"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[SFTPStorageOptions],
) -> None: ...

Protocols: sftp://, ssh://

SFTP (SSH File Transfer Protocol) implementation.


upath.implementations.smb

SMBPath

SMBPath(
    *args: JoinablePathLike,
    protocol: Literal["smb"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[SMBStorageOptions],
)

Bases: UPath

Source code in upath/implementations/smb.py
32
33
34
35
36
37
38
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["smb"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[SMBStorageOptions],
) -> None: ...

Protocol: smb://

SMB/CIFS network filesystem implementation.


upath.implementations.webdav

WebdavPath

WebdavPath(
    *args: JoinablePathLike,
    protocol: Literal["webdav+http", "webdav+https"]
    | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[WebdavStorageOptions],
)

Bases: UPath

Source code in upath/implementations/webdav.py
41
42
43
44
45
46
47
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["webdav+http", "webdav+https"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[WebdavStorageOptions],
) -> None: ...

Protocols: webdav://, webdav+http://, webdav+https://

WebDAV protocol implementation.


upath.implementations.hdfs

HDFSPath

HDFSPath(
    *args: JoinablePathLike,
    protocol: Literal["hdfs"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[HDFSStorageOptions],
)

Bases: UPath

Source code in upath/implementations/hdfs.py
28
29
30
31
32
33
34
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["hdfs"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[HDFSStorageOptions],
) -> None: ...

Protocol: hdfs://

Hadoop Distributed File System implementation.


upath.implementations.github

GitHubPath

GitHubPath(
    *args: JoinablePathLike,
    protocol: Literal["github"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[GitHubStorageOptions],
)

Bases: UPath

GitHubPath supporting the fsspec.GitHubFileSystem

Source code in upath/implementations/github.py
38
39
40
41
42
43
44
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["github"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[GitHubStorageOptions],
) -> None: ...

Protocol: github://

GitHub repository file access implementation.


upath.implementations.zip

ZipPath

ZipPath(
    *args: JoinablePathLike,
    protocol: Literal["zip"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[ZipStorageOptions],
)

Bases: UPath

Source code in upath/implementations/zip.py
30
31
32
33
34
35
36
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["zip"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[ZipStorageOptions],
) -> None: ...

Protocol: zip://

ZIP archive filesystem implementation.


upath.implementations.tar

TarPath

TarPath(
    *args: JoinablePathLike,
    protocol: Literal["zip"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[TarStorageOptions],
)

Bases: UPath

Source code in upath/implementations/tar.py
37
38
39
40
41
42
43
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["zip"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[TarStorageOptions],
) -> None: ...

Protocol: tar://

TAR archive filesystem implementation.


upath.implementations.memory

MemoryPath

MemoryPath(
    *args: JoinablePathLike,
    protocol: Literal["memory"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[MemoryStorageOptions],
)

Bases: UPath

Source code in upath/implementations/memory.py
28
29
30
31
32
33
34
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["memory"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[MemoryStorageOptions],
) -> None: ...

Protocol: memory://

In-memory filesystem implementation for testing and temporary storage.


upath.implementations.data

DataPath

DataPath(
    *args: JoinablePathLike,
    protocol: Literal["data"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[DataStorageOptions],
)

Bases: UPath

Source code in upath/implementations/data.py
35
36
37
38
39
40
41
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["data"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[DataStorageOptions],
) -> None: ...

Protocol: data://

Data URL scheme implementation for embedded data.


upath.implementations.ftp

FTPPath

FTPPath(
    *args: JoinablePathLike,
    protocol: Literal["ftp"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[FTPStorageOptions],
)

Bases: UPath

Source code in upath/implementations/ftp.py
34
35
36
37
38
39
40
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["ftp"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[FTPStorageOptions],
) -> None: ...

Protocol: ftp://

FTP (File Transfer Protocol) implementation.


upath.implementations.cached

SimpleCachePath

SimpleCachePath(
    *args: JoinablePathLike,
    protocol: Literal["simplecache"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[SimpleCacheStorageOptions],
)

Bases: UPath

Source code in upath/implementations/cached.py
34
35
36
37
38
39
40
def __init__(
    self,
    *args: JoinablePathLike,
    protocol: Literal["simplecache"] | None = ...,
    chain_parser: FSSpecChainParser = ...,
    **storage_options: Unpack[SimpleCacheStorageOptions],
) -> None: ...

Protocol: simplecache://

Local caching wrapper for remote filesystems.


See Also 🔗

  • UPath - Main UPath class documentation
  • Registry - Implementation registry
  • Extensions - Extending UPath functionality