maci docs
  • maci
  • WATCH
    • Quick Start
    • Full Training Series
  • DOCS
    • maci
      • language
        • v1.0.0
      • functions
        • maci.build
        • maci.load
        • maci.loadstr
        • maci.loadattrs
        • maci.loadraw
        • maci.loaddict
        • maci.loadstrdict
        • maci.dump
        • maci.dumpstr
        • maci.dumpraw
      • object
        • methods
          • lock_attr
          • unlock_attr
          • hard_lock_attr
          • map_attr
          • unmap_attr
          • load_attrs
          • get_attrs
          • get_locked_list
          • get_hard_locked_list
          • get_all_maps
          • get_parent_maps
          • get_child_maps
          • get_parent_map_chains
          • is_parent_map
          • is_child_map
      • errors
      • hints
    • json
      • functions
        • maci.jsonload
        • maci.jsonloadstr
        • maci.jsondump
        • maci.jsondumpstr
    • yaml
      • functions
        • maci.yamlload
        • maci.yamlloadstr
        • maci.yamlloadall
        • maci.yamldump
        • maci.yamldumpstr
        • maci.yamldumpall
    • toml
      • functions
        • maci.tomlload
        • maci.tomlloadstr
        • maci.tomldump
        • maci.tomldumpstr
    • ini
      • functions
        • maci.iniload
        • maci.inidump
        • maci.inibuildauto
        • maci.inibuildmanual
    • xml
      • functions
        • maci.xmlload
        • maci.xmlloadstr
        • maci.xmlloaddict
        • maci.xmlloadstrdict
        • maci.xmldump
        • maci.xmldumpstr
        • maci.xmldumpdict
        • maci.xmldumpstrdict
        • maci.xmlbuildmanual
        • maci._defuse_xml_stdlib
    • pickle
      • functions
        • maci.pickleloadbytes
        • maci.pickledumpbytes
    • tools
      • hash functions
        • maci.createhash
        • maci.createfilehash
        • maci.comparefilehash
      • format functions
        • maci.cleanformat
  • Updates
    • Changelog
      • v1.1.0
      • v1.0.0
Powered by GitBook
On this page
  • loading a byte string
  • partner functions
  • parameters & arguments
  1. DOCS
  2. pickle
  3. functions

maci.pickleloadbytes

load pickled bytes

Last updated 1 year ago

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

maci.pickleloadbytes -> Any

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

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 for example on dumping pickled to a file paired with maci

partner functions

Functions that are related for pickleloadbytes

-> Dump data to pickled bytes

parameters & arguments

Describes all parameter functionality and accepted data types

pickled_byte_data: bytes

First and only required positional argument. Accepts bytes

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

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:

pickle section
pickledumpbytes
maci.pickledumpbytes
https://docs.python.org/3/library/pickle.html