Optional dependencies

Note

To use Peewee, you typically won’t need anything outside the standardlibrary, since most Python distributions are compiled with SQLite support.You can test by running import sqlite3 in the Python console. If youwish to use another database, there are many DB-API 2.0-compatible driversout there, such as pymysql or psycopg2 for MySQL and Postgresrespectively.

  • Cython: used to expose additional functionality whenusing SQLite and to implement things like search result ranking in aperformant manner. Since the generated C files are included with the packagedistribution, Cython is no longer required to use the C extensions.
  • apsw: an optional 3rd-party SQLitebinding offering greater performance and comprehensive support for SQLite’s CAPIs. Use with APSWDatabase.
  • gevent is an optional dependency forSqliteQueueDatabase (though it works with threading justfine).
  • BerkeleyDB canbe compiled with a SQLite frontend, which works with Peewee. Compiling can betricky so here are instructions.
  • Lastly, if you use the Flask framework, there are helper extension modulesavailable.