CloudPath currently doesn't let you easily check if a bucket itself exists. The exists method only works if you provide some path inside the bucket. This is a nice feature in Pathy and the analogous equivalent of pathlib.Path also works. It would be great to have this included in this library as well.
from pathy import Pathy
from cloudpathlib import CloudPath
from pathlib import Path
# Doesn't work
CloudPath("s3://some-bucket/").exists()
# ParamValidationError: Parameter validation failed:
# Invalid length for parameter Key, value: 0, valid min length: 1
Pathy("s3://some-bucket/").exists() # True
# Since a bucket is the equivalent of a drive, a comparison to pathlib.Path
# for checking if a drive exists (I'm using Windows)
Path("C:").exists() # True
CloudPath currently doesn't let you easily check if a bucket itself exists. The
existsmethod only works if you provide some path inside the bucket. This is a nice feature in Pathy and the analogous equivalent ofpathlib.Pathalso works. It would be great to have this included in this library as well.