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!"