peewee¶
- a small, expressive orm
- written in python (2.6+ or 3.2+)



Peewee’s source code hosted on GitHub.
New to peewee? Here is a list of documents you might find most helpful when getting started:
- Quickstart guide – this guide covers all the bare essentials. It will take you between 5 and 10 minutes to go through it.
- Guide to the various query operators describes how to construct queries and combine expressions.
- Field types table lists the various field types peewee supports and the parameters they accept.
Contents:¶
- Installing and Testing
- Quickstart
- Example app
- Managing your Database
- Creating a database connection and tables
- Using Postgresql
- Using SQLite
- Using BerkeleyDB
- Using MySQL
- Multi-threaded applications
- Deferring initialization
- Dynamically defining a database
- Connection Pooling
- Read Slaves
- Generating Models from Existing Databases
- Logging queries
- Generating skeleton code
- Adding a new Database Driver
- Schema migrations
- Models and Fields
- Querying
- Creating a new record
- Bulk inserts
- Updating existing records
- Atomic updates
- Deleting records
- Selecting a single record
- Get or create
- Selecting multiple records
- Filtering records
- Sorting records
- Getting random records
- Paginating records
- Counting records
- Aggregating records
- Retrieving Scalar Values
- SQL Functions, Subqueries and “Raw expressions”
- Window functions
- Retrieving raw tuples / dictionaries
- Query operators
- Foreign Keys
- Performance Techniques
- Transactions
- API Reference
- Playhouse, a collection of addons
Note¶
Hi, I’m Charlie the author of peewee. I hope that you enjoy using this library as much as I’ve enjoyed writing it. Peewee wouldn’t be anywhere near as useful without people like you, so thank you. If you find any bugs, odd behavior, or have an idea for a new feature please don’t hesitate to open an issue on GitHub or contact me.