Utilities

Some useful utilities

catafolk.utils.checksum_iterable(iterable)

Return an md5 checksum of an iterable

>>> checksum_iterable(['hello', 'world'])
'fc5e038d38a57032085441e7fe7010b0'
Parameters:iterable (iterable) – An iterable of strings or byte-likes
Returns:An md5 checksum of the iterable
Return type:str
catafolk.utils.file_checksum(path: str)

Return an md5 checksum of a given file

>>> path = 'tests/datasets/bronson-child-ballads/data/child01.krn'
>>> file_checksum(path)
'350fc2b9839d7d7669d83f77efdc03c2'
Parameters:path (str) – The filepath
Returns:A md5 checksum of the file
Return type:str