def get_bucketname(s3_url):
    """
    Extracts key part from s3 URL:
        s3_url = s3://my-bucket/some/path/to/x.pdf
        result = my-bucket
    """
    s3 = s3_url.replace('//', '/')
    scheme, bucket, *rest = s3.split('/')
    return bucket
