Various extensions, helpers, and utilities for Peewee
Project description
peewee+
Various extensions, helpers, and utilities for Peewee
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.
- To report a bug, request a feature, or ask for assistance, please open an issue on the Github repository.
- To report a security concern or code of conduct violation, please contact the project author directly at me [at] enp dot one.
- To submit an update, please fork the repository and open a pull request.
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file peewee_plus-1.3.0.tar.gz
.
File metadata
- Download URL: peewee_plus-1.3.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/5.19.0-41-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44e32c67a2981199c3272af59a1f7a2c99c50cdb9d00cae4f37e615457e6e500 |
|
MD5 | 3158b8cf2075f85a50a536351e23a9ea |
|
BLAKE2b-256 | 272b202d42233a8d83ac3d30bbe2e5d3fe13ca848f9ccff81d6cedc8f1ee5739 |
File details
Details for the file peewee_plus-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: peewee_plus-1.3.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.6 Linux/5.19.0-41-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b05e18e3bb14529902be06d7a0ba3bffa3f7885efba8b1730ba06c7dbdf095c |
|
MD5 | b12637e34ac63d080ef9b2eccc1e0c02 |
|
BLAKE2b-256 | 4d2d7eeb0848e3663a0082f12fa8b2c698160301e3ca39f11b758bd527dc6c70 |