Try ERPNext Buy Support Partners Foundation

Pyodbc in erpnext

Can we import other packages like pyodbc or mysql.connector in erpnext and use database connection code like other normal python files?

Found the solution

To manipulate ERPNext documents, use the wrapper functions or frappe.db.sql("SELECT * FROM *") for complicated queries.

If you need to talk to a different database (not ERPNext), you can still use the tools you mentioned.