|
Project Information
Links
|
News 2011-01-08 Version 0.1 released InstallingUse setup.py: python setup.py build
sudo python setup.py install Reading the docsAfter download: cd doc
sphinx-build . _build/html Then, direct your browser to build/html/index.html. TestingUse nose: cd tests
nosetests ExamplesAfter install: 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'}]}}ContributingSend wishes, comments, patches, etc. to tabledown@googlegroups.com.
|