comparison charset_normalizer/__init__.py @ 7:5eb2d5e3bf22

planemo upload for repository https://toolrepo.galaxytrakr.org/view/jpayne/bioproject_to_srr_2/556cac4fb538
author jpayne
date Sun, 05 May 2024 23:32:17 -0400
parents
children
comparison
equal deleted inserted replaced
6:b2745907b1eb 7:5eb2d5e3bf22
1 # -*- coding: utf-8 -*-
2 """
3 Charset-Normalizer
4 ~~~~~~~~~~~~~~
5 The Real First Universal Charset Detector.
6 A library that helps you read text from an unknown charset encoding.
7 Motivated by chardet, This package is trying to resolve the issue by taking a new approach.
8 All IANA character set names for which the Python core library provides codecs are supported.
9
10 Basic usage:
11 >>> from charset_normalizer import from_bytes
12 >>> results = from_bytes('Bсеки човек има право на образование. Oбразованието!'.encode('utf_8'))
13 >>> best_guess = results.best()
14 >>> str(best_guess)
15 'Bсеки човек има право на образование. Oбразованието!'
16
17 Others methods and usages are available - see the full documentation
18 at <https://github.com/Ousret/charset_normalizer>.
19 :copyright: (c) 2021 by Ahmed TAHRI
20 :license: MIT, see LICENSE for more details.
21 """
22 import logging
23
24 from .api import from_bytes, from_fp, from_path, is_binary
25 from .legacy import detect
26 from .models import CharsetMatch, CharsetMatches
27 from .utils import set_logging_handler
28 from .version import VERSION, __version__
29
30 __all__ = (
31 "from_fp",
32 "from_path",
33 "from_bytes",
34 "is_binary",
35 "detect",
36 "CharsetMatch",
37 "CharsetMatches",
38 "__version__",
39 "VERSION",
40 "set_logging_handler",
41 )
42
43 # Attach a NullHandler to the top level logger by default
44 # https://docs.python.org/3.3/howto/logging.html#configuring-logging-for-a-library
45
46 logging.getLogger("charset_normalizer").addHandler(logging.NullHandler())