frictionlessdata / tabulator-py

Python library for reading and writing tabular data via streams.
https://frictionlessdata.io
MIT License
235 stars 42 forks source link

Pass parameters to functions given to post_parse #284

Closed cslovell closed 4 years ago

cslovell commented 4 years ago

Currently there are post_parse functions--very cool: post_parse=[multiply_by_two]

Can we pass arguments to them? For instance, post_parse=[multiply_by_x(2)]?

If this is supported it would be great to see an example.

roll commented 4 years ago

Hi, you can use functools.partial for it. E.g. partial(multiple_by_x, 2)

Please re-open if it didn't help