scim2-filter-parser
A customizable parser/transpiler for SCIM2.0 filters.
What it is and what it does
SCIM 2.0 Filter Parser converts SCIM filter query strings—used in identity management systems to query user attributes—into executable SQL or Django ORM queries. The package breaks this translation into four stages: tokenization (lexical analysis), abstract syntax tree construction, transpilation to a target language, and query completion. It maps SCIM attribute paths (like 'emails.value' or 'name.familyName') to your database schema via a customizable attribute map, then generates parameterized SQL to prevent injection attacks.
The library is designed for programmatic use: you instantiate a SQLQuery object with your filter string, table name, attribute mapping, and optional JOIN clauses, then extract the parameterized SQL and parameter list for execution. It supports multiple database backends (with SQLite as an example of subclassing the placeholder character), and offers optional Django Q object generation for ORM-based workflows. Command-line tools are provided for debugging but are not the primary interface.
Use it for:
- Convert incoming SCIM filter queries from identity providers into safe, parameterized SQL for user directory lookups
- Map SCIM attribute paths to your custom database schema without writing filter-to-SQL translation logic
- Generate Django ORM Q objects from SCIM filters to query user data in Django applications
- Build multi-table queries by specifying JOINs alongside attribute mappings for complex user schemas
- Tokenize and inspect SCIM filter syntax for validation or debugging identity provider integrations
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parses SCIM 2.0 filter query strings into abstract syntax trees and transpiles them to SQL queries or Django Q objects with parameterized values.
Yes. The package solves a specific, real problem (SCIM filter translation) with low install friction, active maintenance, no security vulnerabilities, and permissive licensing. It is well-suited for identity management integrations and supports modern Python versions. Install it if you need to parse SCIM filters; skip it if your system does not consume SCIM queries.
Install
scim2-filter-parser on PyPI
pip
pip install scim2-filter-parseruv
uv add scim2-filter-parserpoetry
poetry add scim2-filter-parserInstalling scim2-filter-parser
Before you install
Low friction: pure Python wheel with a single runtime dependency (sly). Actively maintained with recent commits; last release 755 days ago but repository shows ongoing activity.
License in practice
MIT license permits commercial and private use with minimal restrictions; attribution required but no copyleft obligations.
Quickstart
pip install scim2-filter-parser
from scim2_filter_parser.queries import SQLQuery
attr_map = {('emails', 'value', None): 'emails.address'}
q = SQLQuery('emails.value eq "test@example.com"', 'users', attr_map)
print(q.sql, q.params)
Verify before relying
- Whether the package handles all SCIM 2.0 filter operators and complex nested expressions reliably in production
- Performance characteristics when parsing very large or deeply nested filter expressions
- Whether Django integration (optional install) is actively maintained alongside core parser
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — sly |
| Maintenance | actively maintained — 755 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,782,015/month — #2,892 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: scim2_filter_parser-0.7.0-py3-none-any.whl
Keywords: scim, scim2, 2.0, filter
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
scim2-serverProvides a lightweight SCIM2 server…
permissive · top 15,000 on PyPI
mo-sql-parsingParses SQL queries into JSON-serializable parse…
copyleft · top 15,000 on PyPI
odata-queryParses OData v4 filter strings and transpiles…
permissive · top 15,000 on PyPI
moz-sql-parserParses SQL queries into JSON-serializable parse…
copyleft · top 15,000 on PyPI
django-scim2Implements the SCIM 2.0 provider specification…
permissive · top 5,000 on PyPI
cql2Parses, validates, and converts Common Query…
permissive · top 15,000 on PyPI
syntaqliteParse, format, validate, and tokenize SQLite…
permissive · top 15,000 on PyPI
sqlalchemy-filtersAdds filtering, sorting, and pagination…
permissive · top 15,000 on PyPI
sqlglotSQLGlot parses, transpiles, optimizes, and…
permissive · top 1,000 on PyPI
promql-parserParses Prometheus query language (PromQL)…
unclear · top 15,000 on PyPI