{
    "content": [
        {
            "type": "text",
            "text": "# pickle (pydoc)\n\n## TLDR\n\n> A PHP extension installer based on Composer.\n\n- Install a specific PHP extension:\n  `pickle install {{extension_name}}`\n- Convert an existing PECL extension configuration to a Pickle configuration file:\n  `pickle convert {{path/to/directory}}`\n- Validate a PECL extension:\n  `pickle validate {{path/to/directory}}`\n- Package a PECL extension for release:\n  `pickle release {{path/to/directory}}`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** pickle - Create portable serialized representations of Python objects.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **DESCRIPTION** (21 lines)\n- **CLASSES** (9 lines) — 6 subsections\n  - class PickleBuffer (17 lines)\n  - class PickleError (67 lines)\n  - class Pickler (71 lines)\n  - class PicklingError (68 lines)\n  - class Unpickler (61 lines)\n  - class UnpicklingError (68 lines)\n- **FUNCTIONS** (1 lines) — 4 subsections\n  - dump (27 lines)\n  - dumps (19 lines)\n  - load (24 lines)\n  - loads (15 lines)\n- **DATA** (74 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\npickle - Create portable serialized representations of Python objects.\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/pickle.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n\n### DESCRIPTION\n\nSee module copyreg for a mechanism for registering custom picklers.\nSee module pickletools source for extensive comments.\n\nClasses:\n\nPickler\nUnpickler\n\nFunctions:\n\ndump(object, file)\ndumps(object) -> string\nload(file) -> object\nloads(bytes) -> object\n\nMisc variables:\n\nversion\nformatversion\ncompatibleformats\n\n### CLASSES\n\nbuiltins.Exception(builtins.BaseException)\npickle.PickleError\npickle.PicklingError\npickle.UnpicklingError\nbuiltins.object\npickle.Pickler\npickle.Unpickler\nPickleBuffer\n\n#### class PickleBuffer\n\n|  Wrapper for potentially out-of-band buffers\n|\n|  Methods defined here:\n|\n|  raw(self, /)\n|      Return a memoryview of the raw memory underlying this buffer.\n|      Will raise BufferError is the buffer isn't contiguous.\n|\n|  release(self, /)\n|      Release the underlying buffer exposed by the PickleBuffer object.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n\n#### class PickleError\n\n|  Method resolution order:\n|      PickleError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class Pickler\n\n|  Pickler(file, protocol=None, fiximports=True, buffercallback=None)\n|\n|  This takes a binary file for writing a pickle data stream.\n|\n|  The optional *protocol* argument tells the pickler to use the given\n|  protocol; supported protocols are 0, 1, 2, 3, 4 and 5.  The default\n|  protocol is 4. It was introduced in Python 3.4, and is incompatible\n|  with previous versions.\n|\n|  Specifying a negative protocol version selects the highest protocol\n|  version supported.  The higher the protocol used, the more recent the\n|  version of Python needed to read the pickle produced.\n|\n|  The *file* argument must have a write() method that accepts a single\n|  bytes argument. It can thus be a file object opened for binary\n|  writing, an io.BytesIO instance, or any other custom object that meets\n|  this interface.\n|\n|  If *fiximports* is True and protocol is less than 3, pickle will try\n|  to map the new Python 3 names to the old module names used in Python\n|  2, so that the pickle data stream is readable with Python 2.\n|\n|  If *buffercallback* is None (the default), buffer views are\n|  serialized into *file* as part of the pickle stream.\n|\n|  If *buffercallback* is not None, then it can be called any number\n|  of times with a buffer view.  If the callback returns a false value\n|  (such as None), the given buffer is out-of-band; otherwise the\n|  buffer is serialized in-band, i.e. inside the pickle stream.\n|\n|  It is an error if *buffercallback* is not None and *protocol*\n|  is None or smaller than 5.\n|\n|  Methods defined here:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  sizeof(self, /)\n|      Returns size in memory, in bytes.\n|\n|  clearmemo(self, /)\n|      Clears the pickler's \"memo\".\n|\n|      The memo is the data structure that remembers which objects the\n|      pickler has already seen, so that shared or recursive objects are\n|      pickled by reference and not by value.  This method is useful when\n|      re-using picklers.\n|\n|  dump(self, obj, /)\n|      Write a pickled representation of the given object to the open file.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  bin\n|\n|  dispatchtable\n|\n|  fast\n|\n|  memo\n|\n|  persistentid\n\n#### class PicklingError\n\n|  Method resolution order:\n|      PicklingError\n|      PickleError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from PickleError:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n#### class Unpickler\n\n|  Unpickler(file, *, fiximports=True, encoding='ASCII', errors='strict', buffers=())\n|\n|  This takes a binary file for reading a pickle data stream.\n|\n|  The protocol version of the pickle is detected automatically, so no\n|  protocol argument is needed.  Bytes past the pickled object's\n|  representation are ignored.\n|\n|  The argument *file* must have two methods, a read() method that takes\n|  an integer argument, and a readline() method that requires no\n|  arguments.  Both methods should return bytes.  Thus *file* can be a\n|  binary file object opened for reading, an io.BytesIO object, or any\n|  other custom object that meets this interface.\n|\n|  Optional keyword arguments are *fiximports*, *encoding* and *errors*,\n|  which are used to control compatibility support for pickle stream\n|  generated by Python 2.  If *fiximports* is True, pickle will try to\n|  map the old Python 2 names to the new names used in Python 3.  The\n|  *encoding* and *errors* tell pickle how to decode 8-bit string\n|  instances pickled by Python 2; these default to 'ASCII' and 'strict',\n|  respectively.  The *encoding* can be 'bytes' to read these 8-bit\n|  string instances as bytes objects.\n|\n|  Methods defined here:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  sizeof(self, /)\n|      Returns size in memory, in bytes.\n|\n|  findclass(self, modulename, globalname, /)\n|      Return an object from a specified module.\n|\n|      If necessary, the module will be imported. Subclasses may override\n|      this method (e.g. to restrict unpickling of arbitrary classes and\n|      functions).\n|\n|      This method is called whenever a class or a function object is\n|      needed.  Both arguments passed are str objects.\n|\n|  load(self, /)\n|      Load a pickle.\n|\n|      Read a pickled object representation from the open file object given\n|      in the constructor, and return the reconstituted object hierarchy\n|      specified therein.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  memo\n|\n|  persistentload\n\n#### class UnpicklingError\n\n|  Method resolution order:\n|      UnpicklingError\n|      PickleError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors inherited from PickleError:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n\n### FUNCTIONS\n\n#### dump\n\nWrite a pickled representation of obj to the open file object file.\n\nThis is equivalent to ``Pickler(file, protocol).dump(obj)``, but may\nbe more efficient.\n\nThe optional *protocol* argument tells the pickler to use the given\nprotocol; supported protocols are 0, 1, 2, 3, 4 and 5.  The default\nprotocol is 4. It was introduced in Python 3.4, and is incompatible\nwith previous versions.\n\nSpecifying a negative protocol version selects the highest protocol\nversion supported.  The higher the protocol used, the more recent the\nversion of Python needed to read the pickle produced.\n\nThe *file* argument must have a write() method that accepts a single\nbytes argument.  It can thus be a file object opened for binary\nwriting, an io.BytesIO instance, or any other custom object that meets\nthis interface.\n\nIf *fiximports* is True and protocol is less than 3, pickle will try\nto map the new Python 3 names to the old module names used in Python\n2, so that the pickle data stream is readable with Python 2.\n\nIf *buffercallback* is None (the default), buffer views are serialized\ninto *file* as part of the pickle stream.  It is an error if\n*buffercallback* is not None and *protocol* is None or smaller than 5.\n\n#### dumps\n\nReturn the pickled representation of the object as a bytes object.\n\nThe optional *protocol* argument tells the pickler to use the given\nprotocol; supported protocols are 0, 1, 2, 3, 4 and 5.  The default\nprotocol is 4. It was introduced in Python 3.4, and is incompatible\nwith previous versions.\n\nSpecifying a negative protocol version selects the highest protocol\nversion supported.  The higher the protocol used, the more recent the\nversion of Python needed to read the pickle produced.\n\nIf *fiximports* is True and *protocol* is less than 3, pickle will\ntry to map the new Python 3 names to the old module names used in\nPython 2, so that the pickle data stream is readable with Python 2.\n\nIf *buffercallback* is None (the default), buffer views are serialized\ninto *file* as part of the pickle stream.  It is an error if\n*buffercallback* is not None and *protocol* is None or smaller than 5.\n\n#### load\n\nRead and return an object from the pickle data stored in a file.\n\nThis is equivalent to ``Unpickler(file).load()``, but may be more\nefficient.\n\nThe protocol version of the pickle is detected automatically, so no\nprotocol argument is needed.  Bytes past the pickled object's\nrepresentation are ignored.\n\nThe argument *file* must have two methods, a read() method that takes\nan integer argument, and a readline() method that requires no\narguments.  Both methods should return bytes.  Thus *file* can be a\nbinary file object opened for reading, an io.BytesIO object, or any\nother custom object that meets this interface.\n\nOptional keyword arguments are *fiximports*, *encoding* and *errors*,\nwhich are used to control compatibility support for pickle stream\ngenerated by Python 2.  If *fiximports* is True, pickle will try to\nmap the old Python 2 names to the new names used in Python 3.  The\n*encoding* and *errors* tell pickle how to decode 8-bit string\ninstances pickled by Python 2; these default to 'ASCII' and 'strict',\nrespectively.  The *encoding* can be 'bytes' to read these 8-bit\nstring instances as bytes objects.\n\n#### loads\n\nRead and return an object from the given pickle data.\n\nThe protocol version of the pickle is detected automatically, so no\nprotocol argument is needed.  Bytes past the pickled object's\nrepresentation are ignored.\n\nOptional keyword arguments are *fiximports*, *encoding* and *errors*,\nwhich are used to control compatibility support for pickle stream\ngenerated by Python 2.  If *fiximports* is True, pickle will try to\nmap the old Python 2 names to the new names used in Python 3.  The\n*encoding* and *errors* tell pickle how to decode 8-bit string\ninstances pickled by Python 2; these default to 'ASCII' and 'strict',\nrespectively.  The *encoding* can be 'bytes' to read these 8-bit\nstring instances as bytes objects.\n\n### DATA\n\nADDITEMS = b'\\x90'\nAPPEND = b'a'\nAPPENDS = b'e'\nBINBYTES = b'B'\nBINBYTES8 = b'\\x8e'\nBINFLOAT = b'G'\nBINGET = b'h'\nBININT = b'J'\nBININT1 = b'K'\nBININT2 = b'M'\nBINPERSID = b'Q'\nBINPUT = b'q'\nBINSTRING = b'T'\nBINUNICODE = b'X'\nBINUNICODE8 = b'\\x8d'\nBUILD = b'b'\nBYTEARRAY8 = b'\\x96'\nDEFAULTPROTOCOL = 4\nDICT = b'd'\nDUP = b'2'\nEMPTYDICT = b'}'\nEMPTYLIST = b']'\nEMPTYSET = b'\\x8f'\nEMPTYTUPLE = b')'\nEXT1 = b'\\x82'\nEXT2 = b'\\x83'\nEXT4 = b'\\x84'\nFALSE = b'I00\\n'\nFLOAT = b'F'\nFRAME = b'\\x95'\nFROZENSET = b'\\x91'\nGET = b'g'\nGLOBAL = b'c'\nHIGHESTPROTOCOL = 5\nINST = b'i'\nINT = b'I'\nLIST = b'l'\nLONG = b'L'\nLONG1 = b'\\x8a'\nLONG4 = b'\\x8b'\nLONGBINGET = b'j'\nLONGBINPUT = b'r'\nMARK = b'('\nMEMOIZE = b'\\x94'\nNEWFALSE = b'\\x89'\nNEWOBJ = b'\\x81'\nNEWOBJEX = b'\\x92'\nNEWTRUE = b'\\x88'\nNEXTBUFFER = b'\\x97'\nNONE = b'N'\nOBJ = b'o'\nPERSID = b'P'\nPOP = b'0'\nPOPMARK = b'1'\nPROTO = b'\\x80'\nPUT = b'p'\nREADONLYBUFFER = b'\\x98'\nREDUCE = b'R'\nSETITEM = b's'\nSETITEMS = b'u'\nSHORTBINBYTES = b'C'\nSHORTBINSTRING = b'U'\nSHORTBINUNICODE = b'\\x8c'\nSTACKGLOBAL = b'\\x93'\nSTOP = b'.'\nSTRING = b'S'\nTRUE = b'I01\\n'\nTUPLE = b't'\nTUPLE1 = b'\\x85'\nTUPLE2 = b'\\x86'\nTUPLE3 = b'\\x87'\nUNICODE = b'V'\nall = ['PickleError', 'PicklingError', 'UnpicklingError', 'Pickler...\n\n### FILE\n\n/usr/lib/python3.10/pickle.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "pickle",
        "section": "",
        "mode": "pydoc",
        "summary": "pickle - Create portable serialized representations of Python objects.",
        "synopsis": null,
        "tldr_summary": "A PHP extension installer based on Composer.",
        "tldr_examples": [
            {
                "description": "Install a specific PHP extension",
                "command": "pickle install {{extension_name}}"
            },
            {
                "description": "Convert an existing PECL extension configuration to a Pickle configuration file",
                "command": "pickle convert {{path/to/directory}}"
            },
            {
                "description": "Validate a PECL extension",
                "command": "pickle validate {{path/to/directory}}"
            },
            {
                "description": "Package a PECL extension for release",
                "command": "pickle release {{path/to/directory}}"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "MODULE REFERENCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 21,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 9,
                "subsections": [
                    {
                        "name": "class PickleBuffer",
                        "lines": 17
                    },
                    {
                        "name": "class PickleError",
                        "lines": 67
                    },
                    {
                        "name": "class Pickler",
                        "lines": 71
                    },
                    {
                        "name": "class PicklingError",
                        "lines": 68
                    },
                    {
                        "name": "class Unpickler",
                        "lines": 61
                    },
                    {
                        "name": "class UnpicklingError",
                        "lines": 68
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "dump",
                        "lines": 27
                    },
                    {
                        "name": "dumps",
                        "lines": 19
                    },
                    {
                        "name": "load",
                        "lines": 24
                    },
                    {
                        "name": "loads",
                        "lines": 15
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 74,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}