Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- venv/lib/python3.13/site-packages/certifi-2025.8.3.dist-info/licenses/LICENSE +20 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/__init__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/__main__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/api.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/cd.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/constant.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/legacy.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/md.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/models.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/utils.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/version.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/cli/__init__.py +8 -0
- venv/lib/python3.13/site-packages/charset_normalizer/cli/__main__.py +381 -0
- venv/lib/python3.13/site-packages/charset_normalizer/cli/__pycache__/__init__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/charset_normalizer/cli/__pycache__/__main__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/filelock-3.19.1.dist-info/licenses/LICENSE +24 -0
- venv/lib/python3.13/site-packages/filelock/__pycache__/__init__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/filelock/__pycache__/_api.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/filelock/__pycache__/_error.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/filelock/__pycache__/_soft.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/filelock/__pycache__/_unix.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/filelock/__pycache__/_util.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/filelock/__pycache__/_windows.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/filelock/__pycache__/asyncio.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/filelock/__pycache__/version.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/__init__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/_version.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/archive.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/asyn.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/caching.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/callbacks.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/compression.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/config.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/conftest.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/core.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/dircache.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/exceptions.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/fuse.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/generic.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/gui.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/json.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/mapping.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/parquet.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/registry.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/spec.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/transaction.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/__pycache__/utils.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/implementations/__init__.py +0 -0
- venv/lib/python3.13/site-packages/fsspec/implementations/__pycache__/__init__.cpython-313.pyc +0 -0
- venv/lib/python3.13/site-packages/fsspec/implementations/__pycache__/arrow.cpython-313.pyc +0 -0
venv/lib/python3.13/site-packages/certifi-2025.8.3.dist-info/licenses/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This package contains a modified version of ca-bundle.crt:
|
| 2 |
+
|
| 3 |
+
ca-bundle.crt -- Bundle of CA Root Certificates
|
| 4 |
+
|
| 5 |
+
This is a bundle of X.509 certificates of public Certificate Authorities
|
| 6 |
+
(CA). These were automatically extracted from Mozilla's root certificates
|
| 7 |
+
file (certdata.txt). This file can be found in the mozilla source tree:
|
| 8 |
+
https://hg.mozilla.org/mozilla-central/file/tip/security/nss/lib/ckfw/builtins/certdata.txt
|
| 9 |
+
It contains the certificates in PEM format and therefore
|
| 10 |
+
can be directly used with curl / libcurl / php_curl, or with
|
| 11 |
+
an Apache+mod_ssl webserver for SSL client authentication.
|
| 12 |
+
Just configure this file as the SSLCACertificateFile.#
|
| 13 |
+
|
| 14 |
+
***** BEGIN LICENSE BLOCK *****
|
| 15 |
+
This Source Code Form is subject to the terms of the Mozilla Public License,
|
| 16 |
+
v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain
|
| 17 |
+
one at http://mozilla.org/MPL/2.0/.
|
| 18 |
+
|
| 19 |
+
***** END LICENSE BLOCK *****
|
| 20 |
+
@(#) $RCSfile: certdata.txt,v $ $Revision: 1.80 $ $Date: 2011/11/03 15:11:58 $
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (1.78 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/__main__.cpython-313.pyc
ADDED
|
Binary file (363 Bytes). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/api.cpython-313.pyc
ADDED
|
Binary file (18.7 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/cd.cpython-313.pyc
ADDED
|
Binary file (13.4 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/constant.cpython-313.pyc
ADDED
|
Binary file (40.8 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/legacy.cpython-313.pyc
ADDED
|
Binary file (3.13 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/md.cpython-313.pyc
ADDED
|
Binary file (25.4 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/models.cpython-313.pyc
ADDED
|
Binary file (17.3 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/utils.cpython-313.pyc
ADDED
|
Binary file (14.1 kB). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/__pycache__/version.cpython-313.pyc
ADDED
|
Binary file (388 Bytes). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/cli/__init__.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from .__main__ import cli_detect, query_yes_no
|
| 4 |
+
|
| 5 |
+
__all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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import argparse
|
| 4 |
+
import sys
|
| 5 |
+
import typing
|
| 6 |
+
from json import dumps
|
| 7 |
+
from os.path import abspath, basename, dirname, join, realpath
|
| 8 |
+
from platform import python_version
|
| 9 |
+
from unicodedata import unidata_version
|
| 10 |
+
|
| 11 |
+
import charset_normalizer.md as md_module
|
| 12 |
+
from charset_normalizer import from_fp
|
| 13 |
+
from charset_normalizer.models import CliDetectionResult
|
| 14 |
+
from charset_normalizer.version import __version__
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def query_yes_no(question: str, default: str = "yes") -> bool:
|
| 18 |
+
"""Ask a yes/no question via input() and return their answer.
|
| 19 |
+
|
| 20 |
+
"question" is a string that is presented to the user.
|
| 21 |
+
"default" is the presumed answer if the user just hits <Enter>.
|
| 22 |
+
It must be "yes" (the default), "no" or None (meaning
|
| 23 |
+
an answer is required of the user).
|
| 24 |
+
|
| 25 |
+
The "answer" return value is True for "yes" or False for "no".
|
| 26 |
+
|
| 27 |
+
Credit goes to (c) https://stackoverflow.com/questions/3041986/apt-command-line-interface-like-yes-no-input
|
| 28 |
+
"""
|
| 29 |
+
valid = {"yes": True, "y": True, "ye": True, "no": False, "n": False}
|
| 30 |
+
if default is None:
|
| 31 |
+
prompt = " [y/n] "
|
| 32 |
+
elif default == "yes":
|
| 33 |
+
prompt = " [Y/n] "
|
| 34 |
+
elif default == "no":
|
| 35 |
+
prompt = " [y/N] "
|
| 36 |
+
else:
|
| 37 |
+
raise ValueError("invalid default answer: '%s'" % default)
|
| 38 |
+
|
| 39 |
+
while True:
|
| 40 |
+
sys.stdout.write(question + prompt)
|
| 41 |
+
choice = input().lower()
|
| 42 |
+
if default is not None and choice == "":
|
| 43 |
+
return valid[default]
|
| 44 |
+
elif choice in valid:
|
| 45 |
+
return valid[choice]
|
| 46 |
+
else:
|
| 47 |
+
sys.stdout.write("Please respond with 'yes' or 'no' (or 'y' or 'n').\n")
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
class FileType:
|
| 51 |
+
"""Factory for creating file object types
|
| 52 |
+
|
| 53 |
+
Instances of FileType are typically passed as type= arguments to the
|
| 54 |
+
ArgumentParser add_argument() method.
|
| 55 |
+
|
| 56 |
+
Keyword Arguments:
|
| 57 |
+
- mode -- A string indicating how the file is to be opened. Accepts the
|
| 58 |
+
same values as the builtin open() function.
|
| 59 |
+
- bufsize -- The file's desired buffer size. Accepts the same values as
|
| 60 |
+
the builtin open() function.
|
| 61 |
+
- encoding -- The file's encoding. Accepts the same values as the
|
| 62 |
+
builtin open() function.
|
| 63 |
+
- errors -- A string indicating how encoding and decoding errors are to
|
| 64 |
+
be handled. Accepts the same value as the builtin open() function.
|
| 65 |
+
|
| 66 |
+
Backported from CPython 3.12
|
| 67 |
+
"""
|
| 68 |
+
|
| 69 |
+
def __init__(
|
| 70 |
+
self,
|
| 71 |
+
mode: str = "r",
|
| 72 |
+
bufsize: int = -1,
|
| 73 |
+
encoding: str | None = None,
|
| 74 |
+
errors: str | None = None,
|
| 75 |
+
):
|
| 76 |
+
self._mode = mode
|
| 77 |
+
self._bufsize = bufsize
|
| 78 |
+
self._encoding = encoding
|
| 79 |
+
self._errors = errors
|
| 80 |
+
|
| 81 |
+
def __call__(self, string: str) -> typing.IO: # type: ignore[type-arg]
|
| 82 |
+
# the special argument "-" means sys.std{in,out}
|
| 83 |
+
if string == "-":
|
| 84 |
+
if "r" in self._mode:
|
| 85 |
+
return sys.stdin.buffer if "b" in self._mode else sys.stdin
|
| 86 |
+
elif any(c in self._mode for c in "wax"):
|
| 87 |
+
return sys.stdout.buffer if "b" in self._mode else sys.stdout
|
| 88 |
+
else:
|
| 89 |
+
msg = f'argument "-" with mode {self._mode}'
|
| 90 |
+
raise ValueError(msg)
|
| 91 |
+
|
| 92 |
+
# all other arguments are used as file names
|
| 93 |
+
try:
|
| 94 |
+
return open(string, self._mode, self._bufsize, self._encoding, self._errors)
|
| 95 |
+
except OSError as e:
|
| 96 |
+
message = f"can't open '{string}': {e}"
|
| 97 |
+
raise argparse.ArgumentTypeError(message)
|
| 98 |
+
|
| 99 |
+
def __repr__(self) -> str:
|
| 100 |
+
args = self._mode, self._bufsize
|
| 101 |
+
kwargs = [("encoding", self._encoding), ("errors", self._errors)]
|
| 102 |
+
args_str = ", ".join(
|
| 103 |
+
[repr(arg) for arg in args if arg != -1]
|
| 104 |
+
+ [f"{kw}={arg!r}" for kw, arg in kwargs if arg is not None]
|
| 105 |
+
)
|
| 106 |
+
return f"{type(self).__name__}({args_str})"
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
def cli_detect(argv: list[str] | None = None) -> int:
|
| 110 |
+
"""
|
| 111 |
+
CLI assistant using ARGV and ArgumentParser
|
| 112 |
+
:param argv:
|
| 113 |
+
:return: 0 if everything is fine, anything else equal trouble
|
| 114 |
+
"""
|
| 115 |
+
parser = argparse.ArgumentParser(
|
| 116 |
+
description="The Real First Universal Charset Detector. "
|
| 117 |
+
"Discover originating encoding used on text file. "
|
| 118 |
+
"Normalize text to unicode."
|
| 119 |
+
)
|
| 120 |
+
|
| 121 |
+
parser.add_argument(
|
| 122 |
+
"files", type=FileType("rb"), nargs="+", help="File(s) to be analysed"
|
| 123 |
+
)
|
| 124 |
+
parser.add_argument(
|
| 125 |
+
"-v",
|
| 126 |
+
"--verbose",
|
| 127 |
+
action="store_true",
|
| 128 |
+
default=False,
|
| 129 |
+
dest="verbose",
|
| 130 |
+
help="Display complementary information about file if any. "
|
| 131 |
+
"Stdout will contain logs about the detection process.",
|
| 132 |
+
)
|
| 133 |
+
parser.add_argument(
|
| 134 |
+
"-a",
|
| 135 |
+
"--with-alternative",
|
| 136 |
+
action="store_true",
|
| 137 |
+
default=False,
|
| 138 |
+
dest="alternatives",
|
| 139 |
+
help="Output complementary possibilities if any. Top-level JSON WILL be a list.",
|
| 140 |
+
)
|
| 141 |
+
parser.add_argument(
|
| 142 |
+
"-n",
|
| 143 |
+
"--normalize",
|
| 144 |
+
action="store_true",
|
| 145 |
+
default=False,
|
| 146 |
+
dest="normalize",
|
| 147 |
+
help="Permit to normalize input file. If not set, program does not write anything.",
|
| 148 |
+
)
|
| 149 |
+
parser.add_argument(
|
| 150 |
+
"-m",
|
| 151 |
+
"--minimal",
|
| 152 |
+
action="store_true",
|
| 153 |
+
default=False,
|
| 154 |
+
dest="minimal",
|
| 155 |
+
help="Only output the charset detected to STDOUT. Disabling JSON output.",
|
| 156 |
+
)
|
| 157 |
+
parser.add_argument(
|
| 158 |
+
"-r",
|
| 159 |
+
"--replace",
|
| 160 |
+
action="store_true",
|
| 161 |
+
default=False,
|
| 162 |
+
dest="replace",
|
| 163 |
+
help="Replace file when trying to normalize it instead of creating a new one.",
|
| 164 |
+
)
|
| 165 |
+
parser.add_argument(
|
| 166 |
+
"-f",
|
| 167 |
+
"--force",
|
| 168 |
+
action="store_true",
|
| 169 |
+
default=False,
|
| 170 |
+
dest="force",
|
| 171 |
+
help="Replace file without asking if you are sure, use this flag with caution.",
|
| 172 |
+
)
|
| 173 |
+
parser.add_argument(
|
| 174 |
+
"-i",
|
| 175 |
+
"--no-preemptive",
|
| 176 |
+
action="store_true",
|
| 177 |
+
default=False,
|
| 178 |
+
dest="no_preemptive",
|
| 179 |
+
help="Disable looking at a charset declaration to hint the detector.",
|
| 180 |
+
)
|
| 181 |
+
parser.add_argument(
|
| 182 |
+
"-t",
|
| 183 |
+
"--threshold",
|
| 184 |
+
action="store",
|
| 185 |
+
default=0.2,
|
| 186 |
+
type=float,
|
| 187 |
+
dest="threshold",
|
| 188 |
+
help="Define a custom maximum amount of noise allowed in decoded content. 0. <= noise <= 1.",
|
| 189 |
+
)
|
| 190 |
+
parser.add_argument(
|
| 191 |
+
"--version",
|
| 192 |
+
action="version",
|
| 193 |
+
version="Charset-Normalizer {} - Python {} - Unicode {} - SpeedUp {}".format(
|
| 194 |
+
__version__,
|
| 195 |
+
python_version(),
|
| 196 |
+
unidata_version,
|
| 197 |
+
"OFF" if md_module.__file__.lower().endswith(".py") else "ON",
|
| 198 |
+
),
|
| 199 |
+
help="Show version information and exit.",
|
| 200 |
+
)
|
| 201 |
+
|
| 202 |
+
args = parser.parse_args(argv)
|
| 203 |
+
|
| 204 |
+
if args.replace is True and args.normalize is False:
|
| 205 |
+
if args.files:
|
| 206 |
+
for my_file in args.files:
|
| 207 |
+
my_file.close()
|
| 208 |
+
print("Use --replace in addition of --normalize only.", file=sys.stderr)
|
| 209 |
+
return 1
|
| 210 |
+
|
| 211 |
+
if args.force is True and args.replace is False:
|
| 212 |
+
if args.files:
|
| 213 |
+
for my_file in args.files:
|
| 214 |
+
my_file.close()
|
| 215 |
+
print("Use --force in addition of --replace only.", file=sys.stderr)
|
| 216 |
+
return 1
|
| 217 |
+
|
| 218 |
+
if args.threshold < 0.0 or args.threshold > 1.0:
|
| 219 |
+
if args.files:
|
| 220 |
+
for my_file in args.files:
|
| 221 |
+
my_file.close()
|
| 222 |
+
print("--threshold VALUE should be between 0. AND 1.", file=sys.stderr)
|
| 223 |
+
return 1
|
| 224 |
+
|
| 225 |
+
x_ = []
|
| 226 |
+
|
| 227 |
+
for my_file in args.files:
|
| 228 |
+
matches = from_fp(
|
| 229 |
+
my_file,
|
| 230 |
+
threshold=args.threshold,
|
| 231 |
+
explain=args.verbose,
|
| 232 |
+
preemptive_behaviour=args.no_preemptive is False,
|
| 233 |
+
)
|
| 234 |
+
|
| 235 |
+
best_guess = matches.best()
|
| 236 |
+
|
| 237 |
+
if best_guess is None:
|
| 238 |
+
print(
|
| 239 |
+
'Unable to identify originating encoding for "{}". {}'.format(
|
| 240 |
+
my_file.name,
|
| 241 |
+
(
|
| 242 |
+
"Maybe try increasing maximum amount of chaos."
|
| 243 |
+
if args.threshold < 1.0
|
| 244 |
+
else ""
|
| 245 |
+
),
|
| 246 |
+
),
|
| 247 |
+
file=sys.stderr,
|
| 248 |
+
)
|
| 249 |
+
x_.append(
|
| 250 |
+
CliDetectionResult(
|
| 251 |
+
abspath(my_file.name),
|
| 252 |
+
None,
|
| 253 |
+
[],
|
| 254 |
+
[],
|
| 255 |
+
"Unknown",
|
| 256 |
+
[],
|
| 257 |
+
False,
|
| 258 |
+
1.0,
|
| 259 |
+
0.0,
|
| 260 |
+
None,
|
| 261 |
+
True,
|
| 262 |
+
)
|
| 263 |
+
)
|
| 264 |
+
else:
|
| 265 |
+
x_.append(
|
| 266 |
+
CliDetectionResult(
|
| 267 |
+
abspath(my_file.name),
|
| 268 |
+
best_guess.encoding,
|
| 269 |
+
best_guess.encoding_aliases,
|
| 270 |
+
[
|
| 271 |
+
cp
|
| 272 |
+
for cp in best_guess.could_be_from_charset
|
| 273 |
+
if cp != best_guess.encoding
|
| 274 |
+
],
|
| 275 |
+
best_guess.language,
|
| 276 |
+
best_guess.alphabets,
|
| 277 |
+
best_guess.bom,
|
| 278 |
+
best_guess.percent_chaos,
|
| 279 |
+
best_guess.percent_coherence,
|
| 280 |
+
None,
|
| 281 |
+
True,
|
| 282 |
+
)
|
| 283 |
+
)
|
| 284 |
+
|
| 285 |
+
if len(matches) > 1 and args.alternatives:
|
| 286 |
+
for el in matches:
|
| 287 |
+
if el != best_guess:
|
| 288 |
+
x_.append(
|
| 289 |
+
CliDetectionResult(
|
| 290 |
+
abspath(my_file.name),
|
| 291 |
+
el.encoding,
|
| 292 |
+
el.encoding_aliases,
|
| 293 |
+
[
|
| 294 |
+
cp
|
| 295 |
+
for cp in el.could_be_from_charset
|
| 296 |
+
if cp != el.encoding
|
| 297 |
+
],
|
| 298 |
+
el.language,
|
| 299 |
+
el.alphabets,
|
| 300 |
+
el.bom,
|
| 301 |
+
el.percent_chaos,
|
| 302 |
+
el.percent_coherence,
|
| 303 |
+
None,
|
| 304 |
+
False,
|
| 305 |
+
)
|
| 306 |
+
)
|
| 307 |
+
|
| 308 |
+
if args.normalize is True:
|
| 309 |
+
if best_guess.encoding.startswith("utf") is True:
|
| 310 |
+
print(
|
| 311 |
+
'"{}" file does not need to be normalized, as it already came from unicode.'.format(
|
| 312 |
+
my_file.name
|
| 313 |
+
),
|
| 314 |
+
file=sys.stderr,
|
| 315 |
+
)
|
| 316 |
+
if my_file.closed is False:
|
| 317 |
+
my_file.close()
|
| 318 |
+
continue
|
| 319 |
+
|
| 320 |
+
dir_path = dirname(realpath(my_file.name))
|
| 321 |
+
file_name = basename(realpath(my_file.name))
|
| 322 |
+
|
| 323 |
+
o_: list[str] = file_name.split(".")
|
| 324 |
+
|
| 325 |
+
if args.replace is False:
|
| 326 |
+
o_.insert(-1, best_guess.encoding)
|
| 327 |
+
if my_file.closed is False:
|
| 328 |
+
my_file.close()
|
| 329 |
+
elif (
|
| 330 |
+
args.force is False
|
| 331 |
+
and query_yes_no(
|
| 332 |
+
'Are you sure to normalize "{}" by replacing it ?'.format(
|
| 333 |
+
my_file.name
|
| 334 |
+
),
|
| 335 |
+
"no",
|
| 336 |
+
)
|
| 337 |
+
is False
|
| 338 |
+
):
|
| 339 |
+
if my_file.closed is False:
|
| 340 |
+
my_file.close()
|
| 341 |
+
continue
|
| 342 |
+
|
| 343 |
+
try:
|
| 344 |
+
x_[0].unicode_path = join(dir_path, ".".join(o_))
|
| 345 |
+
|
| 346 |
+
with open(x_[0].unicode_path, "wb") as fp:
|
| 347 |
+
fp.write(best_guess.output())
|
| 348 |
+
except OSError as e:
|
| 349 |
+
print(str(e), file=sys.stderr)
|
| 350 |
+
if my_file.closed is False:
|
| 351 |
+
my_file.close()
|
| 352 |
+
return 2
|
| 353 |
+
|
| 354 |
+
if my_file.closed is False:
|
| 355 |
+
my_file.close()
|
| 356 |
+
|
| 357 |
+
if args.minimal is False:
|
| 358 |
+
print(
|
| 359 |
+
dumps(
|
| 360 |
+
[el.__dict__ for el in x_] if len(x_) > 1 else x_[0].__dict__,
|
| 361 |
+
ensure_ascii=True,
|
| 362 |
+
indent=4,
|
| 363 |
+
)
|
| 364 |
+
)
|
| 365 |
+
else:
|
| 366 |
+
for my_file in args.files:
|
| 367 |
+
print(
|
| 368 |
+
", ".join(
|
| 369 |
+
[
|
| 370 |
+
el.encoding or "undefined"
|
| 371 |
+
for el in x_
|
| 372 |
+
if el.path == abspath(my_file.name)
|
| 373 |
+
]
|
| 374 |
+
)
|
| 375 |
+
)
|
| 376 |
+
|
| 377 |
+
return 0
|
| 378 |
+
|
| 379 |
+
|
| 380 |
+
if __name__ == "__main__":
|
| 381 |
+
cli_detect()
|
venv/lib/python3.13/site-packages/charset_normalizer/cli/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (349 Bytes). View file
|
|
|
venv/lib/python3.13/site-packages/charset_normalizer/cli/__pycache__/__main__.cpython-313.pyc
ADDED
|
Binary file (14.5 kB). View file
|
|
|
venv/lib/python3.13/site-packages/filelock-3.19.1.dist-info/licenses/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This is free and unencumbered software released into the public domain.
|
| 2 |
+
|
| 3 |
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
| 4 |
+
distribute this software, either in source code form or as a compiled
|
| 5 |
+
binary, for any purpose, commercial or non-commercial, and by any
|
| 6 |
+
means.
|
| 7 |
+
|
| 8 |
+
In jurisdictions that recognize copyright laws, the author or authors
|
| 9 |
+
of this software dedicate any and all copyright interest in the
|
| 10 |
+
software to the public domain. We make this dedication for the benefit
|
| 11 |
+
of the public at large and to the detriment of our heirs and
|
| 12 |
+
successors. We intend this dedication to be an overt act of
|
| 13 |
+
relinquishment in perpetuity of all present and future rights to this
|
| 14 |
+
software under copyright law.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 17 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
| 18 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
| 19 |
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
| 20 |
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
| 21 |
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
| 22 |
+
OTHER DEALINGS IN THE SOFTWARE.
|
| 23 |
+
|
| 24 |
+
For more information, please refer to <http://unlicense.org>
|
venv/lib/python3.13/site-packages/filelock/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (1.6 kB). View file
|
|
|
venv/lib/python3.13/site-packages/filelock/__pycache__/_api.cpython-313.pyc
ADDED
|
Binary file (16.5 kB). View file
|
|
|
venv/lib/python3.13/site-packages/filelock/__pycache__/_error.cpython-313.pyc
ADDED
|
Binary file (1.84 kB). View file
|
|
|
venv/lib/python3.13/site-packages/filelock/__pycache__/_soft.cpython-313.pyc
ADDED
|
Binary file (2.54 kB). View file
|
|
|
venv/lib/python3.13/site-packages/filelock/__pycache__/_unix.cpython-313.pyc
ADDED
|
Binary file (3.63 kB). View file
|
|
|
venv/lib/python3.13/site-packages/filelock/__pycache__/_util.cpython-313.pyc
ADDED
|
Binary file (2.01 kB). View file
|
|
|
venv/lib/python3.13/site-packages/filelock/__pycache__/_windows.cpython-313.pyc
ADDED
|
Binary file (3.32 kB). View file
|
|
|
venv/lib/python3.13/site-packages/filelock/__pycache__/asyncio.cpython-313.pyc
ADDED
|
Binary file (15.5 kB). View file
|
|
|
venv/lib/python3.13/site-packages/filelock/__pycache__/version.cpython-313.pyc
ADDED
|
Binary file (665 Bytes). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (1.92 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/_version.cpython-313.pyc
ADDED
|
Binary file (813 Bytes). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/archive.cpython-313.pyc
ADDED
|
Binary file (4.15 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/asyn.cpython-313.pyc
ADDED
|
Binary file (46.4 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/caching.cpython-313.pyc
ADDED
|
Binary file (40 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/callbacks.cpython-313.pyc
ADDED
|
Binary file (12.3 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/compression.cpython-313.pyc
ADDED
|
Binary file (7.49 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/config.cpython-313.pyc
ADDED
|
Binary file (5.98 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/conftest.cpython-313.pyc
ADDED
|
Binary file (3.15 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/core.cpython-313.pyc
ADDED
|
Binary file (28.1 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/dircache.cpython-313.pyc
ADDED
|
Binary file (4.52 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/exceptions.cpython-313.pyc
ADDED
|
Binary file (904 Bytes). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/fuse.cpython-313.pyc
ADDED
|
Binary file (15.6 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/generic.cpython-313.pyc
ADDED
|
Binary file (18.2 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/gui.cpython-313.pyc
ADDED
|
Binary file (21.5 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/json.cpython-313.pyc
ADDED
|
Binary file (6.42 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/mapping.cpython-313.pyc
ADDED
|
Binary file (12.1 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/parquet.cpython-313.pyc
ADDED
|
Binary file (15.7 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/registry.cpython-313.pyc
ADDED
|
Binary file (11.5 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/spec.cpython-313.pyc
ADDED
|
Binary file (88.5 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/transaction.cpython-313.pyc
ADDED
|
Binary file (4.73 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/__pycache__/utils.cpython-313.pyc
ADDED
|
Binary file (28.3 kB). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/implementations/__init__.py
ADDED
|
File without changes
|
venv/lib/python3.13/site-packages/fsspec/implementations/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (208 Bytes). View file
|
|
|
venv/lib/python3.13/site-packages/fsspec/implementations/__pycache__/arrow.cpython-313.pyc
ADDED
|
Binary file (13.8 kB). View file
|
|
|