Skip to content

upath.extensions.ProxyUPath: provide a way to define supported protocols #437

@ap--

Description

@ap--

In case you want to extend the UPath API it's common that you only need a subset of filesystems. We should provide a convenient way to do this.

from upath.extensions import ProxyUPath

# maybe this?
class MyUPath(ProxyUPath, restrict_protocols=("s3", "gcs", "az", "file")):
    def hello_world(self):
        return f"Hello {self!r} World!"

# or this?
class MyUPath(ProxyUPath):
    supported_protocols = ("s3", "gcs", "az", "file")

    def hello_world(self):
        return f"Hello {self!r} World!"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions