scim2-models
Pydantic models for SCIM schemas defined in RFC7643 and RFC7644.
This library provides utilities to parse and produce SCIM2 payloads, and handle them with native Python objects. It aims to be used as a basis to build SCIM2 servers and clients.
What's SCIM anyway?
SCIM stands for System for Cross-domain Identity Management, and it is a provisioning protocol. Provisioning is the action of managing a set of resources across different services, usually users and groups. SCIM is often used between Identity Providers and applications in completion of standards like OAuth2 and OpenID Connect. It allows users and groups creations, modifications and deletions to be synchronized between applications.
Features
- SCIM Resources: Native Python classes for
User,Group,EnterpriseUser,ServiceProviderConfig,ResourceTypeandSchema - Pydantic Integration: Full Pydantic v2 support with validation, serialization and IDE autocompletion
- RFC Compliance: Implements RFC7643 (schema) and RFC7644 (protocol) specifications
- Attribute Metadata: Support for
Mutability,Returned,UniquenessandRequiredfield annotations - Context-Aware Validation: Automatic field inclusion/exclusion based on HTTP context (creation, query, replacement, etc.)
- Schema Extensions: Dynamic schema extensions and custom resource types, dynamic conversion between schemas and Python models.
- SCIM Messages:
ListResponse,SearchRequest,PatchOp, andErrormessages - Error Handling: SCIM-compliant exceptions with automatic conversion to
Errorresponses
Installation
pip install scim2-models
Usage
Check the tutorial and the reference for more details.
from scim2_models import User
import datetime
payload = {
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"id": "2819c223-7f76-453a-919d-413861904646",
"userName": "bjensen@example.com",
"meta": {
"resourceType": "User",
"created": "2010-01-23T04:56:22Z",
"lastModified": "2011-05-13T04:42:34Z",
"version": 'W\\/"3694e05e9dff590"',
"location": "https://example.com/v2/Users/2819c223-7f76-453a-919d-413861904646",
},
}
user = User.model_validate(payload)
assert user.user_name == "bjensen@example.com"
assert user.meta.created == datetime.datetime(
2010, 1, 23, 4, 56, 22, tzinfo=datetime.timezone.utc
)
scim2-models belongs in a collection of SCIM tools developed by Yaal Coop, with scim2-client, scim2-tester and scim2-cli
Release files for scim2-models 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scim2_models-0.7.0.tar.gz | 49.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scim2_models-0.7.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 112.1 kB
Release files / scim2_models-0.7.0.tar.gz
| Download URL | scim2_models-0.7.0.tar.gz |
|---|---|
| Size | 49.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac5e59944a87c0862464d160fc4426cf59a99740bdd14ddf459d621ee4fa7aac
|
|
BLAKE2b-256 checksum How to use checksums |
7e3db967a207f4182b6985f2128304cd69016c5ec5c29dc0bec2212848112331
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency logRelease files / scim2_models-0.7.0-py3-none-any.whl
| Download URL | scim2_models-0.7.0-py3-none-any.whl |
|---|---|
| Size | 62.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4212d8b74fc744700c23d4f5c87866b984449201873f2b6f7bb44c6c5b6f8088
|
|
BLAKE2b-256 checksum How to use checksums |
bece09f7b8e5fc32c62af5434d88f47106205a1deb81952c14438cbd3d287065
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 5, 2026.
Transparency log