{
    "content": [
        {
            "type": "text",
            "text": "# chardet (pydoc)\n\n**Summary:** chardet\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (17 lines)\n- **PACKAGE CONTENTS** (41 lines)\n- **CLASSES** (3 lines) — 1 subsections\n  - class UniversalDetector (67 lines)\n- **FUNCTIONS** (1 lines) — 2 subsections\n  - detect (5 lines)\n  - detect_all (5 lines)\n- **DATA** (3 lines)\n- **VERSION** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nchardet\n\n### DESCRIPTION\n\n######################## BEGIN LICENSE BLOCK ########################\n# This library is free software; you can redistribute it and/or\n# modify it under the terms of the GNU Lesser General Public\n# License as published by the Free Software Foundation; either\n# version 2.1 of the License, or (at your option) any later version.\n#\n# This library is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n# Lesser General Public License for more details.\n#\n# You should have received a copy of the GNU Lesser General Public\n# License along with this library; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n# 02110-1301  USA\n######################### END LICENSE BLOCK #########################\n\n### PACKAGE CONTENTS\n\nbig5freq\nbig5prober\nchardistribution\ncharsetgroupprober\ncharsetprober\ncli (package)\ncodingstatemachine\ncompat\ncp949prober\nenums\nescprober\nescsm\neucjpprober\neuckrfreq\neuckrprober\neuctwfreq\neuctwprober\ngb2312freq\ngb2312prober\nhebrewprober\njisfreq\njpcntx\nlangbulgarianmodel\nlanggreekmodel\nlanghebrewmodel\nlanghungarianmodel\nlangrussianmodel\nlangthaimodel\nlangturkishmodel\nlatin1prober\nmbcharsetprober\nmbcsgroupprober\nmbcssm\nmetadata (package)\nsbcharsetprober\nsbcsgroupprober\nsjisprober\nuniversaldetector\nutf8prober\nversion\n\n### CLASSES\n\nbuiltins.object\nchardet.universaldetector.UniversalDetector\n\n#### class UniversalDetector\n\n|  UniversalDetector(langfilter=31)\n|\n|  The ``UniversalDetector`` class underlies the ``chardet.detect`` function\n|  and coordinates all of the different charset probers.\n|\n|  To get a ``dict`` containing an encoding and its confidence, you can simply\n|  run:\n|\n|  .. code::\n|\n|          u = UniversalDetector()\n|          u.feed(somebytes)\n|          u.close()\n|          detected = u.result\n|\n|  Methods defined here:\n|\n|  init(self, langfilter=31)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  close(self)\n|      Stop analyzing the current document and come up with a final\n|      prediction.\n|\n|      :returns:  The ``result`` attribute, a ``dict`` with the keys\n|                 `encoding`, `confidence`, and `language`.\n|\n|  feed(self, bytestr)\n|      Takes a chunk of a document and feeds it through all of the relevant\n|      charset probers.\n|\n|      After calling ``feed``, you can check the value of the ``done``\n|      attribute to see if you need to continue feeding the\n|      ``UniversalDetector`` more data, or if it has made a prediction\n|      (in the ``result`` attribute).\n|\n|      .. note::\n|         You should always call ``close`` when you're done feeding in your\n|         document if ``done`` is not already ``True``.\n|\n|  reset(self)\n|      Reset the UniversalDetector and all of its probers back to their\n|      initial states.  This is called by ``init``, so you only need to\n|      call this directly in between analyses of different documents.\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|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  ESCDETECTOR = re.compile(b'(\\x1b|~{)')\n|\n|  HIGHBYTEDETECTOR = re.compile(b'[\\x80-\\xff]')\n|\n|  ISOWINMAP = {'iso-8859-1': 'Windows-1252', 'iso-8859-13': 'Windows-1...\n|\n|  MINIMUMTHRESHOLD = 0.2\n|\n|  WINBYTEDETECTOR = re.compile(b'[\\x80-\\x9f]')\n\n### FUNCTIONS\n\n#### detect\n\nDetect the encoding of the given byte string.\n\n:param bytestr:     The byte sequence to examine.\n:type bytestr:      ``bytes`` or ``bytearray``\n\n#### detect_all\n\nDetect all the possible encodings of the given byte string.\n\n:param bytestr:     The byte sequence to examine.\n:type bytestr:      ``bytes`` or ``bytearray``\n\n### DATA\n\nVERSION = ['4', '0', '0']\nall = ['UniversalDetector', 'detect', 'detectall', 'version',...\n\n### VERSION\n\n4.0.0\n\n### FILE\n\n/usr/lib/python3/dist-packages/chardet/init.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "chardet",
        "section": "",
        "mode": "pydoc",
        "summary": "chardet",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 17,
                "subsections": []
            },
            {
                "name": "PACKAGE CONTENTS",
                "lines": 41,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 3,
                "subsections": [
                    {
                        "name": "class UniversalDetector",
                        "lines": 67
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "detect",
                        "lines": 5
                    },
                    {
                        "name": "detect_all",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}