    

 ## On this page

  

 

 # utility:data sources get attribute

 Last update: 31.07.2026 

**Version: 0.0.0**

## Description

A DataSources in pin 0 and a property name (string) in pin 1 are expected in input. An index refering to the property can also be provided.

## Inputs

This table lists the input pins for this operator. Input pins define the data that the operator requires to perform its operation. Some inputs are required, while others are optional and provide additional configuration. Each parameter is detailed in the sections that follow the table.

Pin numberNameStatusExpected type(s)0[data\_sources](#input_0)Required[`data_sources`](../../core-concepts/dpf-types.md#data-sources)**1**[property\_name](#input_1)Required[`string`](../../core-concepts/dpf-types.md#standard-types)**2**[property\_index](#input_2)[`int32`](../../core-concepts/dpf-types.md#standard-types)**3**[property\_key](#input_3)[`string`](../../core-concepts/dpf-types.md#standard-types)**4**[property\_result\_key](#input_4)[`string`](../../core-concepts/dpf-types.md#standard-types)<a id="input_0"></a>

### data\_sources (Pin 0)

- **Required:** Yes
- **Expected type(s):** [`data_sources`](../../core-concepts/dpf-types.md#data-sources)

<a id="input_1"></a>

### property\_name (Pin 1)

- **Required:** Yes
- **Expected type(s):** [`string`](../../core-concepts/dpf-types.md#standard-types)

Accepted inputs are: 'file\_path' (returns string), 'result\_file\_name' (returns string), 'domain\_file\_path' (returns string), 'domain\_result\_file\_name' (returns string), 'num\_keys' (returns int), num\_result\_key (returns int), num\_file\_path (returns int), 'num\_result\_file\_path' (returns int), 'key\_by\_index' (returns string), 'result\_key\_by\_index' (returns string), 'path\_by\_index' (returns string), 'path\_key\_by\_index' (returns string).

<a id="input_2"></a>

### property\_index (Pin 2)

- **Required:** No
- **Expected type(s):** [`int32`](../../core-concepts/dpf-types.md#standard-types)

Index for the property. Must be set for 'domain\_file\_path', 'domain\_result\_file\_name' 'key\_by\_index', 'result\_key\_by\_index', 'path\_by\_index' and 'path\_key\_by\_index' properties.

<a id="input_3"></a>

### property\_key (Pin 3)

- **Required:** No
- **Expected type(s):** [`string`](../../core-concepts/dpf-types.md#standard-types)

Key to look for. Must be set for 'file\_path' and 'domain\_file\_path' properties.

<a id="input_4"></a>

### property\_result\_key (Pin 4)

- **Required:** No
- **Expected type(s):** [`string`](../../core-concepts/dpf-types.md#standard-types)

Result key to look for. Can be used for 'file\_path', 'result\_file\_name', 'domain\_file\_path' and 'domain\_result\_file\_name'.

## Outputs

This table lists the output pins for this operator. Output pins provide the results of the operator's computation and can be connected to inputs of other operators or retrieved for further processing. Each output is detailed in the sections that follow the table.

Pin numberNameExpected type(s)0[property](#output_0)[`string`](../../core-concepts/dpf-types.md#standard-types), [`int32`](../../core-concepts/dpf-types.md#standard-types)<a id="output_0"></a>

### property (Pin 0)

- **Expected type(s):** [`string`](../../core-concepts/dpf-types.md#standard-types), [`int32`](../../core-concepts/dpf-types.md#standard-types)

Property value.

## Configurations

This operator supports [configuration options](../../core-concepts/operator-configurations.md) that modify its behavior.

### [mutex](../../core-concepts/operator-configurations.md#mutex)

- **Expected type(s):** [`bool`](../../core-concepts/dpf-types.md#standard-types)
- **Default value:** false

If this option is set to true, the shared memory is prevented from being simultaneously accessed by multiple threads.

## Scripting

This operator can be accessed through scripting interfaces using these identifiers.

**Category**: utility

**Plugin**: core

**Scripting name**: ds\_get\_attribute

**Full name**: utility.ds\_get\_attribute

**Internal name**: datasources::get\_attribute

**License**: None

## Examples

These examples demonstrate how to use this operator in different programming environments. Each example shows how to instantiate the operator, connect the required inputs, and retrieve the output.

C++```cpp
#include "dpf_api.h"

ansys::dpf::Operator op("datasources::get_attribute"); // operator instantiation
op.connect(0, my_data_sources);
op.connect(1, my_property_name);
op.connect(2, my_property_index);
op.connect(3, my_property_key);
op.connect(4, my_property_result_key);
std::string my_property = op.getOutput<std::string>(0);

```

CPython```python
import ansys.dpf.core as dpf

op = dpf.operators.utility.ds_get_attribute() # operator instantiation
op.inputs.data_sources.connect(my_data_sources)
op.inputs.property_name.connect(my_property_name)
op.inputs.property_index.connect(my_property_index)
op.inputs.property_key.connect(my_property_key)
op.inputs.property_result_key.connect(my_property_result_key)
my_property_as_string = op.outputs.property_as_string()

```

IPython```python
import mech_dpf
import Ans.DataProcessing as dpf

op = dpf.operators.utility.ds_get_attribute() # operator instantiation
op.inputs.data_sources.Connect(my_data_sources)
op.inputs.property_name.Connect(my_property_name)
op.inputs.property_index.Connect(my_property_index)
op.inputs.property_key.Connect(my_property_key)
op.inputs.property_result_key.Connect(my_property_result_key)
my_property = op.outputs.property.GetData()

```

  
## Changelog

- Version 0.0.0: Initial release.