{
    "mode": "pydoc",
    "parameter": "chardet",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/chardet/json",
    "generated": "2026-06-02T13:24:17Z",
    "sections": {
        "NAME": {
            "content": "chardet\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "######################## 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",
            "subsections": []
        },
        "PACKAGE CONTENTS": {
            "content": "big5freq\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",
            "subsections": []
        },
        "CLASSES": {
            "content": "builtins.object\nchardet.universaldetector.UniversalDetector\n",
            "subsections": [
                {
                    "name": "class UniversalDetector",
                    "content": "|  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"
                }
            ]
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "detect",
                    "content": "Detect the encoding of the given byte string.\n\n:param bytestr:     The byte sequence to examine.\n:type bytestr:      ``bytes`` or ``bytearray``\n"
                },
                {
                    "name": "detect_all",
                    "content": "Detect 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"
                }
            ]
        },
        "DATA": {
            "content": "VERSION = ['4', '0', '0']\nall = ['UniversalDetector', 'detect', 'detectall', 'version',...\n",
            "subsections": []
        },
        "VERSION": {
            "content": "4.0.0\n",
            "subsections": []
        },
        "FILE": {
            "content": "/usr/lib/python3/dist-packages/chardet/init.py\n\n",
            "subsections": []
        }
    },
    "summary": "chardet",
    "flags": [],
    "examples": [],
    "see_also": []
}