SCIM2 models serialization and validation with pydantic
Project description
scim2-models
Pydantic models for SCIM2 schemas defined in RFC7643 and RFC7644.
This library provides utilities to parse and produce SCIM2 payloads, and handle them with native Python objects. It can be use as a basis to build SCIM2 servers and clients.
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
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
scim2_models-0.1.0.tar.gz
(21.8 kB
view details)
Built Distribution
File details
Details for the file scim2_models-0.1.0.tar.gz
.
File metadata
- Download URL: scim2_models-0.1.0.tar.gz
- Upload date:
- Size: 21.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.9.2-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c40bb871120e5d8bf4f02f8c2247803fb372e7476702e17c8d89a5e39cb09142 |
|
MD5 | 56a6a0cc0f6356f0af01e3fcca9e4178 |
|
BLAKE2b-256 | 810e657ec347cb700739f28c6ee824ea4845ea1c8ea83abf747d253d0130e0e8 |
File details
Details for the file scim2_models-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: scim2_models-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.9.2-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ad7eabd92d2159ff8fec18fb0172b2ce6c1bac5a70d012c1081cb663f9f1d9c |
|
MD5 | 983c2fbcc37fbad1276ae58a24d63427 |
|
BLAKE2b-256 | f2f1f99bf64dafaea4e0c1452321ae4584086f7d79bc17eeeefc77f4161ede8b |