sqlalchemy-searchable
Provides fulltext search capabilities for declarative SQLAlchemy models.
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-searchableuv
uv add sqlalchemy-searchablepoetry
poetry add sqlalchemy-searchableInstalling 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
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
SQLAlchemy-UtilsProvides utility functions, custom data types,…
permissive · top 1,000 on PyPI
SQLAlchemySQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
modelsearchIndexes Django models into Elasticsearch,…
permissive · top 15,000 on PyPI
sqlalchemy-jdbcapiSQLAlchemy dialect for JDBC and ODBC database…
permissive · top 15,000 on PyPI
sqlalchemy-filtersAdds filtering, sorting, and pagination…
permissive · top 15,000 on PyPI
Flask-SQLAlchemyFlask-SQLAlchemy integrates SQLAlchemy database…
permissive · top 1,000 on PyPI
sqlalchemy-pgspiderProvides a SQLAlchemy dialect that enables…
permissive · top 15,000 on PyPI
django-citextProvides PostgreSQL CIText field types for…
permissive · top 15,000 on PyPI
pgvectorAdds vector storage and similarity search…
permissive · top 1,000 on PyPI
pgvecto-rsProvides Python bindings for PGVecto.rs, a…
permissive · top 15,000 on PyPI