Tools to extract views of dictionaries.
parselglossy.views.
view_by
(what: str, d: Dict[str, Any], *, predicate: Callable[[Any, str], bool] = <function <lambda>>, missing: Optional[Type[Exception]] = None, transformer: Callable[Any, Any] = <function <lambda>>) → Dict[str, Any][source]¶Recursive decimation of a template into an input.
Parameters: |
|
---|---|
Returns: | outgoing – A dictionary with the desired view. |
Return type: | JSONDict |
Raises: | exc:ValueError if what is not among the allowed views. |
parselglossy.views.
view_by_default
(d: Dict[str, Any]) → Dict[str, Any][source]¶Partial application of view_by()
for defaults.
Parameters: | d (JSONDict) – |
---|---|
Returns: | outgoing – A dictionary with a view by defaults. |
Return type: | JSONDict |
parselglossy.views.
view_by_docstring
(d: Dict[str, Any]) → Dict[str, Any][source]¶Partial application of view_by()
for docstrings.
Parameters: | d (JSONDict) – |
---|---|
Returns: | outgoing – A dictionary with a view by docstrings. |
Return type: | JSONDict |