import merge_in_memory as mim_module
str1 = 'line 1\nline 2'
str2 = """line 1
line 2 changed"""
merger = mim_module.Merger()
print(merger.diff_make(str1, str2))
How can I diff and patch/merge strings instead of files?