there are TONS out there for this, but all I saw needed hardware added or were weird or complicated. If you have flex filament you can 100% print this without any extra hardware needed to work. there is a 1/4-20 threaded pivot head for printing in regular PLA/ABS/PETG materials and sink a screw/threaded rod into it if you don't have flex. The threaded stub is just too small for hard plastics as they will just break at a layer somewhere.
simple bolt, main body and pivoting head.
Main body is 1/4-20 threaded for standard camera tripods.
slide pivot head into the main body, insert bolt through and tighten to clamp in place.
*if you download keep an eye out as I'll likely edit the pivot so all the crappy supports aren't needed that scar up the bottom *(as you can see in my image) **