python: create a script for reorgnizing an LDB file.