Compare commits

...

15 Commits

Author SHA1 Message Date
Kenneth Reitz dc21825f34 Merge branch 'release/0.7.1' 2010-09-20 21:39:47 -04:00
Kenneth Reitz 7364995eaa Version bump (v0.7.1) 2010-09-20 21:39:27 -04:00
Kenneth Reitz 3407170b99 Updated TODO. 2010-09-20 21:37:32 -04:00
Kenneth Reitz dd13744c92 Documentation update for properties. 2010-09-20 21:37:08 -04:00
Kenneth Reitz 31e4c39762 Updated tests for reverted methods. 2010-09-20 21:34:01 -04:00
Kenneth Reitz 4fc70957ac Reverted methods back to properties. 2010-09-20 21:33:48 -04:00
Kenneth Reitz 7f17ccf445 Merge branch 'hotfix/dict' into develop 2010-09-20 14:37:36 -04:00
Kenneth Reitz fbcc3b60af Merge branch 'hotfix/dict' 2010-09-20 14:37:26 -04:00
Kenneth Reitz 9b3268f0ad Whoops. 2010-09-20 14:37:10 -04:00
Kenneth Reitz f386ef8ac8 Merge branch 'feature/unicode' into develop 2010-09-20 14:18:55 -04:00
Kenneth Reitz e8f5e023c4 Version bump (v0.7.0). 2010-09-20 14:18:31 -04:00
Kenneth Reitz 81445aeec8 Updated readme to reflect property to method changes. 2010-09-20 14:05:15 -04:00
Kenneth Reitz f94a236122 Changed export properties to methods. 2010-09-20 14:04:02 -04:00
Kenneth Reitz bfbb7c626f Moved from cStringIO to StringIO. More stable. 2010-09-20 12:50:10 -04:00
Kenneth Reitz be0f77f9ee Merge branch 'release/0.6.4' into develop 2010-09-20 09:21:51 -04:00
4 changed files with 36 additions and 23 deletions
+19 -3
View File
@@ -1,11 +1,27 @@
History
=======
0.6.4 (2010-09-13)
0.7.1 (2010-09-20)
------------------
* Updated unicode export for XLS
* More exhaustive unit tests
* Reverting methods back to properties.
* Windows bug compenated in documentation.
0.7.0 (2010-09-20)
------------------
* 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)
+3 -4
View File
@@ -106,8 +106,8 @@ EXCEL!
++++++
::
>>> open('people.xls').write(data.xls)
>>> open('people.xls', 'wb').write(data.xls)
It's that easy.
@@ -131,7 +131,6 @@ If you'd like to contribute, simply fork `the repository`_, commit your changes
Roadmap
-------
- Add ability to add/remove full columns
- Import datasets from CSV, JSON, YAML
- Release CLI Interface
- Auto-detect import format
@@ -141,4 +140,4 @@ Roadmap
- Plugin support
.. _`the repository`: http://github.com/kennethreitz/tablib
.. _AUTHORS: http://github.com/kennethreitz/tablib/blob/master/AUTHORS
.. _AUTHORS: http://github.com/kennethreitz/tablib/blob/master/AUTHORS
+1 -1
View File
@@ -18,7 +18,7 @@ if sys.argv[-1] == "publish":
setup(
name='tablib',
version='0.6.4',
version='0.7.1',
description='Format agnostic tabular data library (XLS, JSON, YAML, CSV)',
long_description=open('README.rst').read() + '\n\n' +
open('HISTORY.rst').read(),
+13 -15
View File
@@ -21,8 +21,8 @@ from helpers import *
# __all__ = ['Dataset', 'DataBook']
__name__ = 'tablib'
__version__ = '0.6.4'
__build__ = 0x000604
__version__ = '0.7.1'
__build__ = 0x000701
__author__ = 'Kenneth Reitz'
__license__ = 'MIT'
__copyright__ = 'Copyright 2010 Kenneth Reitz'
@@ -149,7 +149,6 @@ class Dataset(object):
self.__headers = None
@property
def dict(self):
"""Returns python dict of Dataset."""
@@ -161,13 +160,11 @@ class Dataset(object):
"""Returns JSON representation of Dataset."""
return json.dumps(self.dict)
@property
def yaml(self):
"""Returns YAML representation of Dataset."""
return yaml.dump(self.dict)
@property
def csv(self):
"""Returns CSV representation of Dataset."""
@@ -179,18 +176,18 @@ class Dataset(object):
return stream.getvalue()
@property
def xls(self):
"""Returns XLS representation of Dataset."""
stream = cStringIO.StringIO()
wb = xlwt.Workbook()
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.decode('utf8'))
ws.write(i, j, col)
stream = cStringIO.StringIO()
wb.save(stream)
return stream.getvalue()
@@ -227,7 +224,7 @@ class Dataset(object):
pass
class DataBook(object):
class Databook(object):
"""A book of Dataset objects.
Currently, this exists only for XLS workbook support.
"""
@@ -266,13 +263,12 @@ class DataBook(object):
"""The number of the Datasets within DataBook."""
return len(self._datasets)
@property
def xls(self):
"""Returns XLS representation of DataBook."""
stream = cStringIO.StringIO()
wb = xlwt.Workbook()
wb = xlwt.Workbook(encoding='utf8')
for i, dset in enumerate(self._datasets):
ws = wb.add_sheet(dset.title if dset.title else 'Sheet%s' % (i))
@@ -280,12 +276,14 @@ class DataBook(object):
#for row in self._package(dicts=False):
for i, row in enumerate(dset._package(dicts=False)):
for j, col in enumerate(row):
ws.write(i, j, str(col))
ws.write(i, j, col)
stream = cStringIO.StringIO()
wb.save(stream)
return stream.getvalue()
@property
def json(self):
"""Returns JSON representation of Databook."""