macpie.tablibtools.MacpieTablibDataset#
- class macpie.tablibtools.MacpieTablibDataset(*args, **kwargs)#
Extend
tablib.Datasetwith extra functionality.- __init__(*args, **kwargs)#
Methods
__init__(*args, **kwargs)add_formatter(col, handler)Adds a formatter to the
Dataset.append(row[, tags])Adds a row to the
Dataset. See :method:`Dataset.insert` for additional documentation.append_col(col[, header])Adds a column to the
Dataset. See :method:`Dataset.insert_col` for additional documentation.append_col_fill(fill_value[, header])Adds a column to the Dataset with a specified fill_value.
append_separator([text])Adds a separator to the
Dataset.append_series(ser[, with_tags, tag_value])Adds
seras a row todsetwith tags derived from the labels inserthat are not headers indset, and whose value is'x'or'X'.compare(other)Compare this MacpieTablibDataset with another.
export(format, **kwargs)Export
Datasetobject to format.extend(rows[, tags])Adds a list of rows to the
Datasetusing :method:`Dataset.append`extendleft(rows[, tags])Prepend a list of Dataset fields.
filter(tag)Returns a new instance of the
Dataset, excluding any rows that do not contain the given tags.from_df(df[, title])Construct instance from a
pandas.DataFrame.from_excel(filepath[, sheet_name, headers, ...])Construct instance from an Excel sheet.
from_tablib_dset(dset, *args, **kwargs)get_cli(**kwargs)get_col(index)Returns the column from the
Datasetat the given index.get_csv(**kwargs)get_dbf(**kwargs)get_df(**kwargs)get_jira(**kwargs)get_json(**kwargs)get_latex(**kwargs)get_rst(**kwargs)get_tsv(**kwargs)get_xlsx(**kwargs)insert(index, row[, tags])Inserts a row to the
Datasetat the given index.insert_col(index[, col, header])Inserts a column to the
Datasetat the given index.insert_separator(index[, text])Adds a separator to
Datasetat given index.load(in_stream[, format])Import in_stream to the
Datasetobject using the format.lpop()Removes and returns the first row of the
Dataset.lpush(row[, tags])Adds a row to the top of the
Dataset. See :method:`Dataset.insert` for additional documentation.lpush_col(col[, header])Adds a column to the top of the
Dataset. See :method:`Dataset.insert` for additional documentation.pop()Removes and returns the last row of the
Dataset.print()Print a representation table suited to a terminal in grid format.
remove_duplicates()Removes all duplicate rows from the
Datasetobject while maintaining the original order.rpop()Removes and returns the last row of the
Dataset.rpush(row[, tags])Adds a row to the end of the
Dataset. See :method:`Dataset.insert` for additional documentation.rpush_col(col[, header])Adds a column to the end of the
Dataset. See :method:`Dataset.insert` for additional documentation.set_cli(in_stream, **kwargs)set_csv(in_stream, **kwargs)set_dbf(in_stream, **kwargs)set_df(in_stream, **kwargs)set_jira(in_stream, **kwargs)set_json(in_stream, **kwargs)set_latex(in_stream, **kwargs)set_rst(in_stream, **kwargs)set_tsv(in_stream, **kwargs)set_xlsx(in_stream, **kwargs)sort(col[, reverse])Sort a
Datasetby a specific column, given string (for header) or integer (for column index).stack(other)Stack two
Datasetinstances together by joining at the row level, and return new combinedDatasetinstance.stack_cols(other)Stack two
Datasetinstances together by joining at the column level, and return a new combinedDatasetinstance.subset(*args, **kwargs)Returns a new instance of the
Dataset, including only specified rows and columns.to_excel(excel_writer)Write to an excel file using an
MACPieExcelWriterinstance.transpose()Transpose a
Dataset, turning rows into columns and vice versa, returning a newDatasetinstance.wipe()Removes all content and headers from the
Datasetobject.wipe_data()Removes all content (but not headers).
Attributes
dataData of Dataset.
dfGet
pandas.DataFramerepresentation of data.dictA native Python representation of the
Datasetobject.headersAn optional list of strings to be used for header rows and attribute names.
heightThe number of rows currently in the
Dataset.widthThe number of columns currently in the
Dataset.