def parse_s3_url(url):
    """
    Parses a url with format s3://bucket/prefix into a bucket and prefix
    """
    if not url.startswith('s3://'):
        raise ValueError(
            'The provided URL does not follow s3://{bucket_name}/{path}')
    bucket = ''
    prefix = ''
    for index, char in enumerate(url[5:]):
        if char == '/':
            prefix = url[index + 6:]
            break
        bucket += char
    if not bucket:
        raise ValueError('The provided URL ' + str(url) +
            ' is not valid. Please enter a URL following s3://{bucket_name}/path'
            )
    if not prefix:
        prefix = '/'
    return bucket, prefix
