Component decoupling pattern for python