I made something crude with python and flask, but it's only to print address labels, always the same settings (paper size and so on)
So i just put a textbox, press the button and it prints there.
When printing generic stuff, you would need to set paper type, paper size, color or BW, if have both sides printed, if printing from a specific tray, then some kind of user authentication (i am lazy and i didn't care about privacy so i used cloudflare access), so the complexity becomes much bigger.
Before making my crude script I searched long time for a free or cheap solution, but I didn't find. If you find, let me know