$npx skillfedfor your agent

sqlalchemy-easy-softdelete

Easily add soft-deletion to your SQLAlchemy Models.

Worth itPyPI DatabaseReleased Jun 2026174.4K downloads / moBSD-3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — sqlalchemy_easy_softdelete-0.9.1-py3-none-any.whl
v0.9.1 · released 2026-06-16 · Python >=3.10 · 1 runtime deps: sqlalchemy

Yes. The package is actively maintained, has no known vulnerabilities, carries a permissive license, and solves a common ORM problem with minimal friction. The single dependency on sqlalchemy and low install overhead make it a safe addition. Use it if your application needs soft-deletion semantics; skip it if you never need to preserve deleted records or audit trails.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or later; SQLAlchemy must be installed separately.
  • Low install friction; single dependency on sqlalchemy.
  • Actively maintained with recent releases and a stable codebase marked as Production/Stable.

License · maintenance · safety

BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows commercial and private use with minimal restrictions.

last release 2026-06-16 (59 days) · last repo commit 2026-06-17 · 73 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 174,407 downloads/mo, #10,282 on PyPI

Verify before relying

pip install sqlalchemy-easy-softdelete

from sqlalchemy_easy_softdelete.mixin import generate_soft_delete_mixin_class
from sqlalchemy.orm import declarative_base
from sqlalchemy import Column, Integer

class SoftDeleteMixin(generate_soft_delete_mixin_class()):
    pass

Base = declarative_base()

class Fruit(Base, SoftDeleteMixin):
    __tablename__ = "fruit"
    id = Column(Integer, primary_key=True)

# Soft-delete: session.query(Fruit).all() excludes deleted rows
fruit.delete()
# Include deleted: session.query(Fruit).execution_options(include_deleted=True).all()
  • Whether the automatic query rewriting works correctly with all SQLAlchemy relationship types and lazy-loading strategies.
  • Performance impact of the hook on large-scale queries or complex relationship chains.
  • Compatibility with SQLAlchemy's async session and asyncio workflows.
Same gist for agents: .md · .json

What it is and what it does

sqlalchemy-easy-softdelete is a mixin generator that adds soft-deletion semantics to SQLAlchemy models without requiring schema changes or explicit WHERE clauses in every query. Instead of deleting records, you mark them with a timestamp (by default `deleted_at`), and the library installs a query hook that automatically filters out soft-deleted rows from all SELECT statements—both in direct queries and through model relationships. You generate a customized mixin class, apply it to your models, and gain `.delete()` and `.undelete()` methods plus automatic query rewriting.

The mixin is fully configurable: you can choose the field name, its type, whether to include delete/undelete methods, and which tables the hook should ignore. This approach preserves audit trails and referential integrity while keeping deleted data invisible by default—queries return only active records unless you explicitly pass `include_deleted=True` to override the filter.

Use it for

  • Implement audit trails in business applications where deleted records must remain in the database for compliance or recovery.
  • Build multi-tenant systems where soft-deleted data must be excluded from user-facing queries but retained for administrative review.
  • Add undo/restore functionality to applications without requiring complex transaction rollback or backup restoration.
  • Maintain referential integrity in systems where cascading hard deletes would break historical reporting or linked records.
  • Simplify query logic by removing the need to manually add `WHERE deleted_at IS NULL` conditions throughout the codebase.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

The package is actively maintained, has no known vulnerabilities, carries a permissive license, and solves a common ORM problem with minimal friction. The single dependency on sqlalchemy and low install overhead make it a safe addition. Use it if your application needs soft-deletion semantics; skip it if you never need to preserve deleted records or audit trails.

Install

sqlalchemy-easy-softdelete on PyPI

Before you install

Low install friction; single dependency on sqlalchemy. Actively maintained with recent releases and a stable codebase marked as Production/Stable.

Requires Python 3.10 or later; SQLAlchemy must be installed separately.

License in practice

BSD-3-Clause permissive license allows commercial and private use with minimal restrictions.

Quickstart

pip install sqlalchemy-easy-softdelete

from sqlalchemy_easy_softdelete.mixin import generate_soft_delete_mixin_class
from sqlalchemy.orm import declarative_base
from sqlalchemy import Column, Integer

class SoftDeleteMixin(generate_soft_delete_mixin_class()):
    pass

Base = declarative_base()

class Fruit(Base, SoftDeleteMixin):
    __tablename__ = "fruit"
    id = Column(Integer, primary_key=True)

# Soft-delete: session.query(Fruit).all() excludes deleted rows
fruit.delete()
# Include deleted: session.query(Fruit).execution_options(include_deleted=True).all()

Verify before relying

  • Whether the automatic query rewriting works correctly with all SQLAlchemy relationship types and lazy-loading strategies.
  • Performance impact of the hook on large-scale queries or complex relationship chains.
  • Compatibility with SQLAlchemy's async session and asyncio workflows.

Package facts

LicenseBSD-3-Clause permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
sqlalchemy
MaintenanceActively maintained 59 days since the last release
Last repo commit
First released
Downloads174,407 / month, #10,282 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Evidence: sqlalchemy_easy_softdelete-0.9.1-py3-none-any.whl

Tags

Capabilities
sqlalchemy soft deletesoft deletion mixinlogical delete sqlalchemyexclude deleted records automaticallysoft-delete hooksqlalchemy deleted_at fieldautomatic query filtering deleted
Topics
soft-deleteaudit-trailorm-pattern

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “sqlalchemy soft delete”

Give your agent the search over MCP, or paste the wish link into any chat.

More Database packages

psycopg2-binary Worth it
PyPI · Software Development · released Apr 2026

psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.

copyleftcompiled wheel · 3.9+
271.6Mdownloads / mo
redis Worth it
PyPI · Database · released Jul 2026

Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.

Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.

MITpure Python · 3.10+
268.3Mdownloads / mo
ydb Worth it
PyPI · Database · released Jul 2026

YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.

Install it if you need to connect Python applications to YDB databases.

permissive licensepure Python · 3.10+
210.0Mdownloads / mo
snowflake-connector-python Worth it
PyPI · Software Development · released Aug 2026

Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.

Apache-2.0compiled wheel · 3.10+
193.6Mdownloads / mo
sqlparse Worth it
PyPI · Software Development · released Aug 2026

sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.

Install it if you need to manipulate, format, or analyze SQL text programmatically.

BSD-3-Clausepure Python · 3.10+
148.9Mdownloads / mo
dbt-adapters With conditions
PyPI · Database · released Jul 2026

Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.

Apache-2.0pure Python · 3.10.0+
121.3Mdownloads / mo

See also django-soft-delete · django-safedelete · sqlalchemy-filters · sqlalchemy-mixins · SQLAlchemy-Continuum · sqlalchemy-repr · sqlalchemy-serializer · mock-alchemy · sqlalchemy-json · alchemy-mock