Using Databases in Python
Treehouse
Course Summary
When you want to store data from a program, you have two general choices: files or databases. In this course, we're going to explore using a database from within Python by using the excellent ORM Peewee. We'll build a command line diary application that stores our thoughts and notes in a SQLite database, lets us review and delete them, and even has a search feature!
-
+
Course Description
About this Course When you want to store data from a program, you have two general choices: files or databases. In this course, we're going to explore using a database from within Python by using the excellent ORM Peewee. We'll build a command line diary application that stores our thoughts and notes in a SQLite database, lets us review and delete them, and even has a search feature! What you'll learn
- ORMs
- Peewee
- OrderedDict
About the Teacher
Besides teaching Python at Treehouse, Kenneth Love is a husband & father. He created a few popular Python libraries, worked at most levels of the web stack, & was the Creative Director of a newspaper. He likes board games, whiskey, activism, & dry humor.
-
+
Course Syllabus
Meet Peewee
One way of interacting with a database from Python is to use the Peewee ORM. An ORM, or Object Relational Mapping, turns database tables into Python objects and vice versa. Let's see how to create tables and manipulate data in them. 7 steps- Meet Peewee, Our ORM 1:46
- ORM 5 questions
- Modeling 6:45
- Create Table 4 objectives
- Creating Databases and Tables 2 questions
- Queries Are Your Friend 9:28
- First Queries 4 objectives
Our Diary App
Now that we understand Peewee, let's build the app that we're here to build. We want an application we can run from the command line that we can read, write, and delete entries through. 6 stepsGettin' CRUD-y With It
It's time to build the real core of our application. Let's capture entries and save them, show them, search them, and delete them! 8 steps