tablet

A tiny spreadsheet-like data structure and tool
Download

tablet Ranking & Summary

Advertisement

  • Rating:
  • License:
  • BSD License
  • Price:
  • FREE
  • Publisher Name:
  • Cho-Yi Chen

tablet Tags


tablet Description

tablet is a Python module that supports spreadsheet-like operations on tiny text tables.Dealing with those tiny tables or spreadsheets (usually in CSV/TSV formats) is a daily chore.The goal of this project is to provide a light-weighted and easy-to-use tool that can handle daily-routines of manipulating tabular text data.Inside the module, a "Table" class was defined to support all kinds of spreadsheet/table-like operations:- tsv/csv input/output- adding/removing rows and columns- lookup a key or keys- iterating- slicing- searching- sorting- filtering- grouping- joining- aggregating- removing duplicates- and moreGetting StartedSupposing a given csv file named < demo.csv >:Heat,Lane,LastName,FirstName,YOB,NOC,RT,Time1,1,SILADJI,Caba,1990,SRB,0.69,27.891,2,SCOZZOLI,Fabio,1988,ITA,0.62,27.371,3,SNYDERS,Glenn,1987,NZL,0.66,27.641,4,MARKIC,Matjaz,1983,SLO,0.73,27.711,5,GANGLOFF,Mark,1982,USA,0.67,27.571,6,FELDWEHR,Hendrik,1986,GER,0.70,27.531,7,BARTUNEK,Petr,1991,CZE,0.64,27.871,8,POLYAKOV,Vladislav,1983,KAZ,0.77,27.812,1,RICKARD,Brenton,1983,AUS,0.71,27.802,2,AGACHE,Dragos,1984,ROU,0.76,27.712,3,DALE OEN,Alexander,1985,NOR,0.70,27.332,4,FRANCA DA SILVA,Felipe,1987,BRA,0.68,26.952,5,DUGONJIC,Damir,1988,SLO,0.75,27.512,6,VAN DER BURGH,Cameron,1988,RSA,0.63,26.902,7,TRIZNOV,Aleksandr,1991,RUS,0.70,27.732,8,STEKELENBURG,Lennart,1986,NED,0.69,27.51Users can type the following statements to show the top 8 results:>>> import tablet as T>>> t = T.read('demo.csv', delim=',').sort('Time')>>> for row in t:... print row, row, row...VAN DER BURGH Cameron 26.90FRANCA DA SILVA Felipe 26.95DALE OEN Alexander 27.33SCOZZOLI Fabio 27.37DUGONJIC Damir 27.51STEKELENBURG Lennart 27.51FELDWEHR Hendrik 27.53GANGLOFF Mark 27.57And output the top 8 results to a new tsv file:>>> t2 = t.cut_cols().cut_rows(range(8))>>> t2.show()H 0 1 2 3 4 5 6 7 >>> t2.write('finalists.tsv')Product's homepage


tablet Related Software