PK!C++pyhandsontable/__init__.pyfrom .app import generate_html, view_table PK!x3Gpyhandsontable/app.pyfrom jinja2 import Environment, PackageLoader from threading import Timer import os from collections import OrderedDict from IPython.display import IFrame env = Environment( loader=PackageLoader('pyhandsontable', 'templates') ) def generate_html(data, **kwargs): if not data: raise ValueError('Please input some data.') columns = list() if isinstance(data[0], (dict, OrderedDict)): colHeaders = kwargs.get('colHeaders', data[0].keys()) else: colHeaders = kwargs.get('colHeaders', range(len(data[0]))) for header in colHeaders: entry = {'data': header} if 'renderers' in kwargs.keys(): entry['renderer'] = kwargs['renderers'].get(header) columns.append(entry) colHeaders = kwargs.get('colHeaders', True) rowHeaders = kwargs.get('rowHeaders', True) template = env.get_template('sheet.html') return template.render(data=data, columns=columns, colHeaders=colHeaders, rowHeaders=rowHeaders, **kwargs) def view_table(data, width=800, height=500, filename='temp.handsontable.html', autodelete=True, **kwargs): # A TemporaryFile does not work with Jupyter Notebook try: with open(filename, 'w') as f: f.write(generate_html(data=data, width=width, height=height, **kwargs)) return IFrame(filename, width=width, height=height) finally: if autodelete: Timer(5, os.unlink, args=[filename]).start() PK!F/kqq#pyhandsontable/templates/sheet.html {{ title }}
PK! ::&pyhandsontable-0.2.0.dist-info/LICENSEMIT License Copyright (c) 2018 Pacharapol Withayasakpunt Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK!H_zTT$pyhandsontable-0.2.0.dist-info/WHEEL A н#Z;/"d&F[xzw@Zpy3Fv]n0H*J>mlcAPK!H򘧊'pyhandsontable-0.2.0.dist-info/METADATAXms6_|b׹8mľvn<"A 6Ih_$%flﳻ>0MSi;*=,]*UtQ0=2NUzɠ+&AdnZI\_Hl!čN,i Z*Ns͂$h(V-sU >yv%dPƘuze '4Y:1ʦ-Un*XIycpT伈pO*3Pc1k)nYjѺn{D\Ҳ4{Ouik鷌_!o1\8GWdЬD/CSaKCDZ##L+tt֘vxUy϶MËN5Ս;xiIoNFQ Id9/B+NړcujY* 9QDͧX3ohHm,0<AyXkJC;g+*%mCJ\n %-KX1}v&j!lWRA>JiZ󮮮Pl W%Zm"ŠUܢN^Orl’|ٴwYR-]ϟ߬Ul\!V-~$v NE.L/3lxw=d-wGØ^6%$h ,M}aom )VM,ZV6)WuAlaF=̒UHx1ʆ@&$06koB`$'wǙq ѐ5:XX09~F) NQTe*E6lRD7؂}2 SV0iZ-&H,ifc}ȗAA]tmJ=2ԕ=9tO]loa̜) {#Fc"#[EA<換b Tu1&5>"II[{yal{۰?=f`i1ydiG~Q(F qb87Kx6B-#6wm;;`c#DS 㒑JKv;=dzGՖxɤP`xw\o_9_&p+g|Q]h71xz_8ֈC+Y,5?lRU L e=%pyhandsontable-0.2.0.dist-info/RECORDv0} B@A&D,~3Ӎ8dCϋVө~:,0RЌUDו%yyEWO.r=kzq0O_%xIZ-+Ncu}GύWH ^%#UE; X{AlZؗCmP{.c1 e^H,Jga;gƝd@]Dz cٸ\woHOl5q? pyhandsontable-0.2.0.dist-info/LICENSEPK!H_zTT$pyhandsontable-0.2.0.dist-info/WHEELPK!H򘧊'Rpyhandsontable-0.2.0.dist-info/METADATAPK!H:>e=%pyhandsontable-0.2.0.dist-info/RECORDPK*E