def create_sparse_dataset(py_obj, h_group, name, **kwargs):
    """ dumps an sparse array to h5py file

    Parameters
    ----------
    py_obj (scipy.sparse.csr_matrix,scipy.sparse.csc_matrix, scipy.sparse.bsr_matrix):
        python object to dump

    h_group (h5.File.group):
        group to dump data into.

    name (str):
        the name of the resulting dataset

    kwargs (dict):
        keyword arguments to be passed to create_dataset function

    Returns:
        Group and list of subitems to dump into
    """
    h_sparsegroup = h_group.create_group(name)
    return h_sparsegroup,(
        ('data',py_obj.data,{},kwargs),
        ('indices',py_obj.indices,{},kwargs),
        ('indptr',py_obj.indptr,{},kwargs),
        ('shape',py_obj.shape,{},kwargs)
    )