---
title: "PyTreeAccessor"
sidebar_label: "PyTreeAccessor"
description: "The clika_runtime.pytree PyTreeAccessor class."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

The steps from the root of a tree to one leaf; callable on the tree.

    >>> from clika_runtime import pytree
    >>> tree = {"layer": [10, 20]}
    >>> acc = pytree.tree_accessors(tree)[1]
    >>> acc.codify()
    "*['layer'][1]"
    >>> acc(tree)
    20
    >>> acc.path
    ('layer', 1)
    

## `entries` (property)

The typed steps, root to leaf.

## `path` (property)

The raw entries: indices, keys, positions.

## `codify`

```python
codify(self, root: 'str' = '*') -> 'str'
```

The code that reaches the leaf from the expression ``root``.
