Support transforms, fixes #28
This commit is contained in:
parent
36cbd4e417
commit
70eece9e77
@ -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.
|
||||||
|
|||||||
@ -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()
|
||||||
|
|
||||||
|
|||||||
2
setup.py
2
setup.py
@ -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=[
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user