{"id":28300,"library":"sqlalchemy-easy-softdelete","title":"SQLAlchemy Easy SoftDelete","description":"Provides a mixin and utilities to add soft-deletion (deleted_at column) to SQLAlchemy ORM models. Version 0.9.0 supports SQLAlchemy 2.x and requires Python >=3.10. Actively maintained.","status":"active","version":"0.9.0","language":"python","source_language":"en","source_url":"https://github.com/williamjacks/sqlalchemy-easy-softdelete","tags":["sqlalchemy","soft-delete","orm","mixin"],"install":[{"cmd":"pip install sqlalchemy-easy-softdelete","lang":"bash","label":"latest"}],"dependencies":[{"reason":"Required; the library integrates with SQLAlchemy ORM.","package":"sqlalchemy","optional":false}],"imports":[{"wrong":"from sqlalchemy_easy_softdelete.mixin import SoftDeleteMixin","symbol":"SoftDeleteMixin","correct":"from sqlalchemy_easy_softdelete import SoftDeleteMixin"}],"quickstart":{"code":"from sqlalchemy import create_engine, Column, Integer, String\nfrom sqlalchemy.orm import DeclarativeBase\nfrom sqlalchemy_easy_softdelete.mixin import SoftDeleteMixin\n\nengine = create_engine('sqlite:///:memory:')\n\nclass Base(DeclarativeBase):\n    pass\n\nclass User(SoftDeleteMixin, Base):\n    __tablename__ = 'users'\n    id = Column(Integer, primary_key=True)\n    name = Column(String)\n\nBase.metadata.create_all(engine)\n\nfrom sqlalchemy.orm import Session\nwith Session(engine) as session:\n    user = User(name='Alice')\n    session.add(user)\n    session.commit()\n    session.delete(user)  # This will soft-delete\n    session.commit()","lang":"python","description":"Defines a model with soft-delete support. The delete() method on the session performs a soft delete by setting deleted_at timestamp."},"warnings":[{"fix":"Use session.execute() with a DELETE statement for hard deletes.","message":"The library overrides session.delete() to set deleted_at instead of hard deleting. This can be surprising if you expect actual deletion; hard deletion must be done with session.execute(delete(...)).","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Update import to from sqlalchemy_easy_softdelete.mixin import SoftDeleteMixin.","message":"Versions before 0.7.0 used a different mixin location (from sqlalchemy_easy_softdelete import SoftDeleteMixin). That import path no longer works.","severity":"deprecated","affected_versions":"<0.7.0"},{"fix":"Use query = session.query(User).with_deleted() to include soft-deleted rows.","message":"The library automatically filters out soft-deleted records when querying. To include them, you must use with_deleted() method on the query.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.9.0':22 '2':25 '3.10':30 'activ':31 'add':10 'column':16 'delet':13,14,36 'easi':2 'maintain':32 'mixin':6,38 'model':20 'orm':19,37 'provid':4 'python':29 'requir':28 'soft':12,35 'soft-delet':11,34 'softdelet':3 'sqlalchemi':1,18,24,33 'support':23 'util':8 'version':21 'x':26","created_at":"2026-05-09T05:54:46.659620+00:00","updated_at":"2026-05-09T05:54:46.659620+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'SoftDeleteMixin' from 'sqlalchemy_easy_softdelete' (/tmp/tmp39ut5why/venv/lib/python3.12/site-packages/sqlalchemy_easy_softdelete/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/flipbit03/sqlalchemy-easy-softdelete","docs":null,"changelog":null,"pypi":"https://pypi.org/project/sqlalchemy-easy-softdelete/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}