I designed this battery box to be similar to some commercial ones which I have used for years which function very well. It will hold 4 AA batteries and will snap closed.
I have made these with PLA but think they would be even better if made using PETG as it would be a little bit more flexible and the catch should function better although it works fine with PLA.
Both halves are identical hence the one STI, you just need to print 2 of them.
Battery_box_-_Hinged_with_clasp.stl | 35.4KB |