2010-09-12 13:28:55 -04:00
2010-09-12 11:45:31 -04:00
2010-09-12 13:12:21 -04:00
2010-09-12 13:13:08 -04:00
2010-09-12 13:13:43 -04:00
2010-09-12 13:12:21 -04:00
MIT
2010-07-13 08:54:26 -04:00
2010-09-12 13:28:55 -04:00
2010-09-12 13:16:05 -04:00
2010-09-12 13:17:21 -04:00

Tablib: format-agnostic tabular dataset library
===============================================

::

	_____         ______  ___________ ______  
	__  /_______ ____  /_ ___  /___(_)___  /_ 
	_  __/_  __ `/__  __ \__  / __  / __  __ \
	/ /_  / /_/ / _  /_/ /_  /  _  /  _  /_/ /
	\__/  \__,_/  /_.___/ /_/   /_/   /_.___/



Tablib is a format-agnostic tabular dataset library, written in Python. 

Formats supported:

- JSON
- YAML
- Excel
- CSV

At this time, Tablib supports the **export** of it's powerful Dataset object instances into any of the above formats. Import is underway.

Please note that tablib *purposefully* excludes XML support. It always will.


Features
--------

    
Populate fresh data files: ::
    
    headers = ('first_name', 'last_name', 'gpa')

    data = [
        ('John', 'Adams', 4.0),
        ('George', 'Washington', 2.6),
        ('Henry', 'Ford', 2.3)
    ]
    
    data = tablib.Dataset(*data, headers=headers)

    # Establish file location and save
    data.save('test.xls')
    

Intelligently add new rows: ::

    data.append('Bob', 'Dylan', 3.2)
    
    print data.headers
    # >>> ('first_name', 'last_name', 'gpa')
    

Slice rows:  ::

    print data[0:1]
    # >>> [('John', 'Adams', 4.0), ('George', 'Washington', 2.6)]
    

Slice columns by header: ::

    print data['first_name']
    # >>> ['John', 'George', 'Henry']


Manipulate rows by index: ::

    del data[0]
    print data[0:1]
    # >>> [('George', 'Washington', 2.6), ('Henry', 'Ford', 2.3)]

    
Installation
------------

To install tablib, simply: ::

	$ pip install tablib
	
Or, if you absolutely must: ::

	$ easy_install tablib
    

Contribute
----------

If you'd like to , simply fork `the repository`_, commit your changes, and send a pull requests. Make sure you add yourself to AUTHORS_!


Roadmap
-------
- Import datasets from CSV, JSON, YAML
- Release CLI Interface
- Auto-detect import format
- Add possible other exports (SQL?)
- Possibly plugin-ify format architecture
- Plugin support

.. _`the repository`: http://github.com/kennethreitz/tablib
.. _AUTHORS: http://github.com/kennethreitz/tablib/blob/master/AUTHORS
S
Description
Languages
Python 100%