def grab_dims_from(struc):
    """Extract box information from CIF data

    Parameters
    ----------
    struc : list of lines
      the read cif file

    Returns
    -------
    dims : dict
      dict with keys a, b, c, alpha, beta, gamma
    """
    dims = dict()
    for line in struc:
        if line.lstrip().startswith('_cell_length_a'):
            dims['a'] = float(line.split()[1])
        elif line.lstrip().startswith('_cell_length_b'):
            dims['b'] = float(line.split()[1])
        elif line.lstrip().startswith('_cell_length_c'):
            dims['c'] = float(line.split()[1])
        elif line.lstrip().startswith('_cell_angle_alpha'):
            dims['alpha'] = float(line.split()[1])
        elif line.lstrip().startswith('_cell_angle_beta'):
            dims['beta'] = float(line.split()[1])
        elif line.lstrip().startswith('_cell_angle_gamma'):
            dims['gamma'] = float(line.split()[1])
        if len(dims) == 6:
            break
    else:
        raise ValueError('couldnt read dims')
    return dims
