def parse_data_url(data_url):
    """
    Parse a data url into a tuple of params and the encoded data.
    
    E.g.
    >>> data_url = "data:image/png;base64,ABC123xxx"
    >>> params, encoded_data = parse_data_url(data_url)
    >>> params
    ('image/png', 'base64')
    >>> data
    'ABC123xxx'
    
    """
    # e.g. data:image/png;base64,xxx..
    if not data_url.startswith('data:'):
        raise ValueError('not a data url')
    data_url = data_url[5:]
    params, data = data_url.split(',')
    params = params.split(';')
    return params, data