Skip to content

Object Relation Mapping using SQL Alchemy

SQL Alchemy is a Python package providing tools that facilitate structured database interaction via Python objects - i.e., for Object-Relational Mapping (ORM). Alembic is a Python package for managing database migrations based on the data models implied by the SQL Alchemy models - i.e., Python classes.

Demo Objectives

  • How to define a data model using SQL Alchemy
  • How to interact with a database via SQL Alchemy's ORM.
  • How to use Alembic to manage database schema migrations.

Dependencies

This demo is contained primarily within a single Jupyter notebook - demos/sqlalchemy/sql-alchemy-basics.ipynb, that calls upon data models defined in demos/sqlalchemy/models.py. Make sure you have the necessary Python package requirements installed into a Jupyter kernel for it to run successfully.