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}")

    # Parse into bucket and prefix
    bucket = ""
    prefix = ""
    for index, char in enumerate(url[5:]):
        # Everything before this char should be the bucket name
        if char == "/":
            # Take rest of path less '/' and s3://
            prefix = url[(index + 6):]
            break
        # Build bucket string
        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