sqlalchemy-filters
A library to filter SQLAlchemy queries.
Decision gist · record as of 2026-08-14
Yes, if you are building a REST API on SQLAlchemy and need to translate client-supplied filter/sort/pagination parameters into queries. The low install friction, permissive license, and absence of known vulnerabilities make it safe to adopt. However, accept that maintenance is dormant: no updates since April 2023, and compatibility with newer SQLAlchemy versions is unverified. If you require active support or cutting-edge features, evaluate alternatives first.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires sqlalchemy and Python 3.7 or later; automatic joins depend on sqlalchemy being able to infer foreign-key relationships.
- Low install friction with only two runtime dependencies (sqlalchemy and six).
- Package is dormant—last release was in April 2023, though the repository remains active with a recent commit in January 2025.
License · maintenance · safety
Apache License, Version 2.0 (permissive) — Licensed under Apache License, Version 2.0 (permissive), imposing no restrictions on use or redistribution in proprietary or open-source projects.
last release 2023-04-13 (1219 days) · last repo commit 2025-01-24 · 356 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 162,440 downloads/mo, #10,603 on PyPI
Alternatives
Verify before relying
pip install sqlalchemy-filters
from sqlalchemy_filters import apply_filters
filter_spec = [{'field': 'name', 'op': '==', 'value': 'example'}]
filtered_query = apply_filters(query, filter_spec)
result = filtered_query.all()- Whether the package works with SQLAlchemy 2.0+ (latest major version compatibility not stated in fact sheet)
- Current test coverage and whether dormant status indicates stability or abandonment risk
What it is and what it does
sqlalchemy-filters is a query-building library that lets you apply filtering, sorting, and pagination to SQLAlchemy query objects using declarative JSON-like specifications rather than imperative ORM calls. It's designed primarily for REST APIs where clients need to express query constraints as structured data (e.g., from URL parameters or request bodies). The library handles single-model queries, multi-model joins with automatic relationship inference, and hybrid properties, and it can defer field loading to reduce database overhead.
The package depends only on sqlalchemy and six, making it lightweight. It supports Python 3.7, 3.8, 3.9, and 3.10 and has been stable since its first release in 2017, though active maintenance ended in April 2023. The repository remains accessible with a recent commit in January 2025, suggesting the code is not abandoned but receives minimal updates. It carries no known security vulnerabilities.
Use it for
- Build REST API endpoints that accept filter, sort, and pagination parameters without writing custom query logic for each endpoint.
- Expose database queries to clients safely by translating structured filter specifications into SQLAlchemy operations.
- Restrict database field loads to reduce query overhead when clients request only specific columns via a load specification.
- Filter and sort across related models using automatic joins, allowing clients to query by foreign-key relationships without server-side join configuration.
- Apply hybrid properties and methods as filter and sort targets, enabling computed fields in query constraints.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building a REST API on SQLAlchemy and need to translate client-supplied filter/sort/pagination parameters into queries.
The low install friction, permissive license, and absence of known vulnerabilities make it safe to adopt. However, accept that maintenance is dormant: no updates since April 2023, and compatibility with newer SQLAlchemy versions is unverified. If you require active support or cutting-edge features, evaluate alternatives first.
Install
sqlalchemy-filters on PyPI
Before you install
Low install friction with only two runtime dependencies (sqlalchemy and six). Package is dormant—last release was in April 2023, though the repository remains active with a recent commit in January 2025. Use only if you accept infrequent maintenance.
Requires sqlalchemy and Python 3.7 or later; automatic joins depend on sqlalchemy being able to infer foreign-key relationships.
License in practice
Licensed under Apache License, Version 2.0 (permissive), imposing no restrictions on use or redistribution in proprietary or open-source projects.
Quickstart
pip install sqlalchemy-filters
from sqlalchemy_filters import apply_filters
filter_spec = [{'field': 'name', 'op': '==', 'value': 'example'}]
filtered_query = apply_filters(query, filter_spec)
result = filtered_query.all()
Verify before relying
- Whether the package works with SQLAlchemy 2.0+ (latest major version compatibility not stated in fact sheet)
- Current test coverage and whether dormant status indicates stability or abandonment risk
Package facts
| License | Apache License, Version 2.0 permissive |
| Python support | Supports the current Python release >=3.7 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagessqlalchemysix |
| Maintenance | Dormant 1,219 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 162,440 / month, #10,603 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: DatabaseTopic :: Database :: Front-EndsTopic :: Software Development :: Libraries :: Python Modules |
Evidence: sqlalchemy_filters-0.13.0-py3-none-any.whl
Tags
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 query filtering”
- sqlalchemy-filtersAdds filtering, sorting, and pagination capabilities to SQLAlchemy…
- odata-queryParses OData v4 filter strings and transpiles them to Django…
- sqlalchemy-easy-softdeleteAdds soft-deletion support to SQLAlchemy models with automatic query…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also fastapi-filter · sqlalchemy-easy-softdelete · sqlalchemy-mixins · odata-query · jsonquerylang · SQLAlchemy · sqlalchemy-searchable · mock-alchemy · fastapi-pagination · sqlalchemy-repr