The Python DB-API 2.0 is a standard way to access databases in your programs. Because of this common way to access data, only minor implementation specific changes would need to be made to your Python code if you were to change the underlying database. The details o the specifications can be found in document PEP249.

This introductory database access chapter will use the SQLite3 database,. It is built in to most Python implementations and does not require additional setup. SQLite 3 is a self contained, server-less database that is perfect for low to medium volume websites, data analysis, and application data storage.

There is a section at the end of this chapter where a few examples using MySQL are shown. The MySQL database is appropriate for significant multi-user and high volume applications. It required the setup and management of a database server, that is beyond the context of this introduction.

Download PDF of Chapter