# map\_attr

Maps an attribute name to another attribute name. Nothing is returned.

Attribute names that are mapped to another attribute name will allow it to follow that name's value. The name that requests the map, will become the child, and the name that the child maps to becomes the parent. Attribute names for the child and parent must already exist to map them.

This feature works similarly to the concept of a pointer. It also maintains reference to the same object in memory naturally from python's inherent optimization design.&#x20;

See more information on the mapping concept in the [Map Assignment Glyph](https://docs.macilib.org/docs/maci/language/v1.0.0#map-assignment-glyph) language section.<br>

*Basic Example of mapping a name using default positional parameters*

```python
data.map_attr('attr_name_child', 'attr_name_parent')
```

In this example, we simply map an attribute name that already exists in the [MaciDataObj](/docs/maci/object.md) using the map\_attr method and pass a string of the child attribute name as the first argument to the method, then pass the parent attribute name as the second argument to the method.

### partner methods

Methods that provide related utility to this method

[unmap\_attr](/docs/maci/object/methods/unmap_attr.md)  ->  Unmap an attribute name\
[get\_all\_maps](/docs/maci/object/methods/get_all_maps.md)  ->  Get all parent and child maps\
[get\_parent\_maps](/docs/maci/object/methods/get_parent_maps.md)  ->  Get all parent maps\
[get\_child\_maps](/docs/maci/object/methods/get_child_maps.md)  ->  Get all child maps\
[get\_parent\_map\_chains](/docs/maci/object/methods/get_parent_map_chains.md)  ->  Get parent maps represented as a chain\
[is\_parent\_map](/docs/maci/object/methods/is_parent_map.md)  ->  Check if attribute name is a parent mapped with children\
[is\_child\_map](/docs/maci/object/methods/is_child_map.md)  ->  Check if attribute name is a child mapped to a parent

### parameters & arguments

Describes all parameter functionality and accepted data types

<details>

<summary>child_attr:  str</summary>

First required positional argument. Accepts strings

Use this parameter to set the child attribute name that will follow the parent attribute name.

</details>

<details>

<summary>parent_attr:  str</summary>

Second required positional argument. Accepts strings

Use this parameter to set the parent attribute name for the child attribute name to follow.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.macilib.org/docs/maci/object/methods/map_attr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
