{
    "content": [
        {
            "type": "text",
            "text": "# plistlib (pydoc)\n\n**Summary:** plistlib - plistlib.py -- a tool to generate and parse MacOSX .plist files.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **DESCRIPTION** (54 lines)\n- **CLASSES** (5 lines) — 2 subsections\n  - class InvalidFileException (70 lines)\n  - class UID (30 lines)\n- **FUNCTIONS** (1 lines) — 4 subsections\n  - dump (3 lines)\n  - dumps (2 lines)\n  - load (3 lines)\n  - loads (3 lines)\n- **DATA** (4 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nplistlib - plistlib.py -- a tool to generate and parse MacOSX .plist files.\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/plistlib.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\nThe property list (.plist) file format is a simple XML pickle supporting\nbasic object types, like dictionaries, lists, numbers and strings.\nUsually the top level object is a dictionary.\n\nTo write out a plist file, use the dump(value, file)\nfunction. 'value' is the top level object, 'file' is\na (writable) file object.\n\nTo parse a plist from a file, use the load(file) function,\nwith a (readable) file object as the only argument. It\nreturns the top level object (again, usually a dictionary).\n\nTo work with plist data in bytes objects, you can use loads()\nand dumps().\n\nValues can be strings, integers, floats, booleans, tuples, lists,\ndictionaries (but only with string keys), Data, bytes, bytearray, or\ndatetime.datetime objects.\n\nGenerate Plist example:\n\nimport datetime\nimport plistlib\n\npl = dict(\naString = \"Doodah\",\naList = [\"A\", \"B\", 12, 32.1, [1, 2, 3]],\naFloat = 0.1,\nanInt = 728,\naDict = dict(\nanotherString = \"<hello & hi there!>\",\naThirdString = \"M\\xe4ssig, Ma\\xdf\",\naTrueValue = True,\naFalseValue = False,\n),\nsomeData = b\"<binary gunk>\",\nsomeMoreData = b\"<lots of binary gunk>\" * 10,\naDate = datetime.datetime.now()\n)\nprint(plistlib.dumps(pl).decode())\n\nParse Plist example:\n\nimport plistlib\n\nplist = b'''<plist version=\"1.0\">\n<dict>\n<key>foo</key>\n<string>bar</string>\n</dict>\n</plist>'''\npl = plistlib.loads(plist)\nprint(pl[\"foo\"])\n\n### CLASSES\n\nbuiltins.ValueError(builtins.Exception)\nInvalidFileException\nbuiltins.object\nUID\n\n#### class InvalidFileException\n\n|  InvalidFileException(message='Invalid file')\n|\n|  Method resolution order:\n|      InvalidFileException\n|      builtins.ValueError\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, message='Invalid file')\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.ValueError:\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 UID\n\n|  UID(data)\n|\n|  Methods defined here:\n|\n|  eq(self, other)\n|      Return self==value.\n|\n|  hash(self)\n|      Return hash(self).\n|\n|  index(self)\n|\n|  init(self, data)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  reduce(self)\n|      Helper for pickle.\n|\n|  repr(self)\n|      Return repr(self).\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n\n### FUNCTIONS\n\n#### dump\n\nWrite 'value' to a .plist file. 'fp' should be a writable,\nbinary file object.\n\n#### dumps\n\nReturn a bytes object with the contents for a .plist file.\n\n#### load\n\nRead a .plist file. 'fp' should be a readable and binary file object.\nReturn the unpacked root object (which usually is a dictionary).\n\n#### loads\n\nRead a .plist file from a bytes object.\nReturn the unpacked root object (which usually is a dictionary).\n\n### DATA\n\nFMTBINARY = <PlistFormat.FMTBINARY: 2>\nFMTXML = <PlistFormat.FMTXML: 1>\nall = ['InvalidFileException', 'FMTXML', 'FMTBINARY', 'load', 'd...\n\n### FILE\n\n/usr/lib/python3.10/plistlib.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "plistlib",
        "section": "",
        "mode": "pydoc",
        "summary": "plistlib - plistlib.py -- a tool to generate and parse MacOSX .plist files.",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "MODULE REFERENCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 54,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 5,
                "subsections": [
                    {
                        "name": "class InvalidFileException",
                        "lines": 70
                    },
                    {
                        "name": "class UID",
                        "lines": 30
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "dump",
                        "lines": 3
                    },
                    {
                        "name": "dumps",
                        "lines": 2
                    },
                    {
                        "name": "load",
                        "lines": 3
                    },
                    {
                        "name": "loads",
                        "lines": 3
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}