mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 23:10:17 +00:00
Version bump (v0.7.0).
This commit is contained in:
+12
-3
@@ -1,11 +1,20 @@
|
||||
History
|
||||
=======
|
||||
|
||||
0.6.4 (2010-09-13)
|
||||
0.7.0 (2010-09-20)
|
||||
------------------
|
||||
|
||||
* Updated unicode export for XLS
|
||||
* More exhaustive unit tests
|
||||
* Renamed DataBook Databook for consistiency.
|
||||
* Export properties changed to methods (XLS filename / StringIO bug).
|
||||
* Optional Dataset.xls(path='filename') support (for writing on windows).
|
||||
* Added utf-8 on the worksheet level.
|
||||
|
||||
|
||||
0.6.4 (2010-09-19)
|
||||
------------------
|
||||
|
||||
* Updated unicode export for XLS.
|
||||
* More exhaustive unit tests.
|
||||
|
||||
|
||||
0.6.3 (2010-09-14)
|
||||
|
||||
@@ -18,7 +18,7 @@ if sys.argv[-1] == "publish":
|
||||
|
||||
setup(
|
||||
name='tablib',
|
||||
version='0.6.4',
|
||||
version='0.7.0',
|
||||
description='Format agnostic tabular data library (XLS, JSON, YAML, CSV)',
|
||||
long_description=open('README.rst').read() + '\n\n' +
|
||||
open('HISTORY.rst').read(),
|
||||
|
||||
+21
-9
@@ -21,8 +21,8 @@ from helpers import *
|
||||
# __all__ = ['Dataset', 'DataBook']
|
||||
|
||||
__name__ = 'tablib'
|
||||
__version__ = '0.6.4'
|
||||
__build__ = 0x000604
|
||||
__version__ = '0.7.0'
|
||||
__build__ = 0x000700
|
||||
__author__ = 'Kenneth Reitz'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright 2010 Kenneth Reitz'
|
||||
@@ -178,16 +178,21 @@ class Dataset(object):
|
||||
|
||||
def xls(self, path=None):
|
||||
"""Returns XLS representation of Dataset."""
|
||||
stream = StringIO.StringIO()
|
||||
|
||||
wb = xlwt.Workbook(encoding='utf8')
|
||||
ws = wb.add_sheet(self.title if self.title else 'Tabbed Dataset')
|
||||
|
||||
for i, row in enumerate(self._package(dicts=False)):
|
||||
for j, col in enumerate(row):
|
||||
ws.write(i, j, col)
|
||||
|
||||
wb.save(stream)
|
||||
return stream.getvalue()
|
||||
if path:
|
||||
wb.save(path)
|
||||
return True
|
||||
else:
|
||||
stream = StringIO.StringIO()
|
||||
wb.save(stream)
|
||||
return stream.getvalue()
|
||||
|
||||
|
||||
def append(self, row=None, col=None):
|
||||
@@ -222,7 +227,7 @@ class Dataset(object):
|
||||
pass
|
||||
|
||||
|
||||
class DataBook(object):
|
||||
class Databook(object):
|
||||
"""A book of Dataset objects.
|
||||
Currently, this exists only for XLS workbook support.
|
||||
"""
|
||||
@@ -265,7 +270,7 @@ class DataBook(object):
|
||||
def xls(self, path=None):
|
||||
"""Returns XLS representation of DataBook."""
|
||||
|
||||
stream = cStringIO.StringIO()
|
||||
|
||||
wb = xlwt.Workbook(encoding='utf8')
|
||||
|
||||
for i, dset in enumerate(self._datasets):
|
||||
@@ -276,8 +281,15 @@ class DataBook(object):
|
||||
for j, col in enumerate(row):
|
||||
ws.write(i, j, col)
|
||||
|
||||
wb.save(stream)
|
||||
return stream.getvalue()
|
||||
|
||||
|
||||
if path:
|
||||
wb.save(path)
|
||||
return True
|
||||
else:
|
||||
stream = cStringIO.StringIO()
|
||||
wb.save(stream)
|
||||
return stream.getvalue()
|
||||
|
||||
|
||||
def json(self):
|
||||
|
||||
Reference in New Issue
Block a user