Provided by: peewee_3.17.0+dfsg-1build1_all 

NAME
peewee - peewee Documentation [image] Peewee is a simple and small ORM. It has few (but expressive) concepts, making it easy to learn and intuitive to use. • a small, expressive ORM • python 2.7+ and 3.4+ • supports sqlite, mysql, postgresql and cockroachdb • tons of extensions postgresqlmysqlsqlitecockroachdb Peewee's source code hosted on GitHub. New to peewee? These may help: • Quickstart • Example twitter app • Using peewee interactively • Models and fields • Querying • Relationships and joins
CONTENTS:
Installing and Testing Most users will want to simply install the latest version, hosted on PyPI: pip install peewee Peewee comes with a couple C extensions that will be built if Cython is available. • Sqlite extensions, which includes Cython implementations of the SQLite date manipulation functions, the REGEXP operator, and full-text search result ranking algorithms. Installing with git The project is hosted at https://github.com/coleifer/peewee and can be installed using git: git clone https://github.com/coleifer/peewee.git cd peewee python setup.py install NOTE: On some systems you may need to use sudo python setup.py install to install peewee system-wide. If you would like to build the SQLite extension in a git checkout, you can run: # Build the C extension and place shared libraries alongside other modules. python setup.py build_ext -i Running tests You can test your installation by running the test suite. python runtests.py You can test specific features or specific database drivers using the runtests.py script. To view the available test runner options, use: python runtests.py --help NOTE: To run tests against Postgres or MySQL you need to create a database named "peewee_test". To test the Postgres extension module, you will also want to install the HStore extension in the postgres test database: -- install the hstore extension on the peewee_test postgres db. CREATE EXTENSION hstore; Optional dependencies NOTE: To use Peewee, you typically won't need anything outside the standard library, since most Python distributions are compiled with SQLite support. You can test by running import sqlite3 in the Python console. If you wish to use another database, there are many DB-API 2.0-compatible drivers out there, such as pymysql or psycopg2 for MySQL and Postgres respectively. • Cython: used to expose additional functionality when using SQLite and to implement things like search result ranking in a performant manner. Since the generated C files are included with the package distribution, Cython is no longer required to use the C extensions. • apsw: an optional 3rd-party SQLite binding offering greater performance and comprehensive support for SQLite's C APIs. Use with APSWDatabase. • gevent is an optional dependency for SqliteQueueDatabase (though it works with threading just fine). • BerkeleyDB can be compiled with a SQLite frontend, which works with Peewee. Compiling can be tricky so here are instructions. • Lastly, if you use the Flask framework, there are helper extension modules available. Note on the SQLite extensions Peewee includes two SQLite-specific C extensions which provide additional functionality and improved performance for SQLite database users. Peewee will attempt to determine ahead-of-time if SQLite3 is installed, and only build the SQLite extensions if the SQLite shared-library is available on your system. If, however, you receive errors like the following when attempting to install Peewee, you can explicitly disable the compilation of the SQLite C extensions by settings the NO_SQLITE environment variable. fatal error: sqlite3.h: No such file or directory Here is how to install Peewee with the SQLite extensions explicitly disabled: $ NO_SQLITE=1 python setup.py install Quickstart This document presents a brief, high-level overview of Peewee's primary features. This guide will cover: • Model Definition • Storing data • Retrieving Data NOTE: If you'd like something a bit more meaty, there is a thorough tutorial on creating a "twitter"-style web app using peewee and the Flask framework. In the projects examples/ folder you can find more self-contained Peewee examples, like a blog app. I strongly recommend opening an interactive shell session and running the code. That way you can get a feel for typing in queries. Model Definition Model classes, fields and model instances all map to database concepts: ──────────────────────────────────────────── Object Corresponds to... ──────────────────────────────────────────── Model class Database table ──────────────────────────────────────────── Field instance Column on a table ──────────────────────────────────────────── Model instance Row in a database table ┌────────────────┬─────────────────────────┐ │ │ │ --
NOTE
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. • Index • Module Index • Search Page
AUTHOR
charles leifer
COPYRIGHT
charles leifer 3.17.0 Apr 10, 2024 PEEWEE(1)