SQLAlchemy in Python

SQLAlchemy is usually referred to as an Object Relational Mapper (ORM), although it is much more full featured than any of the other Python ORMs that I’ve used, such as SqlObject or the one that’s built into Django. SQLAlchemy was created by a fellow named Michael Bayer. Since I’m a music nut, we’ll be creating a simple database to store album information. A database isn’t a database without some relationships, so we’ll create two tables and connect them. Here are a few other things we’ll be learning:

  • Adding data to each table
  • Modifying data
  • Deleting data
  • Basic queries

But first we need to actually make the database, so that’s where we’ll begin our journey. You will need to install SQLAlchemy to follow along in this tutorial. We’ll use pip to get this job done:

Get hands-on with 1200+ tech skills courses.