Might as well mention a couple of lego projects I've been working on, a parts browser TUI and a 3D model (eg .stl or .obj) to lego model (ldraw) converter:
https://github.com/hbmartin/pyldraw3/
https://github.com/hbmartin/legolization/
I'm actively trying to get good instructions out of the legolization project now