Skip to main content

Bixomix

bixomix is a collection of SQLAlchemy mixins.

Support

  • Python 3.9+
  • SQLAlchemy 2.0+

Install

pip install bixomix

Usage

Add mixins after the Base class in each model’s parent classes. The order of the mixins doesn’t matter.

from sqlalchemy.orm import DeclarativeBase

from bixomix import CreatedAtMixin, EnabledMixin


class Base(DeclarativeBase):
    pass


class MyModel(Base, CreatedAtMixin, EnabledMixin):
    # Add your own fields here
    ...

Mixins

  • CreatedAtMixin: add a created_at datetime field that’s automatically filled with the record’s creation date
  • UpdatedAtMixin: add an updated_at datetime field that’s automatically filled with the record’s last update date. Note that on Postgres this is done in Python; for a database-level update you have to create a trigger.
  • CreatedUpdatedAtMixin: combined version of the previous two mixins
  • EnabledMixin: add an enabled boolean field (default is true)
  • EnabledNoMixin: same as EnabledMixin, but the default value is false
  • UpdateFromDictMixin: add an update_from_dict method to update a model in-place given a dictionary of attributes

Metadata

Release files for bixomix 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bixomix 0.1.3
File Size Uploaded
bixomix-0.1.3.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bixomix 0.1.3
File Interpreter ABI Platform
bixomix-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / bixomix-0.1.3.tar.gz

Download URL bixomix-0.1.3.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
682fcd46e00ebd617890a0866405288e817fc502076fc009583de889e12cb22b
BLAKE2b-256 checksum
How to use checksums
acd9a6a8f69b747a913225306e21d1bed2df1822416ab7fb2b446ad5dd4e7040
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.10.16 Linux/6.11.0-1018-azure

Release files / bixomix-0.1.3-py3-none-any.whl

Download URL bixomix-0.1.3-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e019e80c4a9c57eaffed28ae847d870fce5ee0df944fcaabd96a29eafe5b3532
BLAKE2b-256 checksum
How to use checksums
0dfe73dac52cfc9b8df50c512db64bd7da2a3cd68645c329216b9c3c6fcd175a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.10.16 Linux/6.11.0-1018-azure

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page