inveniosoftware / dojson

Simple pythonic JSON to JSON converter.
https://dojson.readthedocs.io
Other
10 stars 29 forks source link

utils: yield_each_value addition #147

Closed jacquerie closed 8 years ago

jacquerie commented 8 years ago

Here's the thing I was mentioning yesterday on Gitter. Instead of filing an issue I decided to send a PR.

CC: @kaplun

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.004%) to 82.78% when pulling 65ae9614f39e137098fd85bced1da634a2288184 on jacquerie:add-yield-each-value into 117fa7421059a859a42e1b8edf7b4b750e297900 on inveniosoftware:master.

jmartinm commented 8 years ago

@lnielsen @jirikuncar any opinions on this? We have this PR https://github.com/inspirehep/inspire-next/pull/1143 that could make use of it.

Or you think it is better to keep the utility just in our overlay?

kaplun commented 8 years ago

Note: just to give a bit of context to this proposed addition: this is useful e.g. with MARC, when your input is not perfect and say: it has multiple $a in one field, rather than multiple fields with a single $a each. With such decorator it would be much easier to build rules that are able to treat both cases and output consistent JSON.