> For the complete documentation index, see [llms.txt](https://docs.macilib.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.macilib.org/docs/json/functions/maci.jsondumpstr.md).

# 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)
