Python for Network Engineers

How to Talk to Mysql Databases

By George El. • August 2019 • Reading time: 7 minutes

In this post I will describe how to use python to execute raw queries on mysql databases. install the database First we need to install mysql or maria-db (a fork of mysql) either in unix or windows. if you have windows 10 you can install mysql on wsl (windows subsystem for linux).

How to Use SQLalchemy to Talk to SQL Databases

By George El. • April 2019 • Reading time: 4 minutes

In this post I will describe briefly sqlalchemy. SqlAlchemy is a package that allows the user to talk to sql databases. Except for performing raw sql queries, it provides an Object Relational Mapper, ORM. An ORM maps classes to tables in the database, and objects to table rows. So instead of running sql queries on the tables, you perform actions on the objects, and the ORM takes care of translating these actions to sql queries.