Support transforms, fixes #28

This commit is contained in:
Friedrich Lindenberg 2013-09-19 19:25:28 +02:00
parent 36cbd4e417
commit 70eece9e77
3 changed files with 8 additions and 1 deletions

View File

@ -3,5 +3,7 @@
*The changelog has only been started with version 0.3.12, previous *The changelog has only been started with version 0.3.12, previous
changes must be reconstructed from revision history.* changes must be reconstructed from revision history.*
* 0.3.13: Fixed logging, added support for transformations on result
rows to support slug generation in output (#28).
* 0.3.12: Makes table primary key's types and names configurable, fixing * 0.3.12: Makes table primary key's types and names configurable, fixing
#19. Contributed by @dnatag. #19. Contributed by @dnatag.

View File

@ -68,7 +68,12 @@ class Serializer(object):
def serialize(self): def serialize(self):
self.init() self.init()
transforms = self.export.get('transform', {})
for row in self.query: for row in self.query:
for field, operation in transforms.items():
row[field] = OPERATIONS.get(operation)(row.get(field))
self.write(self.file_name(row), row) self.write(self.file_name(row), row)
self.close() self.close()

View File

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup( setup(
name='dataset', name='dataset',
version='0.3.12', version='0.3.13',
description="Toolkit for Python-based data processing.", description="Toolkit for Python-based data processing.",
long_description="", long_description="",
classifiers=[ classifiers=[