Go to file
2023-10-13 14:29:52 -04:00
.github Add tests and classifiers for python 3.12 2023-10-13 14:28:42 -04:00
tests Update json field tests to account for error cases 2023-05-04 15:26:27 -04:00
.coveragerc Initial commit 2021-11-24 16:30:47 -05:00
.gitignore Initial commit 2021-11-24 16:30:47 -05:00
.pre-commit-config.yaml Initial commit 2021-11-24 16:30:47 -05:00
.pylintrc Remove deprecated option from pylintrc 2023-04-13 14:41:13 -04:00
CHANGELOG.md Update changelog for version 1.3.0 2023-05-04 15:26:48 -04:00
CODE_OF_CONDUCT.md Remove source code links from readme to support cross platform pubs 2023-05-04 15:05:27 -04:00
LICENSE.md Initial commit 2021-11-24 16:30:47 -05:00
Makefile Update CI and toxfile to use new group structure 2023-04-13 14:41:13 -04:00
peewee_plus.py Bump version to 1.3.1 2023-10-13 14:29:52 -04:00
poetry.lock Add tests and classifiers for python 3.12 2023-10-13 14:28:42 -04:00
pyproject.toml Bump version to 1.3.1 2023-10-13 14:29:52 -04:00
README.md Add docs for timedelta field 2023-05-04 15:05:27 -04:00
tox.ini Add tests and classifiers for python 3.12 2023-10-13 14:28:42 -04:00

peewee+

Various extensions, helpers, and utilities for Peewee

CI Status PyPI Version PyPI Downloads License Python Supported Versions Code style: black

See the Changelog for release history.

Documentation

The documentation for this project is currently a work in progress. Please see the source code for complete docs

Installing

peewee+ is available on PyPI and can be installed using Poetry, Pipenv, or Pip:

# Using poetry
poetry add peewee-plus

# Using pipenv
pipenv install peewee-plus

# Using pip
python -m venv peewee
source peewee/bin/activate
python -m pip install peewee-plus

Once installed, Peewee+ can be imported like below:

import peewee_plus

Features

Constants

SQLITE_DEFAULT_PRAGMAS - The default pragmas to use with an SQLite database connection, taken directly from the Peewee docs.

SQLITE_DEFAULT_VARIABLE_LIMIT - The maximum number of variables an SQL query can use when using SQLite

Functions

calc_batch_size - Helper function for writing backend-agnostic batch queries while accounting for the SQLite max variable limit.

flat_transaction - Decorator function for wrapping callables in a database transaction without creating nested transactions

Classes

PathField - A Peewee database field for storing Pathlib objects, optionally relative to a runtime value.

PrecisionFloatField - A Peewee database field for storing floats while specifying the MySQL precision parameters M and D

JSONField - A Peewee database field for storing arbitrary JSON-serializable data

EnumField - A Peewee database field for storing Enums by name

TimedeltaField A Peewee database field for natively storing datetime.timedelta objects

For Developers

All project contributors and participants are expected to adhere to the Contributor Covenant Code of Conduct, v2 (external link).

The devel branch has the latest (and potentially unstable) changes. The stable releases are tracked on Github, PyPi, and in the Changelog.

Developing this project requires Python 3.10 or later and Poetry 1.2 or later. GNU Make can optionally be used to quickly setup a local development environment, but this is not required.

To setup a local development environment:

# Clone the repository...
# ...over HTTPS
git clone https://github.com/enpaul/peewee-plus.git
# ...over SSH
git clone git@github.com:enpaul/peewee-plus.git

cd peewee-plus/

# Create and configure the local dev environment
make dev

# See additional make targets
make help