# maci.pickleloadbytes

### loading a byte string

Load object data from pickled byte string.

**Security awareness**, only unpickle data you trust and review considerations for unpickling data. See more information at [pickle section](https://docs.macilib.org/docs/pickle)&#x20;

{% hint style="info" %}
maci.pickleloadbytes  ->  Any
{% endhint %}

*Basic Example of loading a pickle object from byte string using default positional parameter*

```python
data = maci.pickleloadbytes(b'pickledbytedata')
```

In this example, we simply load pickled data using the pickleloadbytes function and pass a byte string as an argument to the function to load the pickled data, and assign the returned data to a variable.

#### combining pickle with maci to store data to file

To store pickled data to a file, it is more encouraged to store it as a byte string value rather than a whole executable pickle file. The byte string itself is not executable yet as it is stored as a value that can be safely tested (using your own means) before loading it. This approach enables the ability to still store your pickle data to a file as an alternative, and control what byte data is coming in instead of just loading/executing a whole pickle file.

See [pickledumpbytes](https://docs.macilib.org/docs/pickle/functions/maci.pickledumpbytes) for example on dumping pickled to a file paired with maci

### partner functions

Functions that are related for pickleloadbytes

[maci.pickledumpbytes](https://docs.macilib.org/docs/pickle/functions/maci.pickledumpbytes)  ->  Dump data to pickled bytes

### parameters & arguments

Describes all parameter functionality and accepted data types

<details>

<summary>pickled_byte_data:  bytes</summary>

First and only required positional argument. Accepts bytes

Use this parameter to pass in and load your pickled bytes data

</details>

This uses the native pickle library shipped with the python standard library for its underlying functionality. For more information on the pickle library and official security concerns with pickling, visit: <https://docs.python.org/3/library/pickle.html>
