When you're trying to put the whole thing into an enclosure like this:
You want the most compact parts you can find. The case is 3D printed and the input shaft is a Bic pen body that's had 1/4-20 threads cut into it. There's Allegro hall effect sensor attached to a small PCB that's hot-glued into the opposite end. There's two 3mm diameter magnets bracketing the sensor as it passes into the center of the Bic pen body.