This is a two piece spool holder, designed to lock onto 1.5" x 0.75" wood rails and sized for standard 1 kg spools. It was modeled in Onshape.
Once attached to the rail and with a spool added, the holder CANNOT pop off the rail without either delaminating walls apart or by ripping the plastic across the layers. Where the parts interface with the wood is held together by 2 dovetails, which reduce the material required to prevent snapping by forming a complete loop of material around the rail.
The spool is held very close to the wooden rails (~5 mm), reducing torque on both the wood and plastic. The holder itself is very narrow, 25 mm wide, and so can easily fit not only into most spools, attach to the rails in either the space left by the used spool of filament, and even fit in front of a nearly full roll of filament without interference.
Assembly is simple: Slide the main hook (Main_Hook_Body.stl) over the top of the rail. Insert the locking plate (Locking_Base_Plate.stl) into the slot in the main hook from the bottom at a 90 degree angle (clockwise or counterclockwise; it shouldn't really matter). The T-shaped key should be in line with and flush with the top surface of the hook. Rotate the locking plate until the sides are flush with the sides of the main hook. Huzzah, you now have a complete locking spool holder.
You may wish to do the above before actually attaching the parts to a rail. Depending on the tolerance of your printer, the parts may seize, and it's easier to deal with when free. Clearance on the parts is 0.4 mm.