Python automate Assign parent relation and keep transform
You have to set the inverse matrix  of the child to clear the initial transformation of the parent at parenting moment :

obj1.parent= obj2
obj1.matrix_parent_inverse = obj2.matrix_world.inverted()