# maci.jsondumpstr

### dumping a string

Dumps the corresponding python data types to a string formatted as JSON.&#x20;

{% hint style="info" %}
maci.jsondumpstr  ->  str
{% endhint %}

*Basic Example of dumping data to a string using default positional parameters*

```python
json_string = maci.jsondumpstr(data)
```

In this example, we simply dump data to a string formatted as json using the jsondumpstr function and pass the data as an argument to the function, and assign the returned data to a variable.&#x20;

### parameters & arguments

Describes all parameter functionality and accepted data types

<details>

<summary>data:  dict | list | tuple | str | int | float | bool | None</summary>

First and only required positional argument. Accepts dictionaries, lists, tuples, strings, integers, floats, booleans, and None

Use this parameter to pass in the data you want to dump to a string.

</details>

<details>

<summary>indent_level:  int</summary>

Optional parameter. Accepts integers. Default = 4

Use this parameter to change the indentation level for structured data (lists, dicts, tuples, sets) written to the string. Indentation will be applied to nested data as well.

This parameter sets the true underlying indent level for the json library. 1 level = 1 space

</details>

*This function uses the native json library shipped with the python standard library for its underlying functionality. For more information on the json library, visit:* [*https://docs.python.org/3/library/json.html*](https://docs.python.org/3/library/json.html)


---

# 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/json/functions/maci.jsondumpstr.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.
