> ## Documentation Index
> Fetch the complete documentation index at: https://help.cryptolens.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Python 3: Data

> Read and update data objects attached to licenses or activations.

Python 3 package `licensing 0.54`. [Reviewed source revision](https://github.com/Cryptolens/cryptolens-python/tree/8f38b5a37580f2aba1c9374f581cdc85e251950f).

```python theme={null}
from licensing.methods import Data
```

<a id="licensing.methods.Data.increment_int_value_to_key" />

## increment\_int\_value\_to\_key

Increase a license data object's integer value, optionally enforcing an upper bound.

```python theme={null}
Data.increment_int_value_to_key(
    token,
    product_id,
    key,
    object_id=0,
    name='',
    int_value=0,
    enable_bound=False,
    bound=0
)
```

### Parameters

| Parameter | Default | Meaning |
| - | - | - |
| `token` | Required | Your access token. It needs the permission required by the linked Web API method. |
| `product_id` | Required | The numeric product ID. |
| `key` | Required | The license-key string, rather than the numeric license ID. |
| `object_id` | `0` | The numeric data-object ID. Use the linked API's rules when selecting by ID or name. |
| `name` | `''` | The data-object name. |
| `int_value` | `0` | The integer value to store, add or subtract. |
| `enable_bound` | `False` | Whether the API should enforce the supplied bound. |
| `bound` | `0` | The upper bound for an increment or the lower bound for a decrement. |

### Result

Returns `(response_dict, '')`. Read the result fields described in the linked API reference from that dictionary.

Returns `(None, message)` for API rejection or a handled request failure. Malformed response data can raise an exception.

### Checks

The API checks the access token's permissions. This method does not verify a signed license response.

[Web API reference](/api-reference/generated/IncrementIntValue).

<a id="licensing.methods.Data.decrement_int_value_to_key" />

## decrement\_int\_value\_to\_key

Decrease a license data object's integer value, optionally enforcing a lower bound.

```python theme={null}
Data.decrement_int_value_to_key(
    token,
    product_id,
    key,
    object_id=0,
    name='',
    int_value=0,
    enable_bound=False,
    bound=0
)
```

### Parameters

| Parameter | Default | Meaning |
| - | - | - |
| `token` | Required | Your access token. It needs the permission required by the linked Web API method. |
| `product_id` | Required | The numeric product ID. |
| `key` | Required | The license-key string, rather than the numeric license ID. |
| `object_id` | `0` | The numeric data-object ID. Use the linked API's rules when selecting by ID or name. |
| `name` | `''` | The data-object name. |
| `int_value` | `0` | The integer value to store, add or subtract. |
| `enable_bound` | `False` | Whether the API should enforce the supplied bound. |
| `bound` | `0` | The upper bound for an increment or the lower bound for a decrement. |

### Result

Returns `(response_dict, '')`. Read the result fields described in the linked API reference from that dictionary.

Returns `(None, message)` for API rejection or a handled request failure. Malformed response data can raise an exception.

### Checks

The API checks the access token's permissions. This method does not verify a signed license response.

[Web API reference](/api-reference/generated/DecrementIntValue).

<a id="licensing.methods.Data.add_data_object_to_key" />

## add\_data\_object\_to\_key

Add a data object to a license.

```python theme={null}
Data.add_data_object_to_key(
    token,
    product_id,
    key,
    name='',
    string_value='',
    int_value=0,
    check_for_duplicates=False
)
```

### Parameters

| Parameter | Default | Meaning |
| - | - | - |
| `token` | Required | Your access token. It needs the permission required by the linked Web API method. |
| `product_id` | Required | The numeric product ID. |
| `key` | Required | The license-key string, rather than the numeric license ID. |
| `name` | `''` | The data-object name. |
| `string_value` | `''` | The string to store on the data object. |
| `int_value` | `0` | The integer value to store, add or subtract. |
| `check_for_duplicates` | `False` | Ask the API to check for an existing object with the same name. |

### Result

Returns `(response_dict, '')`. Read the result fields described in the linked API reference from that dictionary.

Returns `(None, message)` for API rejection or a handled request failure. Malformed response data can raise an exception.

### Checks

The API checks the access token's permissions. This method does not verify a signed license response.

[Web API reference](/api-reference/generated/AddDataObject).

<a id="licensing.methods.Data.remove_data_object_to_key" />

## remove\_data\_object\_to\_key

Remove a data object from a license.

```python theme={null}
Data.remove_data_object_to_key(token, product_id, key, object_id=0, name='')
```

### Parameters

| Parameter | Default | Meaning |
| - | - | - |
| `token` | Required | Your access token. It needs the permission required by the linked Web API method. |
| `product_id` | Required | The numeric product ID. |
| `key` | Required | The license-key string, rather than the numeric license ID. |
| `object_id` | `0` | The numeric data-object ID. Use the linked API's rules when selecting by ID or name. |
| `name` | `''` | The data-object name. |

### Result

Returns `(response_dict, '')`. Read the result fields described in the linked API reference from that dictionary.

Returns `(None, message)` for API rejection or a handled request failure. Malformed response data can raise an exception.

### Checks

The API checks the access token's permissions. This method does not verify a signed license response.

[Web API reference](/api-reference/generated/RemoveDataObject).

<a id="licensing.methods.Data.add_data_object_to_machine" />

## add\_data\_object\_to\_machine

Add a data object to a registered activation.

```python theme={null}
Data.add_data_object_to_machine(
    token,
    product_id,
    key,
    machine_code,
    name='',
    string_value='',
    int_value=0,
    check_for_duplicates=False
)
```

### Parameters

| Parameter | Default | Meaning |
| - | - | - |
| `token` | Required | Your access token. It needs the permission required by the linked Web API method. |
| `product_id` | Required | The numeric product ID. |
| `key` | Required | The license-key string, rather than the numeric license ID. |
| `machine_code` | Required | The device or process identifier used for this activation. Reuse the same value when renewing or releasing it. |
| `name` | `''` | The data-object name. |
| `string_value` | `''` | The string to store on the data object. |
| `int_value` | `0` | The integer value to store, add or subtract. |
| `check_for_duplicates` | `False` | Ask the API to check for an existing object with the same name. |

### Result

Returns `(response_dict, '')`. Read the result fields described in the linked API reference from that dictionary.

Returns `(None, message)` for API rejection or a handled request failure. Malformed response data can raise an exception.

### Checks

The API checks the access token's permissions. This method does not verify a signed license response.

[Web API reference](/api-reference/generated/AddDataObject).

<a id="licensing.methods.Data.remove_data_object_to_machine" />

## remove\_data\_object\_to\_machine

Remove a data object from an activation.

```python theme={null}
Data.remove_data_object_to_machine(token, product_id, key, machine_code, object_id=0, name='')
```

### Parameters

| Parameter | Default | Meaning |
| - | - | - |
| `token` | Required | Your access token. It needs the permission required by the linked Web API method. |
| `product_id` | Required | The numeric product ID. |
| `key` | Required | The license-key string, rather than the numeric license ID. |
| `machine_code` | Required | The device or process identifier used for this activation. Reuse the same value when renewing or releasing it. |
| `object_id` | `0` | The numeric data-object ID. Use the linked API's rules when selecting by ID or name. |
| `name` | `''` | The data-object name. |

### Result

Returns `(response_dict, '')`. Read the result fields described in the linked API reference from that dictionary.

Returns `(None, message)` for API rejection or a handled request failure. Malformed response data can raise an exception.

### Checks

The API checks the access token's permissions. This method does not verify a signed license response.

[Web API reference](/api-reference/generated/RemoveDataObject).

<a id="licensing.methods.Data.list_machine_data_objects" />

## list\_machine\_data\_objects

List an activation's data objects.

```python theme={null}
Data.list_machine_data_objects(token, product_id, key, machine_code, name_contains='')
```

### Parameters

| Parameter | Default | Meaning |
| - | - | - |
| `token` | Required | Your access token. It needs the permission required by the linked Web API method. |
| `product_id` | Required | The numeric product ID. |
| `key` | Required | The license-key string, rather than the numeric license ID. |
| `machine_code` | Required | The device or process identifier used for this activation. Reuse the same value when renewing or releasing it. |
| `name_contains` | `''` | Return data objects whose names contain this text. |

### Result

Returns `(response_dict, '')`. Read the result fields described in the linked API reference from that dictionary.

Returns `(None, message)` for API rejection or a handled request failure. Malformed response data can raise an exception.

### Checks

The API checks the access token's permissions. This method does not verify a signed license response.

[Web API reference](/api-reference/generated/ListDataObjects).

<a id="licensing.methods.Data.list_key_data_objects" />

## list\_key\_data\_objects

List a license's data objects.

```python theme={null}
Data.list_key_data_objects(token, product_id, key, name_contains='')
```

### Parameters

| Parameter | Default | Meaning |
| - | - | - |
| `token` | Required | Your access token. It needs the permission required by the linked Web API method. |
| `product_id` | Required | The numeric product ID. |
| `key` | Required | The license-key string, rather than the numeric license ID. |
| `name_contains` | `''` | Return data objects whose names contain this text. |

### Result

Returns `(response_dict, '')`. Read the result fields described in the linked API reference from that dictionary.

Returns `(None, message)` for API rejection or a handled request failure. Malformed response data can raise an exception.

### Checks

The API checks the access token's permissions. This method does not verify a signed license response.

[Web API reference](/api-reference/generated/ListDataObjects).

[Python SDK Reference](/libraries/python-api)
