I'm not sure I've seen one. LibreDWG was an open source library, but they seem to have been beset with issues and I don't think the project actually went anywhere (anyone know?). Most everyone writing programs that need to use DWG seems to use Teigha which has various membership levels depending on what you want to do with the code.
Since you like python, you might want to give this one a try... http://yorik.uncreated.net/scripts/dxfconvert.py
It is a Linux DWG to DXF converter and requires you to have wine installed and the veryDWG utility.