swh.deposit.utils module

swh.deposit.utils.merge(*dicts)[source]

Given an iterator of dicts, merge them losing no information.

Parameters

*dicts – arguments are all supposed to be dict to merge into one

Returns

dict merged without losing information

swh.deposit.utils.normalize_date(date)[source]

Normalize date fields as expected by swh workers.

If date is a list, elect arbitrarily the first element of that list

If date is (then) a string, parse it through dateutil.parser.parse to extract a datetime.

Then normalize it through swh.model.identifiers.normalize_timestamp.

Returns

The swh date object