{ "info": { "author": "Cho-Yi Chen", "author_email": "ntu.joey@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: General" ], "description": "tablet\r\n------\r\n\r\nTablet is a module that supports spreadsheet-like operations on tiny text tables.\r\n\r\nDealing with those tiny tables or spreadsheets (usually in CSV/TSV formats) is a daily chore.\r\n\r\nThe goal of this project is to provide a light-weight and easy-to-use\r\ntool that can handle daily-routines of manipulating tabular text data.\r\n\r\nInside the module, a \"Table\" class was defined to support all kinds of spreadsheet/table-like operations:\r\n * tsv/csv input/output\r\n * adding/removing rows and columns\r\n * lookup a key or keys\r\n * iterating\r\n * slicing\r\n * searching\r\n * sorting\r\n * filtering\r\n * grouping\r\n * joining\r\n * aggregating\r\n * removing duplicates\r\n * and more\r\n\r\nIf you are handling larger and more complex tables, spreadsheets, or panels, I suggest you turn to pandas.\r\n\r\n\r\nGetting Started\r\n---------------\r\n\r\nSupposing a given csv file named looks like below::\r\n\r\n Heat,Lane,LastName,FirstName,YOB,NOC,RT,Time\r\n 1,1,SILADJI,Caba,1990,SRB,0.69,27.89\r\n 1,2,SCOZZOLI,Fabio,1988,ITA,0.62,27.37\r\n 1,3,SNYDERS,Glenn,1987,NZL,0.66,27.64\r\n 1,4,MARKIC,Matjaz,1983,SLO,0.73,27.71\r\n 1,5,GANGLOFF,Mark,1982,USA,0.67,27.57\r\n 1,6,FELDWEHR,Hendrik,1986,GER,0.70,27.53\r\n 1,7,BARTUNEK,Petr,1991,CZE,0.64,27.87\r\n 1,8,POLYAKOV,Vladislav,1983,KAZ,0.77,27.81\r\n 2,1,RICKARD,Brenton,1983,AUS,0.71,27.80\r\n 2,2,AGACHE,Dragos,1984,ROU,0.76,27.71\r\n 2,3,DALE OEN,Alexander,1985,NOR,0.70,27.33\r\n 2,4,FRANCA DA SILVA,Felipe,1987,BRA,0.68,26.95\r\n 2,5,DUGONJIC,Damir,1988,SLO,0.75,27.51\r\n 2,6,VAN DER BURGH,Cameron,1988,RSA,0.63,26.90\r\n 2,7,TRIZNOV,Aleksandr,1991,RUS,0.70,27.73\r\n 2,8,STEKELENBURG,Lennart,1986,NED,0.69,27.51\r\n\r\nUsers can use the following statements to show the top 8 best-time results:\r\n\r\n>>> import tablet as T\r\n>>> t = T.read('demo.csv', delim=',').sort('Time')\r\n>>> for row in t[:8]:\r\n... print row[2], row[3], row[-1]\r\n...\r\nVAN DER BURGH Cameron 26.90\r\nFRANCA DA SILVA Felipe 26.95\r\nDALE OEN Alexander 27.33\r\nSCOZZOLI Fabio 27.37\r\nDUGONJIC Damir 27.51\r\nSTEKELENBURG Lennart 27.51\r\nFELDWEHR Hendrik 27.53\r\nGANGLOFF Mark 27.57\r\n\r\nAnd output the top 8 results to a new tsv (tab-separated values) file:\r\n\r\n>>> t2 = t.cut_cols(['LastName','FirstName','Time']).cut_rows(range(8))\r\n>>> t2.show()\r\nH ['LastName', 'FirstName', 'Time']\r\n0 ['VAN DER BURGH', 'Cameron', '26.90']\r\n1 ['FRANCA DA SILVA', 'Felipe', '26.95']\r\n2 ['DALE OEN', 'Alexander', '27.33']\r\n3 ['SCOZZOLI', 'Fabio', '27.37']\r\n4 ['DUGONJIC', 'Damir', '27.51']\r\n5 ['STEKELENBURG', 'Lennart', '27.51']\r\n6 ['FELDWEHR', 'Hendrik', '27.53']\r\n7 ['GANGLOFF', 'Mark', '27.57']\r\n>>> t2.write('finalists.tsv')", "description_content_type": null, "docs_url": "https://pythonhosted.org/tablet/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/tablet", "keywords": "table,spreadsheet,tsv,csv", "license": "UNKNOWN", "maintainer": "", "maintainer_email": "", "name": "tablet", "package_url": "https://pypi.org/project/tablet/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tablet/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/tablet" }, "release_url": "https://pypi.org/project/tablet/0.9.3/", "requires_dist": null, "requires_python": null, "summary": "A tiny spreadsheet-like data structure and tool", "version": "0.9.3" }, "last_serial": 1468597, "releases": { "0.9.3": [ { "comment_text": "", "digests": { "md5": "bdd6db44ef13bfb06d62f2727912686a", "sha256": "bffde86427d7bda839c2a9e0814aca03c27e620e376728f5d15870ed678d3409" }, "downloads": -1, "filename": "tablet-0.9.3.win32.exe", "has_sig": false, "md5_digest": "bdd6db44ef13bfb06d62f2727912686a", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 210277, "upload_time": "2012-07-23T16:34:42", "url": "https://files.pythonhosted.org/packages/bb/1b/d856b9c7b592a2bc0e0d1c1c23e96ffbbc30027b774a843563e803808397/tablet-0.9.3.win32.exe" }, { "comment_text": "", "digests": { "md5": "58a64b9005bb72da59f88037dbf6bc96", "sha256": "019c952ffe917fa56c92764589f676db128611d29e3bb780658c40e043455d36" }, "downloads": -1, "filename": "tablet-0.9.3.zip", "has_sig": false, "md5_digest": "58a64b9005bb72da59f88037dbf6bc96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12905, "upload_time": "2012-07-23T16:34:38", "url": "https://files.pythonhosted.org/packages/30/20/287216a24f6bb160039f57084263f24675c3da7a7107a49c1587e0d9e208/tablet-0.9.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bdd6db44ef13bfb06d62f2727912686a", "sha256": "bffde86427d7bda839c2a9e0814aca03c27e620e376728f5d15870ed678d3409" }, "downloads": -1, "filename": "tablet-0.9.3.win32.exe", "has_sig": false, "md5_digest": "bdd6db44ef13bfb06d62f2727912686a", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 210277, "upload_time": "2012-07-23T16:34:42", "url": "https://files.pythonhosted.org/packages/bb/1b/d856b9c7b592a2bc0e0d1c1c23e96ffbbc30027b774a843563e803808397/tablet-0.9.3.win32.exe" }, { "comment_text": "", "digests": { "md5": "58a64b9005bb72da59f88037dbf6bc96", "sha256": "019c952ffe917fa56c92764589f676db128611d29e3bb780658c40e043455d36" }, "downloads": -1, "filename": "tablet-0.9.3.zip", "has_sig": false, "md5_digest": "58a64b9005bb72da59f88037dbf6bc96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12905, "upload_time": "2012-07-23T16:34:38", "url": "https://files.pythonhosted.org/packages/30/20/287216a24f6bb160039f57084263f24675c3da7a7107a49c1587e0d9e208/tablet-0.9.3.zip" } ] }