{ "info": { "author": "\u00c1lvaro Justen", "author_email": "alvarojusten@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License (GPL)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "outputty\n========\n\n``outputty`` is a simple Python library that helps you importing, filtering\nand exporting data. It is composed by a main ``Table`` class and a lot of\nplugins that helps importing and exporting data to/from ``Table``.\n\nYou can write your own plugin easily (see ``outputty/plugin_*.py`` for\nexamples). Some examples of plugins are: CSV, text, HTML and histogram.\n\n\nInstallation\n------------\n\nAs simple as executing::\n\n pip install outputty\n\n\nNote: as ``pip`` tries to compile everything and ``outputty`` depends on\n``MySQL-Python`` package (which needs compilation), you need to have\nlibmysqlclient's headers, compilers and related stuff. To install it on\nDebian/Ubuntu, just execute::\n\n apt-get install build-essential libmysqlclient-dev\n\n\nExample\n-------\n\nCode time!::\n\n >>> from outputty import Table\n >>> my_table = Table(headers=['name', 'age']) # headers are the columns\n >>> my_table.append(('\u00c1lvaro Justen', 24)) # a row as tuple\n >>> my_table.append({'name': 'Other User', 'age': 99}) # a row as dict\n >>> print my_table # a text representation of Table\n +---------------+-----+\n | name | age |\n +---------------+-----+\n | \u00c1lvaro Justen | 24 |\n | Other User | 99 |\n +---------------+-----+\n\n >>> print 'First row:', my_table[0] # Table is indexable\n First row: [u'\\xc1lvaro Justen', 24]\n\n >>> print 'Sum of ages:', sum(my_table['age']) # you can get columns too\n Sum of ages: 123\n\n >>> my_table.write('csv', 'my-table.csv') # CSV plugin will save its contents in a file\n >>> # let's see what's in the file...\n >>> print open('my-table.csv').read()\n \"name\",\"age\"\n \"\u00c1lvaro Justen\",\"24\"\n \"Other User\",\"99\"\n\n >>> # let's use HTML plugin!\n >>> print my_table.write('html') # without filename ``write`` will return a string\n
| name | \nage | \n
|---|---|
| \u00c1lvaro Justen | \n24 | \n
| Other User | \n99 | \n