If you have the seatpost, seems like some inside measurements could be made to give outer limits
for the cylinder size and the battery diameter will give you the ID. Then the thread form obtained
from something soft and moldable or such as partly cured bondo with a release agent (eg PAM
spray or simple green) inside the seat post. You can interpolate the hex part to a standard
size and incorporate the slot seen in the image. I suspect regular user of 3D printers would be
able to plug this data into a design program and print it for you.