tablexplore package

Submodules

tablexplore.app module

TablExplore app Created November 2020 Copyright (C) Damien Farrell

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

class tablexplore.app.Application(project_file=None, csv_file=None, excel_file=None)[source]

Bases: QMainWindow

about()[source]
addDockWidgets()[source]

Add plot dialogs to dock

addRecentFile(fname)[source]

Add file to recent if not present

addSheet(name=None, df=None, meta=None)[source]

Add a new sheet

applySettings()[source]

Apply settings to GUI when changed

changeColumnWidths(factor=1.1)[source]
checkSettings()[source]

Check for missing settings

clearSheets(ask=True)[source]

Clear all sheets

closeEvent(event)[source]

Close event

concatSheets()[source]

Combine sheets into one table

copy()[source]
createMenu()[source]

Main menu

createToolBar()[source]

Create main toolbar

discoverPlugins()[source]

Discover available plugins

do_saveProject(filename, progress_callback=None)[source]

Does the actual saving. Save sheets inculding table dataframes and meta data as dict to compressed pickle.

duplicateSheet()[source]

Make a copy of a sheet

exportAs()[source]

Export as

fileQuit()[source]
findReplace()[source]

Find or replace

getCurrentTable()[source]

Return the currently used table

getSampleData(name, rows=None)[source]

Sample table

importExcel(filename=None)[source]
importFile(filename=None)[source]
importHDF()[source]
importMultiple()[source]

Import many files

importMultipleFiles(folders=False)[source]

Import many files

importPickle()[source]
importURL()[source]

Import from URL

interpreter()[source]

Launch python interpreter

loadMeta(table, meta)[source]

Load meta data for a sheet/table, this includes plot options and table selections

loadPlugin(plugin)[source]

Instantiate the plugin and call it’s main method

loadSettings()[source]

Load GUI settings

load_dataframe(df, name=None, select=False)[source]

Load a DataFrame into a new sheet :param df: dataframe :param name: name of new sheet :param select: set new sheet as selected

load_pickle(filename)[source]

Load a pickle file

mergeSheets()[source]

Merge two sheets

newProject(data=None, ask=False)[source]

New project

openProject(filename=None, asksave=False)[source]

Open project file

open_url(url='', event=None)[source]

Open the online documentation

paste()[source]
pasteNewSheet()[source]
plotToScratchpad(label=None)[source]

Cache the current plot so it can be viewed later

preferences()[source]

Preferences dialog

processing_completed()[source]

Generic process completed

progress_fn(msg)[source]
refresh()[source]

Refresh all tables

removeSheet(index, ask=True)[source]

Remove sheet

renameSheet()[source]

Rename the current sheet

replot()[source]

Plot current

run_threaded_process(process, on_complete)[source]

Execute a function in the background with a worker

saveAsProject()[source]

Save as a new project filename

saveMeta(tablewidget)[source]

Save meta data such as current plot options and certain table attributes. These are re-loaded when the sheet is opened.

saveProject(filename=None)[source]

Save project

saveSettings()[source]

Save GUI settings

saveWithProgress(filename)[source]

Save with progress bar

setTheme(theme=None)[source]

Change interface theme.

showErrorLog()[source]

Show log file contents

showPlotFrame()[source]

Show/hide the plot frame

showPlugin(plugin)[source]

Add plugin as dock widget

showRecentFiles()[source]

Populate recent files menu

showScratchpad()[source]

Show stored plot figures

startLogging()[source]

Logging

stateChanged(bool)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
tabSelected(index)[source]

Re-load plot widgets for current tab

tableToScratchpad()[source]

Send table selection to scratchpad

undo()[source]
updatePlotWidgets(table)[source]

Update plot widgets from values in table

updatePluginMenu()[source]

Update plugins

updatePlugins()[source]

Update table for a plugin if it needs it

zoomIn()[source]
zoomOut()[source]
tablexplore.app.main()[source]

tablexplore.core module

Implements core classes for tablexplore Created May 2017 Copyright (C) Damien Farrell

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

class tablexplore.core.ColumnHeader[source]

Bases: QHeaderView

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.core.DataFrameModel(dataframe=None, *args)[source]

Bases: QAbstractTableModel

DataFrame Model class.

columnCount(self, parent: PySide2.QtCore.QModelIndex = Invalid(PySide2.QtCore.QModelIndex)) int[source]
data(index, role=PySide2.QtCore.Qt.ItemDataRole.DisplayRole)[source]

Edit or display roles. Handles what happens when the Cells are edited or what appears in each cell. https://www.pythonguis.com/tutorials/pyside-qtableview-modelviews-numpy-pandas/

flags(self, index: PySide2.QtCore.QModelIndex) PySide2.QtCore.Qt.ItemFlags[source]
headerData(col, orientation, role)[source]

What’s displayed in the headers

rowCount(self, parent: PySide2.QtCore.QModelIndex = Invalid(PySide2.QtCore.QModelIndex)) int[source]
setData(index, value, role=PySide2.QtCore.Qt.ItemDataRole.EditRole)[source]

Set data upon edits

sort(idx, ascending=True)[source]

Sort table by given column number

staticMetaObject = <PySide2.QtCore.QMetaObject object>
update(df)[source]
class tablexplore.core.DataFrameTable(parent=None, dataframe=None, font='Arial', fontsize=12, columnwidth=80, timeformat='%m-%d-%Y', bg='#F4F4F3', **kwargs)[source]

Bases: QTableView

QTableView with pandas DataFrame as model.

addColumn()[source]

Add a column

addRows()[source]

Add n rows

changeColumnWidths(factor=1.1)[source]

Set column widths

checkColumnsUnique()[source]

Check if columns are all unique

columnClicked(col)[source]
columnHeaderMenu(pos)[source]

Column header right click popup menu

contextMenuEvent(event)[source]

Reimplemented to create context menus for cells and empty space.

deleteCells(rows, cols, answer=None)[source]

Clear the cell contents

deleteColumn(column=None)[source]

Delete column

deleteRows()[source]

Delete rows

getColumnOrder()[source]

Get column names from header in their displayed order

getColumnWidths()[source]
getMemory()[source]

Get memory info as string

getScrollPosition()[source]

Get current row/col position

getSelectedColumns()[source]

Get selected column indexes

getSelectedDataFrame()[source]

Get selection as a dataframe

getSelectedRows()[source]
handleDoubleClick(item)[source]
keyPressEvent(self, event: PySide2.QtGui.QKeyEvent) None[source]
memory_usage()[source]
refresh()[source]

Refresh table if dataframe is changed

renameColumn(column=None)[source]
resetIndex()[source]
rowHeaderMenu(pos)[source]

Row header popup menu

selectColumn(self, column: int) None[source]
setColumnType(column=None)[source]

Change the column dtype

setColumnWidths(widths)[source]
setIndex(column)[source]

Set column as index

setIndexType()[source]

Set the type of the index

setRowColor(rowIndex, color)[source]
setScrollPosition(row, col)[source]

Move to row/col position

setSelected(rows, cols)[source]

Set selection programmatically from a list of rows and cols. https://doc.qt.io/archives/qtjambi-4.5.2_01/com/trolltech/qt/model-view-selection.html

showAll()[source]

Re-show unfiltered

showSelection(item)[source]
sort(idx, ascending=True)[source]

Sort by selected columns

sortIndex(ascending=True)[source]

Sort by inde,

staticMetaObject = <PySide2.QtCore.QMetaObject object>
storeCurrent()[source]

Store current version of the table before a major change is made

undo()[source]

Undo last change to table

updateFont()[source]

Update the font

viewRow()[source]

View row data

zoomIn(fontsize=None)[source]

Zoom in table

zoomOut(fontsize=None)[source]

Zoom out table

class tablexplore.core.DataFrameWidget(parent=None, dataframe=None, app=None, toolbar=True, statusbar=True, **kwargs)[source]

Bases: QWidget

Widget containing a tableview and toolbars

addColumn()[source]
addRows()[source]
aggregate()[source]

Groupby aggregate operation

applyColumnFunction(column)[source]

Apply column wise functions, applies a calculation per row and ceates a new column.

applySettings(settings)[source]

Settings

applyStringMethod(column)[source]

Apply string operation to column(s)

applyTransformFunction(column)[source]

Apply resampling and transform functions on a single column.

bin()[source]

Split into bins using cut

cleanData()[source]

Deal with missing data

clear()[source]

Clear table

close()[source]

Close events

closeSubtable()[source]
convertColumnNames()[source]

Reformat column names

convertDates(column)[source]

Convert single or multiple columns into datetime or extract features from datetime object.

convertNumeric()[source]

Convert cols to numeric if possible

convertTypes()[source]
copy()[source]

Copy to clipboard

createPlotViewer(parent=None)[source]

Create a plot widget attached to this table

createToolbar()[source]

Create toolbar

editMode(evt=None)[source]

Change table edit mode

exportTable()[source]

Export table

fillData(column)[source]

Fill column with data

fillDates(column)[source]

Fill with datetime

fillStrings(column)[source]

Fill column with string data

filter()[source]

Show filter dialog

findDuplicates()[source]

Find or remove duplicates

findreplace()[source]

Find/replace dialog

getFileType()[source]
getSelectedDataFrame()[source]

Get selection as a dataframe

importExcel(filename=None)[source]

Import excel file

importFile(filename=None, dialog=True, **kwargs)[source]

Import csv file

importHDF()[source]

Import hdf5 file

importPickle()[source]
importURL(recent)[source]

Import hdf5 file

info()[source]

Table info

insert()[source]

Insert from clipboard

load()[source]
manageColumns()[source]

Edit columns

melt()[source]

Melt table

merge()[source]
paste()[source]

Paste from clipboard

pivot()[source]

Pivot table

plot()[source]

Plot from selection

refresh()[source]
resample()[source]

Table time series resampling dialog. Should set a datetime index first.

runScript()[source]

Run a set of python commands on the table

save()[source]
selectAll()[source]

Select all data

showAsText()[source]

Show selection as text

showInterpreter()[source]

Show the Python interpreter

showSubTable(df=None, title=None, index=False, out=False)[source]

Add the child table

stateChanged(idx, idx2)[source]

Run whenever table model is changed

staticMetaObject = <PySide2.QtCore.QMetaObject object>
statusBar()[source]

Status bar at bottom

subTableFromSelection()[source]
transpose()[source]
updateStatusBar()[source]

Update the table details in the status bar

class tablexplore.core.HeaderProxyStyle[source]

Bases: QProxyStyle

drawControl(self, element: PySide2.QtWidgets.QStyle.ControlElement, option: PySide2.QtWidgets.QStyleOption, painter: PySide2.QtGui.QPainter, widget: Union[PySide2.QtWidgets.QWidget, NoneType] = None) None[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.core.HeaderView(parent)[source]

Bases: QHeaderView

” Column header class.

sectionSizeFromContents(logicalIndex)[source]

Get section size from contents

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.core.ItemEditorFactory[source]

Bases: QItemEditorFactory

createEditor(self, userType: int, parent: PySide2.QtWidgets.QWidget) PySide2.QtWidgets.QWidget[source]
class tablexplore.core.RowHeader[source]

Bases: QHeaderView

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.core.SubTableWidget(parent=None, dataframe=None, **args)[source]

Bases: DataFrameWidget

Widget for sub table

createToolbar()[source]

Override default toolbar

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.core.SubWidget(parent, table)[source]

Bases: QDockWidget

closeEvent(self, event: PySide2.QtGui.QCloseEvent) None[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>

tablexplore.dialogs module

Implements some dialog utilities for tablexplore Created Feb 2019 Copyright (C) Damien Farrell

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

class tablexplore.dialogs.AggregateDialog(parent, df, title='Groupby-Aggregate')[source]

Bases: BasicDialog

Qdialog with multiple inputs

apply()[source]

Do the operation

createWidgets()[source]

Create widgets

customButtons()[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.BasicDialog(parent, df, title=None, app=None)[source]

Bases: QDialog

Qdialog for table operations interfaces

apply()[source]

Override this

close(self) bool[source]
copy_to_clipboard()[source]

Copy result to clipboard

copy_to_sheet()[source]

Copy result to new sheet in app, if available

copy_to_subtable()[source]

Do the operation

createButtons(parent)[source]
createWidgets()[source]

Create widgets - override this

export()[source]

export result to file

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.ColorButton(*args, color=None, **kwargs)[source]

Bases: QPushButton

Custom Qt Widget to show a chosen color.

Left-clicking the button shows the color-chooser, while right-clicking resets the color to None (no-color).

color()[source]
colorChanged
mousePressEvent(self, e: PySide2.QtGui.QMouseEvent) None[source]
onColorPicker()[source]

Show color-picker dialog to select color. Qt will use the native dialog by default.

setColor(color)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.ComboDelegate(parent, items)[source]

Bases: QItemDelegate

A delegate to add QComboBox in every cell of the given column

createEditor(self, parent: PySide2.QtWidgets.QWidget, option: PySide2.QtWidgets.QStyleOptionViewItem, index: PySide2.QtCore.QModelIndex) PySide2.QtWidgets.QWidget[source]
currentIndexChanged()[source]
setEditorData(self, editor: PySide2.QtWidgets.QWidget, index: PySide2.QtCore.QModelIndex) None[source]
setModelData(self, editor: PySide2.QtWidgets.QWidget, model: PySide2.QtCore.QAbstractItemModel, index: PySide2.QtCore.QModelIndex) None[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.ConvertTypesDialog(parent, df, title='Convert types')[source]

Bases: BasicDialog

Dialog to melt table

apply()[source]

Do the operation

createButtons(parent)[source]
createWidgets()[source]

Create widgets

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.FilterBar(parent, table)[source]

Bases: QWidget

Single Widget based filter

createWidgets()[source]

Create widgets

getFilter()[source]

Get filter values for this instance

onClose(ce)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.FilterDialog(parent, table, title=None, app=None)[source]

Bases: QWidget

Qdialog for table query/filtering

addFilter()[source]

Add a filter using widgets

apply()[source]

Apply filters

applyWidgetFilters(df, mask=None)[source]

Apply the widget based filters, returns a boolean mask

copyResult()[source]
createToolBar(parent)[source]
createWidgets()[source]

Create widgets

onClose()[source]
refresh()[source]

Reset the table

removeFiltered()[source]

Subtract current filtered result from original table

staticMetaObject = <PySide2.QtCore.QMetaObject object>
togglecase()[source]
update()[source]

Update the column widgets if table has changed

class tablexplore.dialogs.FindReplaceDialog(parent, table, title=None, app=None)[source]

Bases: QWidget

Qdialog for table query/filtering

clear()[source]
createToolBar(parent)[source]
createWidgets()[source]

Create widgets

find()[source]

Do string search. Creates a masked dataframe for results and then stores each cell coordinate in a list.

findAll()[source]

Apply

findNext()[source]

Show next cell of search results

onClose()[source]
replace()[source]

Replace all instances of search text

staticMetaObject = <PySide2.QtCore.QMetaObject object>
togglecase()[source]
class tablexplore.dialogs.ImportDialog(parent=None, filename=None)[source]

Bases: QDialog

Provides a dialog for import settings

createButtons(parent)[source]
createWidgets()[source]

Create widgets

doImport()[source]

Do the import

quit()[source]
showText(encoding='utf-8')[source]

Show text contents

staticMetaObject = <PySide2.QtCore.QMetaObject object>
update()[source]

Reload previews

class tablexplore.dialogs.ManageColumnsDialog(parent, df, title='Manage Columns', app=None)[source]

Bases: BasicDialog

Qdialog for column re-arranging

checknumeric()[source]

Check if any cols numeric

convert()[source]
createButtons(parent)[source]
createWidgets()[source]

Create widgets - override this

deduplicate()[source]

Rename duplicate column names

delete()[source]
sort()[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
undo()[source]
update()[source]

Update list

class tablexplore.dialogs.MeltDialog(parent, df, title='Melt')[source]

Bases: BasicDialog

Dialog to melt table

apply()[source]

Do the operation

createWidgets()[source]

Create widgets

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.MergeDialog(parent, df, df2=None, title='Merge Tables', app=None)[source]

Bases: BasicDialog

Dialog to melt table

apply()[source]

Do the operation

createWidgets()[source]

Create widgets

staticMetaObject = <PySide2.QtCore.QMetaObject object>
updateColumns()[source]
class tablexplore.dialogs.MultipleFilesDialog(parent, title='Import Multiple')[source]

Bases: QDialog

createWidgets()[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.MultipleInputDialog(parent, options=None, title='Input', width=400, height=200)[source]

Bases: QDialog

Qdialog with multiple inputs

accept(self) None[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.PivotDialog(parent, df, title='Pivot')[source]

Bases: BasicDialog

Dialog to pivot table

apply()[source]

Do the operation

createWidgets()[source]

Create widgets

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.PlainTextEditor(parent=None, **kwargs)[source]

Bases: QPlainTextEdit

contextMenuEvent(self, e: PySide2.QtGui.QContextMenuEvent) None[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
zoom(delta)[source]
class tablexplore.dialogs.PreferencesDialog(parent, options={})[source]

Bases: QDialog

Preferences dialog from config parser options

apply()[source]

Apply options to current table

createButtons(parent)[source]
createWidgets(options)[source]

create widgets

reset()[source]

Reset to defaults

setDefaults()[source]

Populate default kwds dict

staticMetaObject = <PySide2.QtCore.QMetaObject object>
updateWidgets(kwds=None)[source]

Update widgets from stored or supplied kwds

class tablexplore.dialogs.ProgressWidget(parent=None, label='')[source]

Bases: QDialog

Progress widget class

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.Renamer[source]

Bases: object

class tablexplore.dialogs.SimpleDialog(parent, title=None)[source]

Bases: QDialog

Qdialog for generic operations

createButtons()[source]

Create buttons

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.TextDialog(parent, text='', title='Text', width=400, height=300)[source]

Bases: QDialog

Text edit dialog

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.dialogs.Worker(fn, *args, **kwargs)[source]

Bases: QRunnable

Worker thread for running background tasks.

run(self) None[source]
class tablexplore.dialogs.WorkerSignals[source]

Bases: QObject

Defines the signals available from a running worker thread. Supported signals are: finished

No data

error

tuple (exctype, value, traceback.format_exc() )

result

object data returned from processing, anything

error
finished
progress
result
staticMetaObject = <PySide2.QtCore.QMetaObject object>
tablexplore.dialogs.addToolBarItems(toolbar, parent, items)[source]

Populate toolbar from dict of items

tablexplore.dialogs.dialogFromOptions(parent, opts, sections=None, wrap=2, section_wrap=4, style=None)[source]

Get Qt widgets dialog from a dictionary of options. :param opts: options dictionary :param sections: :param section_wrap: how many sections in one row :param style: stylesheet css if required

tablexplore.dialogs.getName(parent, current='', txt='Enter value')[source]

Wrapper for text inpuit dialog

tablexplore.dialogs.getWidgetValue(w)[source]

Get value from any kind of widget

tablexplore.dialogs.getWidgetValues(widgets)[source]

Get values back from a set of widgets

tablexplore.dialogs.setWidgetValues(widgets, values)[source]

Set values for a set of widgets from a dict

tablexplore.dialogs.showMessage(parent, msg, type='error')[source]

Show an error message

tablexplore.interpreter module

Implements a Python interpreter From original code from https://github.com/col-one/thonside

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

class tablexplore.interpreter.Interpreter(extra_context={}, stream_out=True, stream_err=True, table=None, app=None)[source]

Bases: InteractiveConsole

interact(banner=None, exitmsg=None)[source]

Starting point for the interpreter. It is override for avoid while loop as classic shell. In this context interpreter doesn’t use this functionality. :param banner: starter text :param exitmsg: no used :return:

raw_input(prompt='')[source]

Override InteractiveConsole.raw_input method to add a ‘slot’ connection, useful for different view implementation. :param prompt: str prompt to write :return:

run(code)[source]

Manage run code, like continue if : or ( with prompt switch >>> to … :param code: str code to run :return:

runcode(code)[source]

Override InteractiveConsole.runcode method to manage stdout as a buffer. Useful for view implementation. :param code: str code to run :return:

write(data)[source]

Override InteractiveConsole.write method to add a ‘slot’ connection, useful for different view implementation. :param data: str data to write :return:

class tablexplore.interpreter.Streamer(queue)[source]

Bases: object

flush()[source]
write(text)[source]
class tablexplore.interpreter.TerminalPython(parent=None, table=None, app=None)[source]

Bases: Terminal

staticMetaObject = <PySide2.QtCore.QMetaObject object>

tablexplore.plotting module

tableexplore plotting module Created May 2017 Copyright (C) Damien Farrell

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

class tablexplore.plotting.AnnotationOptions[source]

Bases: BaseOptions

This class also provides custom tools for adding items to the plot

applyOptions()[source]

Set the plot kwd arguments from the tk variables

class tablexplore.plotting.AxesOptions[source]

Bases: BaseOptions

Class for additional formatting options like styles

class tablexplore.plotting.BaseOptions[source]

Bases: object

Class to generate widget dialog for dict of options

apply()[source]
applyOptions()[source]

Set the plot kwd arguments from the widgets

increment(key, inc)[source]

Increase the value of a widget

randomSettings()[source]

Get random settings

setDefaults()[source]

Populate default kwds dict

setWidgetValue(key, value)[source]
showDialog(parent, wrap=2, section_wrap=2, style=None)[source]
Auto create widgets for corresponding options and

and return the dialog.

Parameters:
  • parent – parent frame

  • wrap – wrap for internal widgets

updateWidgets(kwds=None)[source]

Update widgets from stored or supplied kwds

class tablexplore.plotting.FormatOptions[source]

Bases: BaseOptions

This class also provides custom tools for adding items to the plot

class tablexplore.plotting.MPLBaseOptions[source]

Bases: BaseOptions

Class to provide a dialog for matplotlib options and returning the selected prefs

legendlocs = ['best', 'upper right', 'upper left', 'lower left', 'lower right', 'right', 'center left', 'center right', 'lower center', 'upper center', 'center']
update(df)[source]

Update data widget(s) when dataframe changes

class tablexplore.plotting.PlotViewer(table, parent=None)[source]

Bases: QWidget

Plot viewer class

addPlotWidget()[source]

Create mpl plot canvas and toolbar

applyPlotoptions()[source]

Apply the current plotter/options

autoscale(axis='y')[source]

Set all subplots to limits of largest range

bar3D(data, ax, kwds)[source]

3D bar plot

canvasResize(pad=50)[source]

Trigger resize canvas

checkColumnNames(cols)[source]

Check length of column names

check_kwds(kwds, kind)[source]
clear()[source]

Clear plot

colorsfromColormap(df, cmap)[source]

Column colors from cmap

contourData(data)[source]

Get data for contour plot

createOptions()[source]

Create option attributes for plotter

createWidgets()[source]

Create widgets. Plot on left and dock for tools on right.

customPlot()[source]

plot custom series

customiseSeries()[source]

Show custom options for current plot series. Allows plot types to be specified per series and uses a custom plot function.

dotplot(df, ax, kwds)[source]

Dot plot

getFigureSize()[source]
getSeries(data)[source]
getView()[source]
getcmap(name)[source]
heatmap(df, ax, kwds)[source]

Plot heatmap

meshData(x, y, z)[source]

Prepare 1D data for plotting in the form (x,y)->Z

plot()[source]
plot2D(redraw=True)[source]

Plot method for current data. Relies on pandas plot functionality if possible. There is some temporary code here to make sure only the valid plot options are passed for each plot kind.

plot3D(redraw=True)[source]

3D plot

plotBySeries()[source]

Plot different types depending on series

plotCurrent(redraw=True)[source]

Plot the current data

replot(data=None)[source]

Replot with given dataframe

savePlot(filename=None)[source]

Save the current plot

scatter(df, ax, axes_layout='single', alpha=0.8, marker='o', color=None, **kwds)[source]

A custom scatter plot rather than the pandas one. By default this plots the first column selected versus the others

scatter3D(data, ax, kwds)[source]

3D scatter plot

setAxisLabels(ax, kwds)[source]

Set a plots axis labels

setFigure(figure)[source]

Recreate canvas with given figure

setFigureOptions(axs, kwds)[source]

Set axis wide options such as ylabels, title

setStyle()[source]

Apply style

showTools()[source]

Show/hide tools dock

showWarning(text='plot error', ax=None)[source]

Show warning message in the plot window

simple_plot(df)[source]

test plot

staticMetaObject = <PySide2.QtCore.QMetaObject object>
updateData()[source]

Update data widgets

updateSeries(event=None)[source]

Update series with new plots

venn(data, ax, colormap=None, alpha=0.8)[source]

Plot venn diagram, requires matplotlb-venn

violinplot(df, ax, kwds)[source]

violin plot

zoom(zoomin=True)[source]

Zoom in/out to plot by changing size of elements

class tablexplore.plotting.PlotWidget(parent=None, figure=None, dpi=100, hold=False)[source]

Bases: FigureCanvasQTAgg

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.plotting.SeriesOptions(plotviewer)[source]

Bases: BaseOptions

Class for selecting custom plot types for each series

close()[source]
createButtons(parent)[source]
createSeriesWidgets(parent)[source]
showDialog(parent=None)[source]
Auto create widgets for corresponding options and

and return the dialog.

Parameters:
  • parent – parent frame

  • wrap – wrap for internal widgets

update(event=None)[source]

Update series options from widgets and replot

tablexplore.plotting.addFigure(parent, figure=None, resize_callback=None)[source]

Create a tk figure and canvas in the parent frame

tablexplore.plotting.defaultOptions()[source]

Get default plotting options

tablexplore.plotting.load_colormaps()[source]
tablexplore.plotting.update_colormaps()[source]

Load stored colormaps

tablexplore.plugin module

TablExplore plugin class Created January 2021 Copyright (C) Damien Farrell

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

class tablexplore.plugin.Plugin(parent=None)[source]

Bases: object

Base Plugin class, should be inherited by any plugin

capabilities = []
createWidgets(width=600, height=600)[source]

Create main widget with GUI elements. This will be specific to the plugin so it must be overrriden.

main(parent=None)[source]
menuentry = ''
quit(evt=None)[source]
requires = []
tablexplore.plugin.describe_class(obj)[source]

Describe the class object passed as argument, including its methods

tablexplore.plugin.describe_func(obj, method=False)[source]

Describe the function object passed as argument. If this is a method object, the second argument will be passed as True

tablexplore.plugin.find_plugins()[source]
tablexplore.plugin.get_plugins_classes(capability)[source]

Returns classes of available plugins

tablexplore.plugin.get_plugins_instances(capability)[source]

Returns instances of available plugins

tablexplore.plugin.init_plugin_system(folders)[source]

Find available plugins

tablexplore.plugin.load_plugins(plugins)[source]

Load plugins

tablexplore.plugin.parsefolder(folder)[source]

Parse for all .py files in plugins folder or zip archive

tablexplore.qt module

TablExplore app Created January 2021 Copyright (C) Damien Farrell

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

tablexplore.terminal module

Implements some dialog utilities for tableexplore Created Feb 2019 Copyright (C) Damien Farrell

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

class tablexplore.terminal.ExecThread[source]

Bases: QObject

cmd = None
def_to_run = None
finished
run()[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.terminal.QueueReceiver(queue, *args, **kwargs)[source]

Bases: QObject

run()[source]
sent
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class tablexplore.terminal.Terminal(parent=None, hist_file=None)[source]

Bases: QPlainTextEdit

active_queue_thread(queue)[source]
autocomplete(command)[source]

Ask different possibility from command arg, proposition is limited by AUTOCOMPLETE_LIMIT constant :param command: str :return: list of proposition

closeEvent(self, event: PySide2.QtGui.QCloseEvent) None[source]
contextMenuEvent(self, e: PySide2.QtGui.QContextMenuEvent) None[source]
count_cursor_lines()[source]

Slot def keep tracking cursor position line number. Useful to compare position to know if it is an editable line or not. :return:

exec_code(cmd)[source]
get_command()[source]

Get command, read last line and remove prompt length. :return: str command

get_cursor_position()[source]

Get cursor position :return: int line cursor position.

get_last_line()[source]

Get last terminal line. :return: str last line

get_next_history()[source]

Get next history in the readline GNU history file. :return: str history

get_previous_history()[source]

Get previous history in the readline GNU history file. :return: str history

init_history(hist_file)[source]

History initialisation with readline GNU, and use hook atexit for save history when program closing. :param hist_file: history file path :return:

keyPressEvent(event)[source]

Override to manage key board event. :param event: event key. :return:

press_enter
raw_input(prompt=None)[source]

Use to write the prompt command. :param prompt: str prompt :return:

remove_last_command()[source]

Remove current command. Useful for display history navigation. :return:

remove_last_line()[source]
save_history(hist_file)[source]

Hook def execute by atexit. :param hist_file: history file path :return:

setStyle(self, arg__1: PySide2.QtWidgets.QStyle) None[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
write(data)[source]

Append text to the Terminal. And keep cursor at the end. :param data: str data to write. :return:

write_autocomplete(command)[source]

Prepare text to write. :param command: str command :return:

write_prompt(data)[source]

Append text to the Terminal. And keep cursor at the end. :param data: str data to write. :return:

zoom(delta)[source]

tablexplore.util module

Implements the utility methods for tableexplore classes. Created August 2015 Copyright (C) Damien Farrell

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

tablexplore.util.adjustColorMap(cmap, minval=0.0, maxval=1.0, n=100)[source]

Adjust colormap to avoid using white in plots

tablexplore.util.checkDict(d)[source]

Check a dict recursively for non serializable types

tablexplore.util.checkOS()[source]

Check the OS we are in

tablexplore.util.check_multiindex(index)[source]

Check if index is a multiindex

tablexplore.util.colorScale(hex_color, brightness_offset=1)[source]

Takes a hex color and produces a lighter or darker variant. :returns: new color in hex format

tablexplore.util.gen_colors(cmap, n, reverse=False)[source]

Generates n distinct color from a given colormap. :param cmap: The name of the colormap you want to use.

Refer https://matplotlib.org/stable/tutorials/colors/colormaps.html to choose Suggestions: For Metallicity in Astrophysics: Use coolwarm, bwr, seismic in reverse For distinct objects: Use gnuplot, brg, jet,turbo.

Parameters:
  • n (int) – Number of colors you want from the cmap you entered.

  • reverse (bool) – False by default. Set it to True if you want the cmap result to be reversed.

Returns:

A list with hex values of colors.

Return type:

colorlist(list)

Taken from the mycolorpy package by binodbhttr see also https://matplotlib.org/stable/tutorials/colors/colormaps.html

tablexplore.util.gen_lower(n=2)[source]

Generate lower case words

tablexplore.util.gen_upper(n=2)[source]

Generate upper case words

tablexplore.util.gen_word(n=2)[source]

Generate words with strings or symbols

tablexplore.util.getAttributes(obj)[source]

Get non hidden and built-in type object attributes that can be persisted

tablexplore.util.getEmptyData(rows=10, columns=4)[source]
tablexplore.util.getFonts()[source]

Get the current list of system fonts

tablexplore.util.getPresetData(name)[source]

Get iris dataset

tablexplore.util.getSampleData(rows=400, cols=5, namelen=2)[source]

Generate sample data

tablexplore.util.get_user_config_directory()[source]

Returns a platform-specific root directory for user config settings.

tablexplore.util.hex_to_rgb(value)[source]
tablexplore.util.random_colors(n=10, seed=1)[source]

Generate random hex colors as list of length n.

tablexplore.util.setAttributes(obj, data)[source]

Set attributes from a dict. Used for restoring settings in tables

tablexplore.util.show_colors(colors, ax=None)[source]

display a list of colors

tablexplore.util.valueToBool(value)[source]

tablexplore.widgets module

Implements various widgets for tablexplore Created Oct 2021 Copyright (C) Damien Farrell

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

class tablexplore.widgets.ScratchPad(parent=None)[source]

Bases: QWidget

Temporary storage widget for plots and other items. Currently supports storing text, mpl figures and dataframes

clear()[source]

Clear plots

closeEvent(event)[source]

Close

createWidgets()[source]

Create widgets. Plot on left and dock for tools on right.

newText()[source]

Add a text editor

remove(idx)[source]

Remove selected tab and item widget

save()[source]

Save selected item

saveAll()[source]

Save all figures in a folder

staticMetaObject = <PySide2.QtCore.QMetaObject object>
update(items)[source]

Display a dict of stored objects

Module contents