This battery holder is safer then usual commercial battery holder because it is polarized, you cannot insert battery with wrong polarity (yes, if you use violence, you can).
It is parametric, so you can easily customize it, if you have a spring of different diameter you can change its value into the OpenScad code.
If you like, you can use this project to add a battery pocket into the case of your electronic project.
After printing you have to add a spring and two pieces of plait wire.
If you like, you can add some glue (I haven't) to fix more tenaciously spring and wires.