---
title: "Attribute"
description: "This page lists the Python SDK names for Attributes."
canonical_url: "https://docs.superdurable.io/reference/python/attribute/"
source: "docs/reference/python/attribute.mdx"
locale: "en"
---

# Attribute

This page lists the Python SDK names for [Attributes](https://docs.superdurable.io/concepts/primitives/attribute.md).
The doc comment of each API gives its parameters, defaults, and errors. Read
them in the [Python SDK API reference](https://docs.superdurable.io/reference/python.md#api-reference).

<a id="api-names"></a>

## API names

| Task                                             | Python API                                                                                  | Dex behavior                                                                                                               |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| Define a singleton Attribute                     | **Attribute**                                                                               | [Attributes](https://docs.superdurable.io/reference/server/runtime-data.md#attributes)                                     |
| Define an AttributeMap                           | **AttributeMap**                                                                            | [Attributes](https://docs.superdurable.io/reference/server/runtime-data.md#attributes)                                     |
| Declare it in the Flow                           | **PersistenceSchema.of**, returned from **get_persistence_schema**                          | [Flow definition](https://docs.superdurable.io/reference/python/flow.md#flow-definition)                                   |
| Read, write, and delete a value in a Step or RPC | **get**, **set**, and **delete**                                                            | [Commits](https://docs.superdurable.io/reference/python/step.md#commit-boundary)                                           |
| Address one AttributeMap instance                | **AttributeMap.instance**, or the instance key argument of **get**, **set**, and **delete** | [Attributes](https://docs.superdurable.io/reference/server/runtime-data.md#attributes)                                     |
| Count AttributeMap instances and list their keys | **AttributeMap.get_map_size** and **AttributeMap.get_all_instance_keys**                    | [Selective state loading](https://docs.superdurable.io/reference/python/step-options.md#selective-state-loading)           |
| Load AttributeMap values for a method            | **AttributeMap.load**, with the load fields of **StepOptions** or **@rpc**                  | [Selective state loading](https://docs.superdurable.io/reference/python/step-options.md#selective-state-loading)           |
| Lock a value for a read-modify-write             | **lock**, with the lock fields of **StepOptions** or **lock_attributes** of **@rpc**        | [Locks](https://docs.superdurable.io/reference/server/runtime-data.md#attribute-locks)                                     |
| Index a value for search                         | **AttributeIndex** and **IndexType**                                                        | [Indexes](https://docs.superdurable.io/reference/server/runtime-data.md#attribute-indexes)                                 |
| Project writes to an Attribute Store             | **sync_to_attribute_store**                                                                 | [Attribute sync](https://docs.superdurable.io/reference/server/attribute-store-sync.md)                                    |
| Store a value that can be erased                 | **hard_delete_on_null**                                                                     | [Hard-delete Attributes](https://docs.superdurable.io/reference/server/runtime-data.md#hard-delete-attributes)             |
| Set a value when the Flow starts                 | **StartFlowOptions.with_attribute**                                                         | [Attributes at start](https://docs.superdurable.io/reference/python/start-flow-options.md#attributes)                      |
| Read values from outside the Flow                | **Client.get_attributes**                                                                   | [Read Attributes](https://docs.superdurable.io/reference/server/runtime-client.md#read-attributes)                         |
| Wait until a value matches                       | **Client.wait_for_attribute_match**                                                         | [Wait for an Attribute match](https://docs.superdurable.io/reference/server/runtime-client.md#wait-for-an-attribute-match) |

<a id="example"></a>

## Example

Example: [examples/python/dex_examples/primitives/attribute/attribute_flow.py](https://github.com/superdurable/dex/tree/main/examples/python/dex_examples/primitives/attribute/attribute_flow.py)
