def CreateReader(cls, location): parse = urlparse(location) if parse.scheme == 's3': path = parse.path.split('/', 2) result = S3Reader(location=s3fs.S3FS( bucket=path[1], prefix=path[2] if len(path) == 3 else '')) return result return None
def CreateWriter(cls, location): """Return an instance of this class if it handles the location location must be a string with the format: s3://domain/bucket/ (an optional folder inside the bucket can be used) """ parse = urlparse(location) if parse.scheme == 's3': path = parse.path.split('/', 2) result = S3Writer(location=s3fs.S3FS( bucket=path[1], prefix=path[2] if len(path) == 3 else '')) return result return None
def setUp(self): self.fs = s3fs.S3FS(self.bucket, "/unittest/files") for k in self.fs._s3bukt.list(): self.fs._s3bukt.delete_key(k)
def setUp(self): self.fs = s3fs.S3FS(self.bucket) for k in self.fs._s3bukt.list(): self.fs._s3bukt.delete_key(k)
def setUp(self): self.fs = s3fs.S3FS(self.bucket, "/unittest/files") self._clear()
def setUp(self): self.fs = s3fs.S3FS(self.bucket) self._clear()