How to use the papermill.s3.Prefix function in papermill

To help you get started, we’ve selected a few papermill examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nteract / papermill / papermill / s3.py View on Github external
def _is_s3(self, name):
        # only allow file objects from local
        if not isinstance(name, six.string_types + (Key, Prefix)):
            return False

        name = self._clean_s3(name)
        return 's3://' in name
github nteract / papermill / papermill / s3.py View on Github external
)

            for item in locations:
                if objects or keys:
                    if 'Key' in item:
                        yield Key(
                            bucket,
                            item['Key'],
                            size=item.get('Size'),
                            etag=item.get('ETag'),
                            last_modified=item.get('LastModified'),
                            storage_class=item.get('StorageClass'),
                            service=self,
                        )
                    elif objects:
                        yield Prefix(bucket, item['Prefix'], service=self)
                else:
                    prefix = item['Key'] if 'Key' in item else item['Prefix']
                    yield 's3://{}/{}'.format(bucket, prefix)