--- id: scim2-filter-parser version: "0.7.0" license: MIT license_treatment: permissive maintenance: active --- # scim2-filter-parser — A customizable parser/transpiler for SCIM2.0 filters. License: permissive · Maintenance: active · Downloads: 2.8M/mo ## 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 above — 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 pip install scim2-filter-parser uv add scim2-filter-parser poetry add scim2-filter-parser ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 2.8M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags scim 2.0 filter parser, scim query to sql, scim filter transpiler, parse scim filter expressions, scim attribute mapping, scim to django query, scim filter lexer parser, scim-identity, query-transpiler, sql-generation [View on SkillFed](https://skillfed.io/packages/scim2-filter-parser) · [View on PyPI](https://pypi.org/project/scim2-filter-parser/)