关系数据库表查看器,不使用handsontable。
htmlviewer的Python项目详细描述
htmlviewer
关系数据库表查看器,不使用handsontable。
实际上,可以查看任何json可序列化字典的列表。
这是pyhandsontable的重拍。
安装
pip install htmlviewer
用法
在Jupyter笔记本中,
>>>fromhtmlviewerimportPagedViewer>>>viewer=PagedViewer(LIST_OF_RECORDS,**kwargs)>>>viewer'A table is shown on Jupyter Notebook.'>>>viewer.view(-1)'The last page is shown.'>>>viewer.previous()'The previous page (i-1) is shown.'>>>viewer.next()'The next page (i+1) is shown.
可接受的千瓦数是,
{'maxColWidth':200,# Maximum column width for all columns.'minColWidth':'8em','maxRowHeight':500,# Maximum row height for all rows.,'colWidth':{'imageField':500},'renderer':{'imageField':'html'# Set the field to allow HTML.}'rowHeader':'id'# Selecting a custom column to be the first row, aka rowHeader.}
嵌入图像、标记和HTML。
这可以在python端完成,将所有内容转换为html。只需使用any markdown for Python library。
frommarkdownimportmarkdownimportbase64image_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)
任何时候,
PagedViewer(LIST_OF_RECORDS,renderers={"image_field":"html","html_field":"html","markdown_field":"html"})
屏幕截图
相关项目
- pyhandsontable-在jupyter笔记本的handsontable中查看json可序列化词典或二维数组的列表。