Skip to main content

View a list of dictionaries or a 2-D array, in HandsOnTable, in Jupyter Notebook.

Project description


Build Status PyPI version PyPI license PyPI pyversions

View a list of JSON-serializable dictionaries or a 2-D array, in HandsOnTable, in Jupyter Notebook.

Nested JSON renderer is also supported and is default. Image and markdown renderers are possible, but has to be extended.


pip install pyhandsontable


In Jupyter Notebook,

>>> from pyhandsontable import PagedViewer
>>> viewer = PagedViewer(data=data_matrix, **kwargs)
>>> viewer
'A Handsontable is shown in Jupyter Notebook.'
>>> viewer.view(-1)
'The last page is shown.'
>>> viewer.previous()
'The previous page (i-1) is shown.'
'The next page (i+1) is shown.'

Data matrix can be either a list of lists (2-D array) or a list of dictionaries.

It is also possible to view all entries at once, but it could be bad, if there are too many rows.

>>> from pyhandsontable import view_table
>>> view_table(data_matrix, **kwargs)

Acceptable kwargs

  • height: height of the window (default: 500)
  • width: width of the window (default: 1000)
  • title: title of the HTML file
  • maxColWidth: maximum column width. (Default: 200)
  • renderers: the renderers to use in generating the columns (see below.)
  • autodelete: whether the temporary HTML file should be autodeleted. (Default: True)
  • filename: filename of the temporary HTML file (default: 'temp.handsontable.html')
  • css: url of the Handsontable CSS
  • js: url of the Handsontable Javascript
  • config: add additional config as defined in
    • This will override the default config (per key basis) which are:
    data: data,
    rowHeaders: true,
    colHeaders: true,
    columns: columns,
    manualColumnResize: true,
    manualRowResize: true,
    renderAllRows: true,
    modifyColWidth: (width, col)=>{
        if(width > maxColWidth) return maxColWidth;
    afterRenderer: (td, row, column, prop, value, cellProperties)=>{
        td.innerHTML = td.innerHTML.slice(0, config.charLimit || 5000);

renderers example, if your data is a 2-D array:

    1: 'html',
    2: 'html'

or if your data is list of dict:

    "front": 'html',
    "back": 'html'

Enabling Image, HTML and Markdown renderer

This can be done in Python side, by converting everything to HTML. Just use any markdown for Python library.

from markdown import markdown
import base64
image_html = f'<img src="{image_url}" width=100 />'
image_html2 = f'<img src="data:image/png;base64,{base64.b64encode(image_bytes).decode()}" />'
markdown_html = markdown(markdown_raw)

Any then,

PagedViewer(data=data_matrix, renderers={
    "image_field": "html",
    "html_field": "html",
    "markdown_field": "html"


1.png 0.png

Related projects

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyhandsontable, version 0.2.14
Filename, size File type Python version Upload date Hashes
Filename, size pyhandsontable-0.2.14-py3-none-any.whl (12.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pyhandsontable-0.2.14.tar.gz (6.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page