skillfed

sqlalchemy-searchable

Provides fulltext search capabilities for declarative SQLAlchemy models.

sqlalchemy-searchable v3.0.0 103.8K downloads/30d#12,785 on PyPI276
Permissive license BSD-3-Clause Active released

What it is and what it does

SQLAlchemy-Searchable integrates PostgreSQL's fulltext search engine directly into SQLAlchemy's declarative ORM layer, letting you mark model fields as searchable and query them using database-native text search operators. It bridges the gap between SQLAlchemy's abstraction and PostgreSQL's powerful search capabilities, avoiding the need for separate search infrastructure for many use cases.

The package works by decorating your model classes and fields, then providing search methods that compile down to PostgreSQL fulltext queries. It requires PostgreSQL and depends on sqlalchemy and sqlalchemy-utils. Search is performed at the database level, making it efficient for large datasets, though it is limited to PostgreSQL and cannot be used with other database backends.

Use it for:

  • Add search to a blog or content management system where posts need to be found by title or body text.
  • Implement user-facing search in a web application backed by SQLAlchemy without adding external search infrastructure.
  • Build product search in an e-commerce catalog where items are stored in a PostgreSQL database.
  • Create a searchable documentation or knowledge base indexed by PostgreSQL fulltext.
  • Add autocomplete or type-ahead search to forms querying a SQLAlchemy model.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Adds fulltext search capabilities to SQLAlchemy models using PostgreSQL's native search features.

Yes, if you are using SQLAlchemy with PostgreSQL and need fulltext search without external infrastructure. The package is actively maintained, has no known vulnerabilities, and low install friction. Not suitable if you use a different database backend or need advanced search features beyond PostgreSQL's native capabilities.

Install

sqlalchemy-searchable on PyPI

pip

pip install sqlalchemy-searchable

uv

uv add sqlalchemy-searchable

poetry

poetry add sqlalchemy-searchable

Installing sqlalchemy-searchable

Before you install

Low friction install with just two runtime dependencies (sqlalchemy and sqlalchemy-utils). The package is actively maintained with a recent release and no known vulnerabilities.

License in practice

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

Quickstart

pip install sqlalchemy-searchable

from sqlalchemy_searchable import make_searchable
from sqlalchemy import create_engine
from sqlalchemy.orm import declarative_base

Base = declarative_base()
make_searchable(Base.metadata)

Requires PostgreSQL database backend; does not work with other database systems.

Verify before relying

  • Whether search indexing is automatic on model changes or requires manual triggers.
  • Performance characteristics with large result sets or complex search queries.
  • Exact PostgreSQL version requirements beyond general compatibility.
  • How to configure which model fields are indexed for search.

Package facts

License BSD-3-Clause (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 2 — sqlalchemy-utils, sqlalchemy
Maintenance actively maintained — 179 days since the last release
Last repo commit
First released
Downloads 103,774/month — #12,785 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sqlalchemy_searchable-3.0.0-py3-none-any.whl

Environment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Libraries :: Python Modules

Tags

sqlalchemy fulltext searchpostgresql full text search ormsqlalchemy text searchdatabase model searchsqlalchemy postgres searchorm fulltext indexingdeclarative model search
postgresqlfulltext-searchorm

More Python Modules packages