---
name: get_leaf_nodes
kind: function
lang: py
domain: core
version: "1.0.0"
purity: pure
signature: "def get_leaf_nodes(structure: Any) -> list[dict]"
description: "Extrae solo nodos hoja (sin hijos) de un arbol jerarquico. Deep copy de cada nodo."
tags: [tree, leaf, hierarchy, functional, pendiente-usar]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: ""
imports: [copy]
params:
  - name: structure
    desc: "arbol jerarquico (dict con campo 'nodes' anidado recursivamente)"
output: "lista de dicts representando solo los nodos hoja (sin hijos)"
tested: false
tests: []
test_file_path: ""
file_path: "python/functions/core/core.py"
source_repo: "https://github.com/VectifyAI/PageIndex"
source_license: "MIT"
source_file: "pageindex/utils.py"
---

## Ejemplo

```python
tree = [{"title": "A", "nodes": [{"title": "A1", "nodes": []}, {"title": "A2", "nodes": []}]}]
get_leaf_nodes(tree)
# [{"title": "A1"}, {"title": "A2"}]
```

## Notas

Funcion pura. Usa deep copy. Un nodo es hoja si su campo 'nodes' es falsy (vacio o ausente).
