pyeudiw.duckle_ql package

Submodules

pyeudiw.duckle_ql.attribute_mapper module

pyeudiw.duckle_ql.attribute_mapper.extract_claims(data: Dict[str, Any], paths: List[Dict[str, List[str]]]) Dict[str, Any][source]

Extracts values from a dictionary (nested or flat) based on the provided paths.

Parameters:
  • data – The input dictionary (can be nested or flat).

  • paths – A list of dictionaries, each containing a “path” key with a list of key sequences to extract claims from.

  • raise_missing – If True, raises an exception when one or more claims are missing (default is True).

Returns:

A dictionary with the extracted values, preserving the nested structure if applicable.

Raises:

ValueError – If any claim is missing and raise_missing is set to True.

pyeudiw.duckle_ql.attribute_mapper.flatten_namespace(data: Dict[str, Any]) Dict[str, Any][source]

Flattens a nested dictionary by removing the top-level namespaces.

Parameters:

data – A nested dictionary where each top-level key corresponds to a namespace.

Returns:

A flattened dictionary containing all keys/values merged from all namespaces.

pyeudiw.duckle_ql.credential module

class pyeudiw.duckle_ql.credential.Claim(*, path: List[str])[source]

Bases: BaseModel

Represents a single claim with a JSON path.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

path: List[str]
class pyeudiw.duckle_ql.credential.Credential(*, id: str, format: str, meta: Meta, claims: List[Claim])[source]

Bases: BaseModel

Defines a single credential request.

claims: List[Claim]
format: str
id: str
meta: Meta
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyeudiw.duckle_ql.credential.CredentialsRequest(*, credentials: List[Credential])[source]

Bases: BaseModel

Root model containing a list of credential requests.

credentials: List[Credential]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class pyeudiw.duckle_ql.credential.Meta(*, vct_values: List[str])[source]

Bases: BaseModel

Metadata for a credential, including vct values.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

vct_values: List[str]

pyeudiw.duckle_ql.handler module

pyeudiw.duckle_ql.utils module

Module contents