Installing and Testing¶
Install the latest release from PyPI:
pip install peewee
Peewee has an optional Sqlite C extension which is not bundled in the default wheel. It provides user-defined ranking functions for use with Sqlite FTS4 and functions for fuzzy string matching. To build from source:
pip install peewee --no-binary :all:
Installing from Source¶
git clone https://github.com/coleifer/peewee.git
cd peewee
pip install .
Running Tests¶
python runtests.py
python runtests.py --help # Show options.
To run tests against Postgres or MySQL create a database named peewee_test.
For the Postgres extension tests, enable hstore:
CREATE EXTENSION hstore;
Supported Drivers¶
Peewee works with any database for which a DB-API 2.0 driver exists. The following drivers are supported out of the box:
Database |
Driver |
Implementation |
|---|---|---|
Sqlite |
|
|
Postgres |
|
|
Postgres |
|
|
MySQL |
|
|
Sqlite (async) |
|
|
Postgres (async) |
|
|
MySQL (async) |
|
|
Sqlite (alternate) |
|
|
Sqlite (alternate) |
|
|
SqlCipher |
|
|
MySQL (alternate) |
|
|
MariaDB (alternate) |
|
|
CockroachDB |
|
|
Postgres (extensions) |
|
The three bolded rows cover the majority of deployments. All others are optional; install their drivers when needed.