skillfed

scim2-filter-parser

A customizable parser/transpiler for SCIM2.0 filters.

scim2-filter-parser v0.7.0 2.8M downloads/30d#2,892 on PyPI30
Permissive license MIT Active released

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-parser

uv

uv add scim2-filter-parser

poetry

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 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: InternetTopic :: Software Development :: Libraries :: Python Modules

Tags

scim 2.0 filter parserscim query to sqlscim filter transpilerparse scim filter expressionsscim attribute mappingscim to django queryscim filter lexer parser
scim-identityquery-transpilersql-generation

More Python Modules packages