MS SQL Server
Simply follow the steps below
Install pyodbc in python3
or
python3 -m pip install pyodbc
Now install Microsoft ODBC Driver (need to have Homebrew installed on your system)
brew tap microsoftmsodbcsql https://github.com/Microsoft/homebrew-msodbcsql
Update homebrew
Final Step
Now take idea from following python3 code
Hope it helps.