SssSlicer is a project mainly written in Python, it's free.
With the sssSlicer you can split functions (atm only python) into codesnippets and store them in a database which contains dependencys like imports etc.