.. -*- restructuredtext -*-

====================
README for Tabledown
====================

News
====
* 2011.01.08 Version 0.1 released

Download
========

Get a local copy of the tabledown repository with this command::

    hg clone https://tabledown.googlecode.com/hg/ tabledown 


Installing
==========

Use ``setup.py``::

    python setup.py build
    sudo python setup.py install


Reading the docs
================

After download::

   cd doc
   sphinx-build . _build/html

Then, direct your browser to ``_build/html/index.html``.


Testing
=======

Use ``nose``::

    cd tests
    nosetests


Examples
========

Under ``example``::

    cd example
    python
    Python 2.6.6 (r266:84292, Dec 23 2010, 07:01:15) 
    [GCC 4.0.1 (Apple Inc. build 5490)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from tabledown.tdxls import TDXls
    >>> mcc = {
    ...     '_':['master','contacts'],
    ...     'master':{
    ...         'company':['A^1',u'Company']
    ...     },
    ...     'contacts':{
    ...         '*':{
    ...             'name':['A1',u'Name'],
    ...             'tel':['B1',u'Tel'],
    ...             'addr':['C1',u'Addr'],
    ...         },
    ...     },
    ... }
    >>> data = {
    ...     'master': {'company': u'Foo Inc.'},
    ...     'contacts': [
    ...         {'name': u'Bar', 'tel': u'#1000', 'addr': u'Taipei'},
    ...         {'name': u'Qux', 'tel': u'#2000', 'addr': u'Hsinchu'},
    ...         {'name': u'Quux', 'tel': u'#3000', 'addr': u'Tainan'},
    ...     ]
    ... }
    >>> tdx = TDXls(mcc)
    >>> tdx.dict2xls(data, 'example.xls')
    >>> tdx.xls2dict('example.xls')
    {u'Sheet 1': {'master': {'company': u'Foo Inc.'}, 'contacts': [{'tel':
    u'#1000', 'name': u'Bar', 'addr': u'Taipei'}, {'tel': u'#2000', 'name':
    u'Qux', 'addr': u'Hsinchu'}, {'tel': u'#3000', 'name': u'Quux', 'addr':
    u'Tainan'}]}}


Contributing
============

Send wishes, comments, patches, etc. to tabledown@googlegroups.com.
