Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

[0.x.x] - Unreleased
--------------------

Changed
^^^^^
- Introduce a Path object to handle paths. :issue:`111`

[0.5.2] - 2026-01-22
--------------------

Expand Down
24 changes: 23 additions & 1 deletion doc/tutorial.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
Tutorial
--------

Attribute access
================

SCIM resources support two ways to access and modify attributes.
The standard Python dot notation uses snake_case attribute names, while the bracket notation accepts SCIM paths as defined in :rfc:`RFC7644 §3.10 <7644#section-3.10>`.

.. doctest::

>>> from scim2_models import User

>>> user = User(user_name="bjensen")
>>> user.display_name = "Barbara Jensen"
>>> user["nickName"] = "Babs"
>>> user["name.familyName"] = "Jensen"

Attributes can be removed with ``del``.

.. doctest::

>>> del user["nickName"]
>>> user.nick_name is None
True

Model parsing
=============

Pydantic :func:`~scim2_models.BaseModel.model_validate` method can be used to parse and validate SCIM2 payloads.
Python models have generally the same name than in the SCIM specifications, they are simply snake cased.


.. code-block:: python
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ classifiers = [

requires-python = ">= 3.10"
dependencies = [
"pydantic[email]>=2.7.0"
"pydantic[email]>=2.12.0"
]

[project.urls]
Expand Down
10 changes: 10 additions & 0 deletions scim2_models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
from .messages.patch_op import PatchOp
from .messages.patch_op import PatchOperation
from .messages.search_request import SearchRequest
from .path import URN
from .path import InvalidPathError
from .path import Path
from .path import PathError
from .path import PathNotFoundError
from .reference import ExternalReference
from .reference import Reference
from .reference import URIReference
Expand Down Expand Up @@ -79,13 +84,17 @@
"GroupMember",
"GroupMembership",
"Im",
"InvalidPathError",
"ListResponse",
"Manager",
"Message",
"Meta",
"Mutability",
"MultiValuedComplexAttribute",
"Name",
"Path",
"PathError",
"PathNotFoundError",
"Patch",
"PatchOp",
"PatchOperation",
Expand All @@ -104,6 +113,7 @@
"Sort",
"Uniqueness",
"URIReference",
"URN",
"User",
"X509Certificate",
]
Loading
Loading