© Paul Gerrard 2016
Paul GerrardLean Python10.1007/978-1-4842-2385-7_11

11. Databases

Paul Gerrard
(1)
Maidenhead, Berkshire, UK
 
Every1 application makes use of some form of (persistent) storage. We have looked at plain text files already. In this chapter we consider how a database, in particular a relational database, can be accessed and used by Python programs.
Python provides standard functions to access all of the popular databases. There are many open source and commercial database products and each one has its own adapter that allows Python to connect to and use data held in it. For our purposes, we use the SQLite database because it requires no other installed software.

SQLite

SQLite is a very lightweight serverless tool. The core Python product ...

Get Lean Python: Learn Just Enough Python to Build Useful Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.