Spooker commited on
Commit
c6393bd
·
verified ·
1 Parent(s): ade02b3

Upload 2943 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .dockerignore +11 -0
  2. .env.example +47 -0
  3. .gitattributes +31 -0
  4. .venv/.gitignore +2 -0
  5. .venv/bin/Activate.ps1 +248 -0
  6. .venv/bin/activate +76 -0
  7. .venv/bin/activate.csh +27 -0
  8. .venv/bin/activate.fish +69 -0
  9. .venv/bin/dotenv +6 -0
  10. .venv/bin/flask +6 -0
  11. .venv/bin/normalizer +6 -0
  12. .venv/bin/pip +8 -0
  13. .venv/bin/pip3 +8 -0
  14. .venv/bin/pip3.13 +8 -0
  15. .venv/bin/python +3 -0
  16. .venv/bin/python3 +3 -0
  17. .venv/bin/python3.13 +3 -0
  18. .venv/bin/waitress-serve +6 -0
  19. .venv/lib/python3.13/site-packages/81d243bd2c585b0f4821__mypyc.cpython-313-x86_64-linux-gnu.so +3 -0
  20. .venv/lib/python3.13/site-packages/blinker-1.9.0.dist-info/INSTALLER +1 -0
  21. .venv/lib/python3.13/site-packages/blinker-1.9.0.dist-info/LICENSE.txt +20 -0
  22. .venv/lib/python3.13/site-packages/blinker-1.9.0.dist-info/METADATA +60 -0
  23. .venv/lib/python3.13/site-packages/blinker-1.9.0.dist-info/RECORD +12 -0
  24. .venv/lib/python3.13/site-packages/blinker-1.9.0.dist-info/WHEEL +4 -0
  25. .venv/lib/python3.13/site-packages/blinker/__init__.py +17 -0
  26. .venv/lib/python3.13/site-packages/blinker/__pycache__/__init__.cpython-313.pyc +0 -0
  27. .venv/lib/python3.13/site-packages/blinker/__pycache__/_utilities.cpython-313.pyc +0 -0
  28. .venv/lib/python3.13/site-packages/blinker/__pycache__/base.cpython-313.pyc +0 -0
  29. .venv/lib/python3.13/site-packages/blinker/_utilities.py +64 -0
  30. .venv/lib/python3.13/site-packages/blinker/base.py +512 -0
  31. .venv/lib/python3.13/site-packages/blinker/py.typed +0 -0
  32. .venv/lib/python3.13/site-packages/certifi-2026.2.25.dist-info/INSTALLER +1 -0
  33. .venv/lib/python3.13/site-packages/certifi-2026.2.25.dist-info/METADATA +78 -0
  34. .venv/lib/python3.13/site-packages/certifi-2026.2.25.dist-info/RECORD +14 -0
  35. .venv/lib/python3.13/site-packages/certifi-2026.2.25.dist-info/WHEEL +5 -0
  36. .venv/lib/python3.13/site-packages/certifi-2026.2.25.dist-info/licenses/LICENSE +20 -0
  37. .venv/lib/python3.13/site-packages/certifi-2026.2.25.dist-info/top_level.txt +1 -0
  38. .venv/lib/python3.13/site-packages/certifi/__init__.py +4 -0
  39. .venv/lib/python3.13/site-packages/certifi/__main__.py +12 -0
  40. .venv/lib/python3.13/site-packages/certifi/__pycache__/__init__.cpython-313.pyc +0 -0
  41. .venv/lib/python3.13/site-packages/certifi/__pycache__/__main__.cpython-313.pyc +0 -0
  42. .venv/lib/python3.13/site-packages/certifi/__pycache__/core.cpython-313.pyc +0 -0
  43. .venv/lib/python3.13/site-packages/certifi/cacert.pem +0 -0
  44. .venv/lib/python3.13/site-packages/certifi/core.py +83 -0
  45. .venv/lib/python3.13/site-packages/certifi/py.typed +0 -0
  46. .venv/lib/python3.13/site-packages/charset_normalizer-3.4.7.dist-info/INSTALLER +1 -0
  47. .venv/lib/python3.13/site-packages/charset_normalizer-3.4.7.dist-info/METADATA +808 -0
  48. .venv/lib/python3.13/site-packages/charset_normalizer-3.4.7.dist-info/RECORD +36 -0
  49. .venv/lib/python3.13/site-packages/charset_normalizer-3.4.7.dist-info/WHEEL +7 -0
  50. .venv/lib/python3.13/site-packages/charset_normalizer-3.4.7.dist-info/entry_points.txt +2 -0
.dockerignore ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .git
2
+ __pycache__
3
+ *.pyc
4
+ *.pyo
5
+ *.pyd
6
+ .Python
7
+ .pytest_cache
8
+ .env
9
+ data
10
+ *.db
11
+ *.log
.env.example ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Rita.ai Multi-Account Configuration
2
+ # Accounts can be managed via WebUI at http://localhost:7860/ (HF Space uses 7860 by default)
3
+ # or via API at /api/accounts
4
+
5
+ # Initial accounts from env vars (first run only, then data/accounts.json takes over)
6
+ # Single account
7
+ # RITA_TOKEN=your_token
8
+ # RITA_VISITOR_ID=your_visitorid
9
+
10
+ # Multiple accounts — comma-separated
11
+ # RITA_TOKENS=token1,token2,token3
12
+ # RITA_VISITOR_IDS=vid1,vid2,vid3
13
+
14
+ # Optional (defaults shown)
15
+ RITA_UPSTREAM=https://api_v2.rita.ai
16
+ RITA_ORIGIN=https://www.rita.ai
17
+ # Disable SSL verification for api_v2.rita.ai (hostname mismatch in upstream cert)
18
+ DISABLE_SSL_VERIFY=1
19
+ # Background health check interval in seconds (default: 600 = 10 minutes)
20
+ HEALTH_CHECK_INTERVAL=600
21
+ HOST=0.0.0.0
22
+ PORT=7860
23
+ DEBUG=1
24
+
25
+ # ===================== Admin Panel Authentication =====================
26
+ # Admin panel authentication token (empty = no auth)
27
+ AUTH_TOKEN=
28
+
29
+ # ===================== Auto Registration =====================
30
+ # Enable automatic account registration when active accounts drop below minimum
31
+ AUTO_REGISTER_ENABLED=0
32
+ # Minimum active accounts to maintain (triggers auto-register when below)
33
+ AUTO_REGISTER_MIN_ACTIVE=2
34
+ # How many accounts to register per batch
35
+ AUTO_REGISTER_BATCH=1
36
+ # Default password for new accounts
37
+ AUTO_REGISTER_PASSWORD=@qazwsx123456
38
+
39
+ # YesCaptcha API key for solving reCAPTCHA (https://yescaptcha.com)
40
+ # YESCAPTCHA_KEY=your_yescaptcha_client_key
41
+
42
+ # GPTMail API for temporary emails (https://mail.chatgpt.org.uk)
43
+ # GPTMAIL_API_KEY=your_gptmail_api_key
44
+ # GPTMAIL_API_BASE=https://mail.chatgpt.org.uk
45
+
46
+ # Hugging Face Space persistent data directory (recommended)
47
+ RITA_DATA_DIR=/data
.gitattributes ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .venv/bin/python filter=lfs diff=lfs merge=lfs -text
2
+ .venv/bin/python3 filter=lfs diff=lfs merge=lfs -text
3
+ .venv/bin/python3.13 filter=lfs diff=lfs merge=lfs -text
4
+ .venv/lib/python3.13/site-packages/81d243bd2c585b0f4821__mypyc.cpython-313-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
5
+ .venv/lib/python3.13/site-packages/click/__pycache__/core.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
6
+ .venv/lib/python3.13/site-packages/idna/__pycache__/idnadata.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
7
+ .venv/lib/python3.13/site-packages/idna/__pycache__/uts46data.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
8
+ .venv/lib/python3.13/site-packages/jinja2/__pycache__/compiler.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
9
+ .venv/lib/python3.13/site-packages/pip/_vendor/distlib/t64-arm.exe filter=lfs diff=lfs merge=lfs -text
10
+ .venv/lib/python3.13/site-packages/pip/_vendor/distlib/t64.exe filter=lfs diff=lfs merge=lfs -text
11
+ .venv/lib/python3.13/site-packages/pip/_vendor/distlib/w64-arm.exe filter=lfs diff=lfs merge=lfs -text
12
+ .venv/lib/python3.13/site-packages/pip/_vendor/distlib/w64.exe filter=lfs diff=lfs merge=lfs -text
13
+ .venv/lib/python3.13/site-packages/pip/_vendor/idna/__pycache__/idnadata.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
14
+ .venv/lib/python3.13/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
15
+ .venv/lib/python3.13/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
16
+ .venv/lib/python3.13/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
17
+ .venv/lib/python3.13/site-packages/pip/_vendor/rich/__pycache__/console.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
18
+ .venv/lib64/python3.13/site-packages/81d243bd2c585b0f4821__mypyc.cpython-313-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
19
+ .venv/lib64/python3.13/site-packages/click/__pycache__/core.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
20
+ .venv/lib64/python3.13/site-packages/idna/__pycache__/idnadata.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
21
+ .venv/lib64/python3.13/site-packages/idna/__pycache__/uts46data.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
22
+ .venv/lib64/python3.13/site-packages/jinja2/__pycache__/compiler.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
23
+ .venv/lib64/python3.13/site-packages/pip/_vendor/distlib/t64-arm.exe filter=lfs diff=lfs merge=lfs -text
24
+ .venv/lib64/python3.13/site-packages/pip/_vendor/distlib/t64.exe filter=lfs diff=lfs merge=lfs -text
25
+ .venv/lib64/python3.13/site-packages/pip/_vendor/distlib/w64-arm.exe filter=lfs diff=lfs merge=lfs -text
26
+ .venv/lib64/python3.13/site-packages/pip/_vendor/distlib/w64.exe filter=lfs diff=lfs merge=lfs -text
27
+ .venv/lib64/python3.13/site-packages/pip/_vendor/idna/__pycache__/idnadata.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
28
+ .venv/lib64/python3.13/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
29
+ .venv/lib64/python3.13/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
30
+ .venv/lib64/python3.13/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
31
+ .venv/lib64/python3.13/site-packages/pip/_vendor/rich/__pycache__/console.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
.venv/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ # Created by venv; see https://docs.python.org/3/library/venv.html
2
+ *
.venv/bin/Activate.ps1 ADDED
@@ -0,0 +1,248 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <#
2
+ .Synopsis
3
+ Activate a Python virtual environment for the current PowerShell session.
4
+
5
+ .Description
6
+ Pushes the python executable for a virtual environment to the front of the
7
+ $Env:PATH environment variable and sets the prompt to signify that you are
8
+ in a Python virtual environment. Makes use of the command line switches as
9
+ well as the `pyvenv.cfg` file values present in the virtual environment.
10
+
11
+ .Parameter VenvDir
12
+ Path to the directory that contains the virtual environment to activate. The
13
+ default value for this is the parent of the directory that the Activate.ps1
14
+ script is located within.
15
+
16
+ .Parameter Prompt
17
+ The prompt prefix to display when this virtual environment is activated. By
18
+ default, this prompt is the name of the virtual environment folder (VenvDir)
19
+ surrounded by parentheses and followed by a single space (ie. '(.venv) ').
20
+
21
+ .Example
22
+ Activate.ps1
23
+ Activates the Python virtual environment that contains the Activate.ps1 script.
24
+
25
+ .Example
26
+ Activate.ps1 -Verbose
27
+ Activates the Python virtual environment that contains the Activate.ps1 script,
28
+ and shows extra information about the activation as it executes.
29
+
30
+ .Example
31
+ Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
32
+ Activates the Python virtual environment located in the specified location.
33
+
34
+ .Example
35
+ Activate.ps1 -Prompt "MyPython"
36
+ Activates the Python virtual environment that contains the Activate.ps1 script,
37
+ and prefixes the current prompt with the specified string (surrounded in
38
+ parentheses) while the virtual environment is active.
39
+
40
+ .Notes
41
+ On Windows, it may be required to enable this Activate.ps1 script by setting the
42
+ execution policy for the user. You can do this by issuing the following PowerShell
43
+ command:
44
+
45
+ PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
46
+
47
+ For more information on Execution Policies:
48
+ https://go.microsoft.com/fwlink/?LinkID=135170
49
+
50
+ #>
51
+ Param(
52
+ [Parameter(Mandatory = $false)]
53
+ [String]
54
+ $VenvDir,
55
+ [Parameter(Mandatory = $false)]
56
+ [String]
57
+ $Prompt
58
+ )
59
+
60
+ <# Function declarations --------------------------------------------------- #>
61
+
62
+ <#
63
+ .Synopsis
64
+ Remove all shell session elements added by the Activate script, including the
65
+ addition of the virtual environment's Python executable from the beginning of
66
+ the PATH variable.
67
+
68
+ .Parameter NonDestructive
69
+ If present, do not remove this function from the global namespace for the
70
+ session.
71
+
72
+ #>
73
+ function global:deactivate ([switch]$NonDestructive) {
74
+ # Revert to original values
75
+
76
+ # The prior prompt:
77
+ if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
78
+ Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
79
+ Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
80
+ }
81
+
82
+ # The prior PYTHONHOME:
83
+ if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
84
+ Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
85
+ Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
86
+ }
87
+
88
+ # The prior PATH:
89
+ if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
90
+ Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
91
+ Remove-Item -Path Env:_OLD_VIRTUAL_PATH
92
+ }
93
+
94
+ # Just remove the VIRTUAL_ENV altogether:
95
+ if (Test-Path -Path Env:VIRTUAL_ENV) {
96
+ Remove-Item -Path env:VIRTUAL_ENV
97
+ }
98
+
99
+ # Just remove VIRTUAL_ENV_PROMPT altogether.
100
+ if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) {
101
+ Remove-Item -Path env:VIRTUAL_ENV_PROMPT
102
+ }
103
+
104
+ # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
105
+ if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
106
+ Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
107
+ }
108
+
109
+ # Leave deactivate function in the global namespace if requested:
110
+ if (-not $NonDestructive) {
111
+ Remove-Item -Path function:deactivate
112
+ }
113
+ }
114
+
115
+ <#
116
+ .Description
117
+ Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
118
+ given folder, and returns them in a map.
119
+
120
+ For each line in the pyvenv.cfg file, if that line can be parsed into exactly
121
+ two strings separated by `=` (with any amount of whitespace surrounding the =)
122
+ then it is considered a `key = value` line. The left hand string is the key,
123
+ the right hand is the value.
124
+
125
+ If the value starts with a `'` or a `"` then the first and last character is
126
+ stripped from the value before being captured.
127
+
128
+ .Parameter ConfigDir
129
+ Path to the directory that contains the `pyvenv.cfg` file.
130
+ #>
131
+ function Get-PyVenvConfig(
132
+ [String]
133
+ $ConfigDir
134
+ ) {
135
+ Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
136
+
137
+ # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
138
+ $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
139
+
140
+ # An empty map will be returned if no config file is found.
141
+ $pyvenvConfig = @{ }
142
+
143
+ if ($pyvenvConfigPath) {
144
+
145
+ Write-Verbose "File exists, parse `key = value` lines"
146
+ $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
147
+
148
+ $pyvenvConfigContent | ForEach-Object {
149
+ $keyval = $PSItem -split "\s*=\s*", 2
150
+ if ($keyval[0] -and $keyval[1]) {
151
+ $val = $keyval[1]
152
+
153
+ # Remove extraneous quotations around a string value.
154
+ if ("'""".Contains($val.Substring(0, 1))) {
155
+ $val = $val.Substring(1, $val.Length - 2)
156
+ }
157
+
158
+ $pyvenvConfig[$keyval[0]] = $val
159
+ Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
160
+ }
161
+ }
162
+ }
163
+ return $pyvenvConfig
164
+ }
165
+
166
+
167
+ <# Begin Activate script --------------------------------------------------- #>
168
+
169
+ # Determine the containing directory of this script
170
+ $VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
171
+ $VenvExecDir = Get-Item -Path $VenvExecPath
172
+
173
+ Write-Verbose "Activation script is located in path: '$VenvExecPath'"
174
+ Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
175
+ Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
176
+
177
+ # Set values required in priority: CmdLine, ConfigFile, Default
178
+ # First, get the location of the virtual environment, it might not be
179
+ # VenvExecDir if specified on the command line.
180
+ if ($VenvDir) {
181
+ Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
182
+ }
183
+ else {
184
+ Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
185
+ $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
186
+ Write-Verbose "VenvDir=$VenvDir"
187
+ }
188
+
189
+ # Next, read the `pyvenv.cfg` file to determine any required value such
190
+ # as `prompt`.
191
+ $pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
192
+
193
+ # Next, set the prompt from the command line, or the config file, or
194
+ # just use the name of the virtual environment folder.
195
+ if ($Prompt) {
196
+ Write-Verbose "Prompt specified as argument, using '$Prompt'"
197
+ }
198
+ else {
199
+ Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
200
+ if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
201
+ Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
202
+ $Prompt = $pyvenvCfg['prompt'];
203
+ }
204
+ else {
205
+ Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)"
206
+ Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
207
+ $Prompt = Split-Path -Path $venvDir -Leaf
208
+ }
209
+ }
210
+
211
+ Write-Verbose "Prompt = '$Prompt'"
212
+ Write-Verbose "VenvDir='$VenvDir'"
213
+
214
+ # Deactivate any currently active virtual environment, but leave the
215
+ # deactivate function in place.
216
+ deactivate -nondestructive
217
+
218
+ # Now set the environment variable VIRTUAL_ENV, used by many tools to determine
219
+ # that there is an activated venv.
220
+ $env:VIRTUAL_ENV = $VenvDir
221
+
222
+ $env:VIRTUAL_ENV_PROMPT = $Prompt
223
+
224
+ if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
225
+
226
+ Write-Verbose "Setting prompt to '$Prompt'"
227
+
228
+ # Set the prompt to include the env name
229
+ # Make sure _OLD_VIRTUAL_PROMPT is global
230
+ function global:_OLD_VIRTUAL_PROMPT { "" }
231
+ Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
232
+ New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
233
+
234
+ function global:prompt {
235
+ Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
236
+ _OLD_VIRTUAL_PROMPT
237
+ }
238
+ }
239
+
240
+ # Clear PYTHONHOME
241
+ if (Test-Path -Path Env:PYTHONHOME) {
242
+ Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
243
+ Remove-Item -Path Env:PYTHONHOME
244
+ }
245
+
246
+ # Add the venv to the PATH
247
+ Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
248
+ $Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"
.venv/bin/activate ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file must be used with "source bin/activate" *from bash*
2
+ # You cannot run it directly
3
+
4
+ deactivate () {
5
+ # reset old environment variables
6
+ if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
7
+ PATH="${_OLD_VIRTUAL_PATH:-}"
8
+ export PATH
9
+ unset _OLD_VIRTUAL_PATH
10
+ fi
11
+ if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
12
+ PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
13
+ export PYTHONHOME
14
+ unset _OLD_VIRTUAL_PYTHONHOME
15
+ fi
16
+
17
+ # Call hash to forget past locations. Without forgetting
18
+ # past locations the $PATH changes we made may not be respected.
19
+ # See "man bash" for more details. hash is usually a builtin of your shell
20
+ hash -r 2> /dev/null
21
+
22
+ if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
23
+ PS1="${_OLD_VIRTUAL_PS1:-}"
24
+ export PS1
25
+ unset _OLD_VIRTUAL_PS1
26
+ fi
27
+
28
+ unset VIRTUAL_ENV
29
+ unset VIRTUAL_ENV_PROMPT
30
+ if [ ! "${1:-}" = "nondestructive" ] ; then
31
+ # Self destruct!
32
+ unset -f deactivate
33
+ fi
34
+ }
35
+
36
+ # unset irrelevant variables
37
+ deactivate nondestructive
38
+
39
+ # on Windows, a path can contain colons and backslashes and has to be converted:
40
+ case "$(uname)" in
41
+ CYGWIN*|MSYS*|MINGW*)
42
+ # transform D:\path\to\venv to /d/path/to/venv on MSYS and MINGW
43
+ # and to /cygdrive/d/path/to/venv on Cygwin
44
+ VIRTUAL_ENV=$(cygpath /mnt/data/rita2api-hf-space/.venv)
45
+ export VIRTUAL_ENV
46
+ ;;
47
+ *)
48
+ # use the path as-is
49
+ export VIRTUAL_ENV=/mnt/data/rita2api-hf-space/.venv
50
+ ;;
51
+ esac
52
+
53
+ _OLD_VIRTUAL_PATH="$PATH"
54
+ PATH="$VIRTUAL_ENV/"bin":$PATH"
55
+ export PATH
56
+
57
+ VIRTUAL_ENV_PROMPT=.venv
58
+ export VIRTUAL_ENV_PROMPT
59
+
60
+ # unset PYTHONHOME if set
61
+ # this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
62
+ # could use `if (set -u; : $PYTHONHOME) ;` in bash
63
+ if [ -n "${PYTHONHOME:-}" ] ; then
64
+ _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
65
+ unset PYTHONHOME
66
+ fi
67
+
68
+ if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
69
+ _OLD_VIRTUAL_PS1="${PS1:-}"
70
+ PS1="(".venv") ${PS1:-}"
71
+ export PS1
72
+ fi
73
+
74
+ # Call hash to forget past commands. Without forgetting
75
+ # past commands the $PATH changes we made may not be respected
76
+ hash -r 2> /dev/null
.venv/bin/activate.csh ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file must be used with "source bin/activate.csh" *from csh*.
2
+ # You cannot run it directly.
3
+
4
+ # Created by Davide Di Blasi <davidedb@gmail.com>.
5
+ # Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
6
+
7
+ alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate'
8
+
9
+ # Unset irrelevant variables.
10
+ deactivate nondestructive
11
+
12
+ setenv VIRTUAL_ENV /mnt/data/rita2api-hf-space/.venv
13
+
14
+ set _OLD_VIRTUAL_PATH="$PATH"
15
+ setenv PATH "$VIRTUAL_ENV/"bin":$PATH"
16
+ setenv VIRTUAL_ENV_PROMPT .venv
17
+
18
+
19
+ set _OLD_VIRTUAL_PROMPT="$prompt"
20
+
21
+ if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
22
+ set prompt = "(".venv") $prompt:q"
23
+ endif
24
+
25
+ alias pydoc python -m pydoc
26
+
27
+ rehash
.venv/bin/activate.fish ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file must be used with "source <venv>/bin/activate.fish" *from fish*
2
+ # (https://fishshell.com/). You cannot run it directly.
3
+
4
+ function deactivate -d "Exit virtual environment and return to normal shell environment"
5
+ # reset old environment variables
6
+ if test -n "$_OLD_VIRTUAL_PATH"
7
+ set -gx PATH $_OLD_VIRTUAL_PATH
8
+ set -e _OLD_VIRTUAL_PATH
9
+ end
10
+ if test -n "$_OLD_VIRTUAL_PYTHONHOME"
11
+ set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
12
+ set -e _OLD_VIRTUAL_PYTHONHOME
13
+ end
14
+
15
+ if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
16
+ set -e _OLD_FISH_PROMPT_OVERRIDE
17
+ # prevents error when using nested fish instances (Issue #93858)
18
+ if functions -q _old_fish_prompt
19
+ functions -e fish_prompt
20
+ functions -c _old_fish_prompt fish_prompt
21
+ functions -e _old_fish_prompt
22
+ end
23
+ end
24
+
25
+ set -e VIRTUAL_ENV
26
+ set -e VIRTUAL_ENV_PROMPT
27
+ if test "$argv[1]" != "nondestructive"
28
+ # Self-destruct!
29
+ functions -e deactivate
30
+ end
31
+ end
32
+
33
+ # Unset irrelevant variables.
34
+ deactivate nondestructive
35
+
36
+ set -gx VIRTUAL_ENV /mnt/data/rita2api-hf-space/.venv
37
+
38
+ set -gx _OLD_VIRTUAL_PATH $PATH
39
+ set -gx PATH "$VIRTUAL_ENV/"bin $PATH
40
+ set -gx VIRTUAL_ENV_PROMPT .venv
41
+
42
+ # Unset PYTHONHOME if set.
43
+ if set -q PYTHONHOME
44
+ set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
45
+ set -e PYTHONHOME
46
+ end
47
+
48
+ if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
49
+ # fish uses a function instead of an env var to generate the prompt.
50
+
51
+ # Save the current fish_prompt function as the function _old_fish_prompt.
52
+ functions -c fish_prompt _old_fish_prompt
53
+
54
+ # With the original prompt function renamed, we can override with our own.
55
+ function fish_prompt
56
+ # Save the return status of the last command.
57
+ set -l old_status $status
58
+
59
+ # Output the venv prompt; color taken from the blue of the Python logo.
60
+ printf "%s(%s)%s " (set_color 4B8BBE) .venv (set_color normal)
61
+
62
+ # Restore the return status of the previous command.
63
+ echo "exit $old_status" | .
64
+ # Output the original/"old" prompt.
65
+ _old_fish_prompt
66
+ end
67
+
68
+ set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
69
+ end
.venv/bin/dotenv ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ #!/mnt/data/rita2api-hf-space/.venv/bin/python
2
+ import sys
3
+ from dotenv.__main__ import cli
4
+ if __name__ == '__main__':
5
+ sys.argv[0] = sys.argv[0].removesuffix('.exe')
6
+ sys.exit(cli())
.venv/bin/flask ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ #!/mnt/data/rita2api-hf-space/.venv/bin/python
2
+ import sys
3
+ from flask.cli import main
4
+ if __name__ == '__main__':
5
+ sys.argv[0] = sys.argv[0].removesuffix('.exe')
6
+ sys.exit(main())
.venv/bin/normalizer ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ #!/mnt/data/rita2api-hf-space/.venv/bin/python
2
+ import sys
3
+ from charset_normalizer.cli import cli_detect
4
+ if __name__ == '__main__':
5
+ sys.argv[0] = sys.argv[0].removesuffix('.exe')
6
+ sys.exit(cli_detect())
.venv/bin/pip ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ #!/mnt/data/rita2api-hf-space/.venv/bin/python
2
+ # -*- coding: utf-8 -*-
3
+ import re
4
+ import sys
5
+ from pip._internal.cli.main import main
6
+ if __name__ == '__main__':
7
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8
+ sys.exit(main())
.venv/bin/pip3 ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ #!/mnt/data/rita2api-hf-space/.venv/bin/python
2
+ # -*- coding: utf-8 -*-
3
+ import re
4
+ import sys
5
+ from pip._internal.cli.main import main
6
+ if __name__ == '__main__':
7
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8
+ sys.exit(main())
.venv/bin/pip3.13 ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ #!/mnt/data/rita2api-hf-space/.venv/bin/python
2
+ # -*- coding: utf-8 -*-
3
+ import re
4
+ import sys
5
+ from pip._internal.cli.main import main
6
+ if __name__ == '__main__':
7
+ sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
8
+ sys.exit(main())
.venv/bin/python ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e59d0124ff06c248546876e01fcfb1ea3cda63534949f94a9372bfcfe3bfc3f5
3
+ size 6828688
.venv/bin/python3 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e59d0124ff06c248546876e01fcfb1ea3cda63534949f94a9372bfcfe3bfc3f5
3
+ size 6828688
.venv/bin/python3.13 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e59d0124ff06c248546876e01fcfb1ea3cda63534949f94a9372bfcfe3bfc3f5
3
+ size 6828688
.venv/bin/waitress-serve ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ #!/mnt/data/rita2api-hf-space/.venv/bin/python
2
+ import sys
3
+ from waitress.runner import run
4
+ if __name__ == '__main__':
5
+ sys.argv[0] = sys.argv[0].removesuffix('.exe')
6
+ sys.exit(run())
.venv/lib/python3.13/site-packages/81d243bd2c585b0f4821__mypyc.cpython-313-x86_64-linux-gnu.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f08163cc76575057bf52e8b1c3a2b0a0048a158a1343e570670fe7115e3db113
3
+ size 433440
.venv/lib/python3.13/site-packages/blinker-1.9.0.dist-info/INSTALLER ADDED
@@ -0,0 +1 @@
 
 
1
+ pip
.venv/lib/python3.13/site-packages/blinker-1.9.0.dist-info/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright 2010 Jason Kirtland
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a
4
+ copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included
12
+ in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.venv/lib/python3.13/site-packages/blinker-1.9.0.dist-info/METADATA ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.3
2
+ Name: blinker
3
+ Version: 1.9.0
4
+ Summary: Fast, simple object-to-object and broadcast signaling
5
+ Author: Jason Kirtland
6
+ Maintainer-email: Pallets Ecosystem <contact@palletsprojects.com>
7
+ Requires-Python: >=3.9
8
+ Description-Content-Type: text/markdown
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python
12
+ Classifier: Typing :: Typed
13
+ Project-URL: Chat, https://discord.gg/pallets
14
+ Project-URL: Documentation, https://blinker.readthedocs.io
15
+ Project-URL: Source, https://github.com/pallets-eco/blinker/
16
+
17
+ # Blinker
18
+
19
+ Blinker provides a fast dispatching system that allows any number of
20
+ interested parties to subscribe to events, or "signals".
21
+
22
+
23
+ ## Pallets Community Ecosystem
24
+
25
+ > [!IMPORTANT]\
26
+ > This project is part of the Pallets Community Ecosystem. Pallets is the open
27
+ > source organization that maintains Flask; Pallets-Eco enables community
28
+ > maintenance of related projects. If you are interested in helping maintain
29
+ > this project, please reach out on [the Pallets Discord server][discord].
30
+ >
31
+ > [discord]: https://discord.gg/pallets
32
+
33
+
34
+ ## Example
35
+
36
+ Signal receivers can subscribe to specific senders or receive signals
37
+ sent by any sender.
38
+
39
+ ```pycon
40
+ >>> from blinker import signal
41
+ >>> started = signal('round-started')
42
+ >>> def each(round):
43
+ ... print(f"Round {round}")
44
+ ...
45
+ >>> started.connect(each)
46
+
47
+ >>> def round_two(round):
48
+ ... print("This is round two.")
49
+ ...
50
+ >>> started.connect(round_two, sender=2)
51
+
52
+ >>> for round in range(1, 4):
53
+ ... started.send(round)
54
+ ...
55
+ Round 1!
56
+ Round 2!
57
+ This is round two.
58
+ Round 3!
59
+ ```
60
+
.venv/lib/python3.13/site-packages/blinker-1.9.0.dist-info/RECORD ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ blinker-1.9.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2
+ blinker-1.9.0.dist-info/LICENSE.txt,sha256=nrc6HzhZekqhcCXSrhvjg5Ykx5XphdTw6Xac4p-spGc,1054
3
+ blinker-1.9.0.dist-info/METADATA,sha256=uIRiM8wjjbHkCtbCyTvctU37IAZk0kEe5kxAld1dvzA,1633
4
+ blinker-1.9.0.dist-info/RECORD,,
5
+ blinker-1.9.0.dist-info/WHEEL,sha256=CpUCUxeHQbRN5UGRQHYRJorO5Af-Qy_fHMctcQ8DSGI,82
6
+ blinker/__init__.py,sha256=I2EdZqpy4LyjX17Hn1yzJGWCjeLaVaPzsMgHkLfj_cQ,317
7
+ blinker/__pycache__/__init__.cpython-313.pyc,,
8
+ blinker/__pycache__/_utilities.cpython-313.pyc,,
9
+ blinker/__pycache__/base.cpython-313.pyc,,
10
+ blinker/_utilities.py,sha256=0J7eeXXTUx0Ivf8asfpx0ycVkp0Eqfqnj117x2mYX9E,1675
11
+ blinker/base.py,sha256=QpDuvXXcwJF49lUBcH5BiST46Rz9wSG7VW_p7N_027M,19132
12
+ blinker/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
.venv/lib/python3.13/site-packages/blinker-1.9.0.dist-info/WHEEL ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ Wheel-Version: 1.0
2
+ Generator: flit 3.10.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
.venv/lib/python3.13/site-packages/blinker/__init__.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ from .base import ANY
4
+ from .base import default_namespace
5
+ from .base import NamedSignal
6
+ from .base import Namespace
7
+ from .base import Signal
8
+ from .base import signal
9
+
10
+ __all__ = [
11
+ "ANY",
12
+ "default_namespace",
13
+ "NamedSignal",
14
+ "Namespace",
15
+ "Signal",
16
+ "signal",
17
+ ]
.venv/lib/python3.13/site-packages/blinker/__pycache__/__init__.cpython-313.pyc ADDED
Binary file (491 Bytes). View file
 
.venv/lib/python3.13/site-packages/blinker/__pycache__/_utilities.cpython-313.pyc ADDED
Binary file (2.79 kB). View file
 
.venv/lib/python3.13/site-packages/blinker/__pycache__/base.cpython-313.pyc ADDED
Binary file (21.3 kB). View file
 
.venv/lib/python3.13/site-packages/blinker/_utilities.py ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import collections.abc as c
4
+ import inspect
5
+ import typing as t
6
+ from weakref import ref
7
+ from weakref import WeakMethod
8
+
9
+ T = t.TypeVar("T")
10
+
11
+
12
+ class Symbol:
13
+ """A constant symbol, nicer than ``object()``. Repeated calls return the
14
+ same instance.
15
+
16
+ >>> Symbol('foo') is Symbol('foo')
17
+ True
18
+ >>> Symbol('foo')
19
+ foo
20
+ """
21
+
22
+ symbols: t.ClassVar[dict[str, Symbol]] = {}
23
+
24
+ def __new__(cls, name: str) -> Symbol:
25
+ if name in cls.symbols:
26
+ return cls.symbols[name]
27
+
28
+ obj = super().__new__(cls)
29
+ cls.symbols[name] = obj
30
+ return obj
31
+
32
+ def __init__(self, name: str) -> None:
33
+ self.name = name
34
+
35
+ def __repr__(self) -> str:
36
+ return self.name
37
+
38
+ def __getnewargs__(self) -> tuple[t.Any, ...]:
39
+ return (self.name,)
40
+
41
+
42
+ def make_id(obj: object) -> c.Hashable:
43
+ """Get a stable identifier for a receiver or sender, to be used as a dict
44
+ key or in a set.
45
+ """
46
+ if inspect.ismethod(obj):
47
+ # The id of a bound method is not stable, but the id of the unbound
48
+ # function and instance are.
49
+ return id(obj.__func__), id(obj.__self__)
50
+
51
+ if isinstance(obj, (str, int)):
52
+ # Instances with the same value always compare equal and have the same
53
+ # hash, even if the id may change.
54
+ return obj
55
+
56
+ # Assume other types are not hashable but will always be the same instance.
57
+ return id(obj)
58
+
59
+
60
+ def make_ref(obj: T, callback: c.Callable[[ref[T]], None] | None = None) -> ref[T]:
61
+ if inspect.ismethod(obj):
62
+ return WeakMethod(obj, callback) # type: ignore[arg-type, return-value]
63
+
64
+ return ref(obj, callback)
.venv/lib/python3.13/site-packages/blinker/base.py ADDED
@@ -0,0 +1,512 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import collections.abc as c
4
+ import sys
5
+ import typing as t
6
+ import weakref
7
+ from collections import defaultdict
8
+ from contextlib import contextmanager
9
+ from functools import cached_property
10
+ from inspect import iscoroutinefunction
11
+
12
+ from ._utilities import make_id
13
+ from ._utilities import make_ref
14
+ from ._utilities import Symbol
15
+
16
+ F = t.TypeVar("F", bound=c.Callable[..., t.Any])
17
+
18
+ ANY = Symbol("ANY")
19
+ """Symbol for "any sender"."""
20
+
21
+ ANY_ID = 0
22
+
23
+
24
+ class Signal:
25
+ """A notification emitter.
26
+
27
+ :param doc: The docstring for the signal.
28
+ """
29
+
30
+ ANY = ANY
31
+ """An alias for the :data:`~blinker.ANY` sender symbol."""
32
+
33
+ set_class: type[set[t.Any]] = set
34
+ """The set class to use for tracking connected receivers and senders.
35
+ Python's ``set`` is unordered. If receivers must be dispatched in the order
36
+ they were connected, an ordered set implementation can be used.
37
+
38
+ .. versionadded:: 1.7
39
+ """
40
+
41
+ @cached_property
42
+ def receiver_connected(self) -> Signal:
43
+ """Emitted at the end of each :meth:`connect` call.
44
+
45
+ The signal sender is the signal instance, and the :meth:`connect`
46
+ arguments are passed through: ``receiver``, ``sender``, and ``weak``.
47
+
48
+ .. versionadded:: 1.2
49
+ """
50
+ return Signal(doc="Emitted after a receiver connects.")
51
+
52
+ @cached_property
53
+ def receiver_disconnected(self) -> Signal:
54
+ """Emitted at the end of each :meth:`disconnect` call.
55
+
56
+ The sender is the signal instance, and the :meth:`disconnect` arguments
57
+ are passed through: ``receiver`` and ``sender``.
58
+
59
+ This signal is emitted **only** when :meth:`disconnect` is called
60
+ explicitly. This signal cannot be emitted by an automatic disconnect
61
+ when a weakly referenced receiver or sender goes out of scope, as the
62
+ instance is no longer be available to be used as the sender for this
63
+ signal.
64
+
65
+ An alternative approach is available by subscribing to
66
+ :attr:`receiver_connected` and setting up a custom weakref cleanup
67
+ callback on weak receivers and senders.
68
+
69
+ .. versionadded:: 1.2
70
+ """
71
+ return Signal(doc="Emitted after a receiver disconnects.")
72
+
73
+ def __init__(self, doc: str | None = None) -> None:
74
+ if doc:
75
+ self.__doc__ = doc
76
+
77
+ self.receivers: dict[
78
+ t.Any, weakref.ref[c.Callable[..., t.Any]] | c.Callable[..., t.Any]
79
+ ] = {}
80
+ """The map of connected receivers. Useful to quickly check if any
81
+ receivers are connected to the signal: ``if s.receivers:``. The
82
+ structure and data is not part of the public API, but checking its
83
+ boolean value is.
84
+ """
85
+
86
+ self.is_muted: bool = False
87
+ self._by_receiver: dict[t.Any, set[t.Any]] = defaultdict(self.set_class)
88
+ self._by_sender: dict[t.Any, set[t.Any]] = defaultdict(self.set_class)
89
+ self._weak_senders: dict[t.Any, weakref.ref[t.Any]] = {}
90
+
91
+ def connect(self, receiver: F, sender: t.Any = ANY, weak: bool = True) -> F:
92
+ """Connect ``receiver`` to be called when the signal is sent by
93
+ ``sender``.
94
+
95
+ :param receiver: The callable to call when :meth:`send` is called with
96
+ the given ``sender``, passing ``sender`` as a positional argument
97
+ along with any extra keyword arguments.
98
+ :param sender: Any object or :data:`ANY`. ``receiver`` will only be
99
+ called when :meth:`send` is called with this sender. If ``ANY``, the
100
+ receiver will be called for any sender. A receiver may be connected
101
+ to multiple senders by calling :meth:`connect` multiple times.
102
+ :param weak: Track the receiver with a :mod:`weakref`. The receiver will
103
+ be automatically disconnected when it is garbage collected. When
104
+ connecting a receiver defined within a function, set to ``False``,
105
+ otherwise it will be disconnected when the function scope ends.
106
+ """
107
+ receiver_id = make_id(receiver)
108
+ sender_id = ANY_ID if sender is ANY else make_id(sender)
109
+
110
+ if weak:
111
+ self.receivers[receiver_id] = make_ref(
112
+ receiver, self._make_cleanup_receiver(receiver_id)
113
+ )
114
+ else:
115
+ self.receivers[receiver_id] = receiver
116
+
117
+ self._by_sender[sender_id].add(receiver_id)
118
+ self._by_receiver[receiver_id].add(sender_id)
119
+
120
+ if sender is not ANY and sender_id not in self._weak_senders:
121
+ # store a cleanup for weakref-able senders
122
+ try:
123
+ self._weak_senders[sender_id] = make_ref(
124
+ sender, self._make_cleanup_sender(sender_id)
125
+ )
126
+ except TypeError:
127
+ pass
128
+
129
+ if "receiver_connected" in self.__dict__ and self.receiver_connected.receivers:
130
+ try:
131
+ self.receiver_connected.send(
132
+ self, receiver=receiver, sender=sender, weak=weak
133
+ )
134
+ except TypeError:
135
+ # TODO no explanation or test for this
136
+ self.disconnect(receiver, sender)
137
+ raise
138
+
139
+ return receiver
140
+
141
+ def connect_via(self, sender: t.Any, weak: bool = False) -> c.Callable[[F], F]:
142
+ """Connect the decorated function to be called when the signal is sent
143
+ by ``sender``.
144
+
145
+ The decorated function will be called when :meth:`send` is called with
146
+ the given ``sender``, passing ``sender`` as a positional argument along
147
+ with any extra keyword arguments.
148
+
149
+ :param sender: Any object or :data:`ANY`. ``receiver`` will only be
150
+ called when :meth:`send` is called with this sender. If ``ANY``, the
151
+ receiver will be called for any sender. A receiver may be connected
152
+ to multiple senders by calling :meth:`connect` multiple times.
153
+ :param weak: Track the receiver with a :mod:`weakref`. The receiver will
154
+ be automatically disconnected when it is garbage collected. When
155
+ connecting a receiver defined within a function, set to ``False``,
156
+ otherwise it will be disconnected when the function scope ends.=
157
+
158
+ .. versionadded:: 1.1
159
+ """
160
+
161
+ def decorator(fn: F) -> F:
162
+ self.connect(fn, sender, weak)
163
+ return fn
164
+
165
+ return decorator
166
+
167
+ @contextmanager
168
+ def connected_to(
169
+ self, receiver: c.Callable[..., t.Any], sender: t.Any = ANY
170
+ ) -> c.Generator[None, None, None]:
171
+ """A context manager that temporarily connects ``receiver`` to the
172
+ signal while a ``with`` block executes. When the block exits, the
173
+ receiver is disconnected. Useful for tests.
174
+
175
+ :param receiver: The callable to call when :meth:`send` is called with
176
+ the given ``sender``, passing ``sender`` as a positional argument
177
+ along with any extra keyword arguments.
178
+ :param sender: Any object or :data:`ANY`. ``receiver`` will only be
179
+ called when :meth:`send` is called with this sender. If ``ANY``, the
180
+ receiver will be called for any sender.
181
+
182
+ .. versionadded:: 1.1
183
+ """
184
+ self.connect(receiver, sender=sender, weak=False)
185
+
186
+ try:
187
+ yield None
188
+ finally:
189
+ self.disconnect(receiver)
190
+
191
+ @contextmanager
192
+ def muted(self) -> c.Generator[None, None, None]:
193
+ """A context manager that temporarily disables the signal. No receivers
194
+ will be called if the signal is sent, until the ``with`` block exits.
195
+ Useful for tests.
196
+ """
197
+ self.is_muted = True
198
+
199
+ try:
200
+ yield None
201
+ finally:
202
+ self.is_muted = False
203
+
204
+ def send(
205
+ self,
206
+ sender: t.Any | None = None,
207
+ /,
208
+ *,
209
+ _async_wrapper: c.Callable[
210
+ [c.Callable[..., c.Coroutine[t.Any, t.Any, t.Any]]], c.Callable[..., t.Any]
211
+ ]
212
+ | None = None,
213
+ **kwargs: t.Any,
214
+ ) -> list[tuple[c.Callable[..., t.Any], t.Any]]:
215
+ """Call all receivers that are connected to the given ``sender``
216
+ or :data:`ANY`. Each receiver is called with ``sender`` as a positional
217
+ argument along with any extra keyword arguments. Return a list of
218
+ ``(receiver, return value)`` tuples.
219
+
220
+ The order receivers are called is undefined, but can be influenced by
221
+ setting :attr:`set_class`.
222
+
223
+ If a receiver raises an exception, that exception will propagate up.
224
+ This makes debugging straightforward, with an assumption that correctly
225
+ implemented receivers will not raise.
226
+
227
+ :param sender: Call receivers connected to this sender, in addition to
228
+ those connected to :data:`ANY`.
229
+ :param _async_wrapper: Will be called on any receivers that are async
230
+ coroutines to turn them into sync callables. For example, could run
231
+ the receiver with an event loop.
232
+ :param kwargs: Extra keyword arguments to pass to each receiver.
233
+
234
+ .. versionchanged:: 1.7
235
+ Added the ``_async_wrapper`` argument.
236
+ """
237
+ if self.is_muted:
238
+ return []
239
+
240
+ results = []
241
+
242
+ for receiver in self.receivers_for(sender):
243
+ if iscoroutinefunction(receiver):
244
+ if _async_wrapper is None:
245
+ raise RuntimeError("Cannot send to a coroutine function.")
246
+
247
+ result = _async_wrapper(receiver)(sender, **kwargs)
248
+ else:
249
+ result = receiver(sender, **kwargs)
250
+
251
+ results.append((receiver, result))
252
+
253
+ return results
254
+
255
+ async def send_async(
256
+ self,
257
+ sender: t.Any | None = None,
258
+ /,
259
+ *,
260
+ _sync_wrapper: c.Callable[
261
+ [c.Callable[..., t.Any]], c.Callable[..., c.Coroutine[t.Any, t.Any, t.Any]]
262
+ ]
263
+ | None = None,
264
+ **kwargs: t.Any,
265
+ ) -> list[tuple[c.Callable[..., t.Any], t.Any]]:
266
+ """Await all receivers that are connected to the given ``sender``
267
+ or :data:`ANY`. Each receiver is called with ``sender`` as a positional
268
+ argument along with any extra keyword arguments. Return a list of
269
+ ``(receiver, return value)`` tuples.
270
+
271
+ The order receivers are called is undefined, but can be influenced by
272
+ setting :attr:`set_class`.
273
+
274
+ If a receiver raises an exception, that exception will propagate up.
275
+ This makes debugging straightforward, with an assumption that correctly
276
+ implemented receivers will not raise.
277
+
278
+ :param sender: Call receivers connected to this sender, in addition to
279
+ those connected to :data:`ANY`.
280
+ :param _sync_wrapper: Will be called on any receivers that are sync
281
+ callables to turn them into async coroutines. For example,
282
+ could call the receiver in a thread.
283
+ :param kwargs: Extra keyword arguments to pass to each receiver.
284
+
285
+ .. versionadded:: 1.7
286
+ """
287
+ if self.is_muted:
288
+ return []
289
+
290
+ results = []
291
+
292
+ for receiver in self.receivers_for(sender):
293
+ if not iscoroutinefunction(receiver):
294
+ if _sync_wrapper is None:
295
+ raise RuntimeError("Cannot send to a non-coroutine function.")
296
+
297
+ result = await _sync_wrapper(receiver)(sender, **kwargs)
298
+ else:
299
+ result = await receiver(sender, **kwargs)
300
+
301
+ results.append((receiver, result))
302
+
303
+ return results
304
+
305
+ def has_receivers_for(self, sender: t.Any) -> bool:
306
+ """Check if there is at least one receiver that will be called with the
307
+ given ``sender``. A receiver connected to :data:`ANY` will always be
308
+ called, regardless of sender. Does not check if weakly referenced
309
+ receivers are still live. See :meth:`receivers_for` for a stronger
310
+ search.
311
+
312
+ :param sender: Check for receivers connected to this sender, in addition
313
+ to those connected to :data:`ANY`.
314
+ """
315
+ if not self.receivers:
316
+ return False
317
+
318
+ if self._by_sender[ANY_ID]:
319
+ return True
320
+
321
+ if sender is ANY:
322
+ return False
323
+
324
+ return make_id(sender) in self._by_sender
325
+
326
+ def receivers_for(
327
+ self, sender: t.Any
328
+ ) -> c.Generator[c.Callable[..., t.Any], None, None]:
329
+ """Yield each receiver to be called for ``sender``, in addition to those
330
+ to be called for :data:`ANY`. Weakly referenced receivers that are not
331
+ live will be disconnected and skipped.
332
+
333
+ :param sender: Yield receivers connected to this sender, in addition
334
+ to those connected to :data:`ANY`.
335
+ """
336
+ # TODO: test receivers_for(ANY)
337
+ if not self.receivers:
338
+ return
339
+
340
+ sender_id = make_id(sender)
341
+
342
+ if sender_id in self._by_sender:
343
+ ids = self._by_sender[ANY_ID] | self._by_sender[sender_id]
344
+ else:
345
+ ids = self._by_sender[ANY_ID].copy()
346
+
347
+ for receiver_id in ids:
348
+ receiver = self.receivers.get(receiver_id)
349
+
350
+ if receiver is None:
351
+ continue
352
+
353
+ if isinstance(receiver, weakref.ref):
354
+ strong = receiver()
355
+
356
+ if strong is None:
357
+ self._disconnect(receiver_id, ANY_ID)
358
+ continue
359
+
360
+ yield strong
361
+ else:
362
+ yield receiver
363
+
364
+ def disconnect(self, receiver: c.Callable[..., t.Any], sender: t.Any = ANY) -> None:
365
+ """Disconnect ``receiver`` from being called when the signal is sent by
366
+ ``sender``.
367
+
368
+ :param receiver: A connected receiver callable.
369
+ :param sender: Disconnect from only this sender. By default, disconnect
370
+ from all senders.
371
+ """
372
+ sender_id: c.Hashable
373
+
374
+ if sender is ANY:
375
+ sender_id = ANY_ID
376
+ else:
377
+ sender_id = make_id(sender)
378
+
379
+ receiver_id = make_id(receiver)
380
+ self._disconnect(receiver_id, sender_id)
381
+
382
+ if (
383
+ "receiver_disconnected" in self.__dict__
384
+ and self.receiver_disconnected.receivers
385
+ ):
386
+ self.receiver_disconnected.send(self, receiver=receiver, sender=sender)
387
+
388
+ def _disconnect(self, receiver_id: c.Hashable, sender_id: c.Hashable) -> None:
389
+ if sender_id == ANY_ID:
390
+ if self._by_receiver.pop(receiver_id, None) is not None:
391
+ for bucket in self._by_sender.values():
392
+ bucket.discard(receiver_id)
393
+
394
+ self.receivers.pop(receiver_id, None)
395
+ else:
396
+ self._by_sender[sender_id].discard(receiver_id)
397
+ self._by_receiver[receiver_id].discard(sender_id)
398
+
399
+ def _make_cleanup_receiver(
400
+ self, receiver_id: c.Hashable
401
+ ) -> c.Callable[[weakref.ref[c.Callable[..., t.Any]]], None]:
402
+ """Create a callback function to disconnect a weakly referenced
403
+ receiver when it is garbage collected.
404
+ """
405
+
406
+ def cleanup(ref: weakref.ref[c.Callable[..., t.Any]]) -> None:
407
+ # If the interpreter is shutting down, disconnecting can result in a
408
+ # weird ignored exception. Don't call it in that case.
409
+ if not sys.is_finalizing():
410
+ self._disconnect(receiver_id, ANY_ID)
411
+
412
+ return cleanup
413
+
414
+ def _make_cleanup_sender(
415
+ self, sender_id: c.Hashable
416
+ ) -> c.Callable[[weakref.ref[t.Any]], None]:
417
+ """Create a callback function to disconnect all receivers for a weakly
418
+ referenced sender when it is garbage collected.
419
+ """
420
+ assert sender_id != ANY_ID
421
+
422
+ def cleanup(ref: weakref.ref[t.Any]) -> None:
423
+ self._weak_senders.pop(sender_id, None)
424
+
425
+ for receiver_id in self._by_sender.pop(sender_id, ()):
426
+ self._by_receiver[receiver_id].discard(sender_id)
427
+
428
+ return cleanup
429
+
430
+ def _cleanup_bookkeeping(self) -> None:
431
+ """Prune unused sender/receiver bookkeeping. Not threadsafe.
432
+
433
+ Connecting & disconnecting leaves behind a small amount of bookkeeping
434
+ data. Typical workloads using Blinker, for example in most web apps,
435
+ Flask, CLI scripts, etc., are not adversely affected by this
436
+ bookkeeping.
437
+
438
+ With a long-running process performing dynamic signal routing with high
439
+ volume, e.g. connecting to function closures, senders are all unique
440
+ object instances. Doing all of this over and over may cause memory usage
441
+ to grow due to extraneous bookkeeping. (An empty ``set`` for each stale
442
+ sender/receiver pair.)
443
+
444
+ This method will prune that bookkeeping away, with the caveat that such
445
+ pruning is not threadsafe. The risk is that cleanup of a fully
446
+ disconnected receiver/sender pair occurs while another thread is
447
+ connecting that same pair. If you are in the highly dynamic, unique
448
+ receiver/sender situation that has lead you to this method, that failure
449
+ mode is perhaps not a big deal for you.
450
+ """
451
+ for mapping in (self._by_sender, self._by_receiver):
452
+ for ident, bucket in list(mapping.items()):
453
+ if not bucket:
454
+ mapping.pop(ident, None)
455
+
456
+ def _clear_state(self) -> None:
457
+ """Disconnect all receivers and senders. Useful for tests."""
458
+ self._weak_senders.clear()
459
+ self.receivers.clear()
460
+ self._by_sender.clear()
461
+ self._by_receiver.clear()
462
+
463
+
464
+ class NamedSignal(Signal):
465
+ """A named generic notification emitter. The name is not used by the signal
466
+ itself, but matches the key in the :class:`Namespace` that it belongs to.
467
+
468
+ :param name: The name of the signal within the namespace.
469
+ :param doc: The docstring for the signal.
470
+ """
471
+
472
+ def __init__(self, name: str, doc: str | None = None) -> None:
473
+ super().__init__(doc)
474
+
475
+ #: The name of this signal.
476
+ self.name: str = name
477
+
478
+ def __repr__(self) -> str:
479
+ base = super().__repr__()
480
+ return f"{base[:-1]}; {self.name!r}>" # noqa: E702
481
+
482
+
483
+ class Namespace(dict[str, NamedSignal]):
484
+ """A dict mapping names to signals."""
485
+
486
+ def signal(self, name: str, doc: str | None = None) -> NamedSignal:
487
+ """Return the :class:`NamedSignal` for the given ``name``, creating it
488
+ if required. Repeated calls with the same name return the same signal.
489
+
490
+ :param name: The name of the signal.
491
+ :param doc: The docstring of the signal.
492
+ """
493
+ if name not in self:
494
+ self[name] = NamedSignal(name, doc)
495
+
496
+ return self[name]
497
+
498
+
499
+ class _PNamespaceSignal(t.Protocol):
500
+ def __call__(self, name: str, doc: str | None = None) -> NamedSignal: ...
501
+
502
+
503
+ default_namespace: Namespace = Namespace()
504
+ """A default :class:`Namespace` for creating named signals. :func:`signal`
505
+ creates a :class:`NamedSignal` in this namespace.
506
+ """
507
+
508
+ signal: _PNamespaceSignal = default_namespace.signal
509
+ """Return a :class:`NamedSignal` in :data:`default_namespace` with the given
510
+ ``name``, creating it if required. Repeated calls with the same name return the
511
+ same signal.
512
+ """
.venv/lib/python3.13/site-packages/blinker/py.typed ADDED
File without changes
.venv/lib/python3.13/site-packages/certifi-2026.2.25.dist-info/INSTALLER ADDED
@@ -0,0 +1 @@
 
 
1
+ pip
.venv/lib/python3.13/site-packages/certifi-2026.2.25.dist-info/METADATA ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: certifi
3
+ Version: 2026.2.25
4
+ Summary: Python package for providing Mozilla's CA Bundle.
5
+ Home-page: https://github.com/certifi/python-certifi
6
+ Author: Kenneth Reitz
7
+ Author-email: me@kennethreitz.com
8
+ License: MPL-2.0
9
+ Project-URL: Source, https://github.com/certifi/python-certifi
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
13
+ Classifier: Natural Language :: English
14
+ Classifier: Programming Language :: Python
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Programming Language :: Python :: 3.7
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: 3.14
25
+ Requires-Python: >=3.7
26
+ License-File: LICENSE
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: home-page
32
+ Dynamic: license
33
+ Dynamic: license-file
34
+ Dynamic: project-url
35
+ Dynamic: requires-python
36
+ Dynamic: summary
37
+
38
+ Certifi: Python SSL Certificates
39
+ ================================
40
+
41
+ Certifi provides Mozilla's carefully curated collection of Root Certificates for
42
+ validating the trustworthiness of SSL certificates while verifying the identity
43
+ of TLS hosts. It has been extracted from the `Requests`_ project.
44
+
45
+ Installation
46
+ ------------
47
+
48
+ ``certifi`` is available on PyPI. Simply install it with ``pip``::
49
+
50
+ $ pip install certifi
51
+
52
+ Usage
53
+ -----
54
+
55
+ To reference the installed certificate authority (CA) bundle, you can use the
56
+ built-in function::
57
+
58
+ >>> import certifi
59
+
60
+ >>> certifi.where()
61
+ '/usr/local/lib/python3.7/site-packages/certifi/cacert.pem'
62
+
63
+ Or from the command line::
64
+
65
+ $ python -m certifi
66
+ /usr/local/lib/python3.7/site-packages/certifi/cacert.pem
67
+
68
+ Enjoy!
69
+
70
+ .. _`Requests`: https://requests.readthedocs.io/en/master/
71
+
72
+ Addition/Removal of Certificates
73
+ --------------------------------
74
+
75
+ Certifi does not support any addition/removal or other modification of the
76
+ CA trust store content. This project is intended to provide a reliable and
77
+ highly portable root of trust to python deployments. Look to upstream projects
78
+ for methods to use alternate trust.
.venv/lib/python3.13/site-packages/certifi-2026.2.25.dist-info/RECORD ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ certifi-2026.2.25.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2
+ certifi-2026.2.25.dist-info/METADATA,sha256=4NMuGXdg_hBiRA3paKVXYcDmE3VXEBWxTvCL2xlDyPU,2474
3
+ certifi-2026.2.25.dist-info/RECORD,,
4
+ certifi-2026.2.25.dist-info/WHEEL,sha256=YCfwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
5
+ certifi-2026.2.25.dist-info/licenses/LICENSE,sha256=6TcW2mucDVpKHfYP5pWzcPBpVgPSH2-D8FPkLPwQyvc,989
6
+ certifi-2026.2.25.dist-info/top_level.txt,sha256=KMu4vUCfsjLrkPbSNdgdekS-pVJzBAJFO__nI8NF6-U,8
7
+ certifi/__init__.py,sha256=c9eaYufv1pSLl0Q8QNcMiMLLH4WquDcxdPyKjmI4opY,94
8
+ certifi/__main__.py,sha256=xBBoj905TUWBLRGANOcf7oi6e-3dMP4cEoG9OyMs11g,243
9
+ certifi/__pycache__/__init__.cpython-313.pyc,,
10
+ certifi/__pycache__/__main__.cpython-313.pyc,,
11
+ certifi/__pycache__/core.cpython-313.pyc,,
12
+ certifi/cacert.pem,sha256=_JFloSQDJj5-v72te-ej6sD6XTJdPHBGXyjTaQByyig,272441
13
+ certifi/core.py,sha256=XFXycndG5pf37ayeF8N32HUuDafsyhkVMbO4BAPWHa0,3394
14
+ certifi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
.venv/lib/python3.13/site-packages/certifi-2026.2.25.dist-info/WHEEL ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
.venv/lib/python3.13/site-packages/certifi-2026.2.25.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/certifi-2026.2.25.dist-info/top_level.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ certifi
.venv/lib/python3.13/site-packages/certifi/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ from .core import contents, where
2
+
3
+ __all__ = ["contents", "where"]
4
+ __version__ = "2026.02.25"
.venv/lib/python3.13/site-packages/certifi/__main__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import argparse
2
+
3
+ from certifi import contents, where
4
+
5
+ parser = argparse.ArgumentParser()
6
+ parser.add_argument("-c", "--contents", action="store_true")
7
+ args = parser.parse_args()
8
+
9
+ if args.contents:
10
+ print(contents())
11
+ else:
12
+ print(where())
.venv/lib/python3.13/site-packages/certifi/__pycache__/__init__.cpython-313.pyc ADDED
Binary file (306 Bytes). View file
 
.venv/lib/python3.13/site-packages/certifi/__pycache__/__main__.cpython-313.pyc ADDED
Binary file (623 Bytes). View file
 
.venv/lib/python3.13/site-packages/certifi/__pycache__/core.cpython-313.pyc ADDED
Binary file (2.06 kB). View file
 
.venv/lib/python3.13/site-packages/certifi/cacert.pem ADDED
The diff for this file is too large to render. See raw diff
 
.venv/lib/python3.13/site-packages/certifi/core.py ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ certifi.py
3
+ ~~~~~~~~~~
4
+
5
+ This module returns the installation location of cacert.pem or its contents.
6
+ """
7
+ import sys
8
+ import atexit
9
+
10
+ def exit_cacert_ctx() -> None:
11
+ _CACERT_CTX.__exit__(None, None, None) # type: ignore[union-attr]
12
+
13
+
14
+ if sys.version_info >= (3, 11):
15
+
16
+ from importlib.resources import as_file, files
17
+
18
+ _CACERT_CTX = None
19
+ _CACERT_PATH = None
20
+
21
+ def where() -> str:
22
+ # This is slightly terrible, but we want to delay extracting the file
23
+ # in cases where we're inside of a zipimport situation until someone
24
+ # actually calls where(), but we don't want to re-extract the file
25
+ # on every call of where(), so we'll do it once then store it in a
26
+ # global variable.
27
+ global _CACERT_CTX
28
+ global _CACERT_PATH
29
+ if _CACERT_PATH is None:
30
+ # This is slightly janky, the importlib.resources API wants you to
31
+ # manage the cleanup of this file, so it doesn't actually return a
32
+ # path, it returns a context manager that will give you the path
33
+ # when you enter it and will do any cleanup when you leave it. In
34
+ # the common case of not needing a temporary file, it will just
35
+ # return the file system location and the __exit__() is a no-op.
36
+ #
37
+ # We also have to hold onto the actual context manager, because
38
+ # it will do the cleanup whenever it gets garbage collected, so
39
+ # we will also store that at the global level as well.
40
+ _CACERT_CTX = as_file(files("certifi").joinpath("cacert.pem"))
41
+ _CACERT_PATH = str(_CACERT_CTX.__enter__())
42
+ atexit.register(exit_cacert_ctx)
43
+
44
+ return _CACERT_PATH
45
+
46
+ def contents() -> str:
47
+ return files("certifi").joinpath("cacert.pem").read_text(encoding="ascii")
48
+
49
+ else:
50
+
51
+ from importlib.resources import path as get_path, read_text
52
+
53
+ _CACERT_CTX = None
54
+ _CACERT_PATH = None
55
+
56
+ def where() -> str:
57
+ # This is slightly terrible, but we want to delay extracting the
58
+ # file in cases where we're inside of a zipimport situation until
59
+ # someone actually calls where(), but we don't want to re-extract
60
+ # the file on every call of where(), so we'll do it once then store
61
+ # it in a global variable.
62
+ global _CACERT_CTX
63
+ global _CACERT_PATH
64
+ if _CACERT_PATH is None:
65
+ # This is slightly janky, the importlib.resources API wants you
66
+ # to manage the cleanup of this file, so it doesn't actually
67
+ # return a path, it returns a context manager that will give
68
+ # you the path when you enter it and will do any cleanup when
69
+ # you leave it. In the common case of not needing a temporary
70
+ # file, it will just return the file system location and the
71
+ # __exit__() is a no-op.
72
+ #
73
+ # We also have to hold onto the actual context manager, because
74
+ # it will do the cleanup whenever it gets garbage collected, so
75
+ # we will also store that at the global level as well.
76
+ _CACERT_CTX = get_path("certifi", "cacert.pem")
77
+ _CACERT_PATH = str(_CACERT_CTX.__enter__())
78
+ atexit.register(exit_cacert_ctx)
79
+
80
+ return _CACERT_PATH
81
+
82
+ def contents() -> str:
83
+ return read_text("certifi", "cacert.pem", encoding="ascii")
.venv/lib/python3.13/site-packages/certifi/py.typed ADDED
File without changes
.venv/lib/python3.13/site-packages/charset_normalizer-3.4.7.dist-info/INSTALLER ADDED
@@ -0,0 +1 @@
 
 
1
+ pip
.venv/lib/python3.13/site-packages/charset_normalizer-3.4.7.dist-info/METADATA ADDED
@@ -0,0 +1,808 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: charset-normalizer
3
+ Version: 3.4.7
4
+ Summary: The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet.
5
+ Author-email: "Ahmed R. TAHRI" <tahri.ahmed@proton.me>
6
+ Maintainer-email: "Ahmed R. TAHRI" <tahri.ahmed@proton.me>
7
+ License: MIT
8
+ Project-URL: Changelog, https://github.com/jawah/charset_normalizer/blob/master/CHANGELOG.md
9
+ Project-URL: Documentation, https://charset-normalizer.readthedocs.io/
10
+ Project-URL: Code, https://github.com/jawah/charset_normalizer
11
+ Project-URL: Issue tracker, https://github.com/jawah/charset_normalizer/issues
12
+ Keywords: encoding,charset,charset-detector,detector,normalization,unicode,chardet,detect
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.7
19
+ Classifier: Programming Language :: Python :: 3.8
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
26
+ Classifier: Programming Language :: Python :: 3 :: Only
27
+ Classifier: Programming Language :: Python :: Implementation :: CPython
28
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
29
+ Classifier: Programming Language :: Python :: Free Threading :: 4 - Resilient
30
+ Classifier: Topic :: Text Processing :: Linguistic
31
+ Classifier: Topic :: Utilities
32
+ Classifier: Typing :: Typed
33
+ Requires-Python: >=3.7
34
+ Description-Content-Type: text/markdown
35
+ License-File: LICENSE
36
+ Provides-Extra: unicode-backport
37
+ Dynamic: license-file
38
+
39
+ <h1 align="center">Charset Detection, for Everyone 👋</h1>
40
+
41
+ <p align="center">
42
+ <sup>The Real First Universal Charset Detector</sup><br>
43
+ <a href="https://pypi.org/project/charset-normalizer">
44
+ <img src="https://img.shields.io/pypi/pyversions/charset_normalizer.svg?orange=blue" />
45
+ </a>
46
+ <a href="https://pepy.tech/project/charset-normalizer/">
47
+ <img alt="Download Count Total" src="https://static.pepy.tech/badge/charset-normalizer/month" />
48
+ </a>
49
+ <a href="https://bestpractices.coreinfrastructure.org/projects/7297">
50
+ <img src="https://bestpractices.coreinfrastructure.org/projects/7297/badge">
51
+ </a>
52
+ </p>
53
+ <p align="center">
54
+ <sup><i>Featured Packages</i></sup><br>
55
+ <a href="https://github.com/jawah/niquests">
56
+ <img alt="Static Badge" src="https://img.shields.io/badge/Niquests-Most_Advanced_HTTP_Client-cyan">
57
+ </a>
58
+ <a href="https://github.com/jawah/wassima">
59
+ <img alt="Static Badge" src="https://img.shields.io/badge/Wassima-Certifi_Replacement-cyan">
60
+ </a>
61
+ </p>
62
+ <p align="center">
63
+ <sup><i>In other language (unofficial port - by the community)</i></sup><br>
64
+ <a href="https://github.com/nickspring/charset-normalizer-rs">
65
+ <img alt="Static Badge" src="https://img.shields.io/badge/Rust-red">
66
+ </a>
67
+ </p>
68
+
69
+ > A library that helps you read text from an unknown charset encoding.<br /> Motivated by `chardet`,
70
+ > I'm trying to resolve the issue by taking a new approach.
71
+ > All IANA character set names for which the Python core library provides codecs are supported.
72
+ > You can also register your own set of codecs, and yes, it would work as-is.
73
+
74
+ <p align="center">
75
+ >>>>> <a href="https://charsetnormalizerweb.ousret.now.sh" target="_blank">👉 Try Me Online Now, Then Adopt Me 👈 </a> <<<<<
76
+ </p>
77
+
78
+ This project offers you an alternative to **Universal Charset Encoding Detector**, also known as **Chardet**.
79
+
80
+ | Feature | [Chardet](https://github.com/chardet/chardet) | Charset Normalizer | [cChardet](https://github.com/PyYoshi/cChardet) |
81
+ |--------------------------------------------------|:---------------------------------------------:|:-----------------------------------------------------------------------------------------------:|:-----------------------------------------------:|
82
+ | `Fast` | ✅ | ✅ | ✅ |
83
+ | `Universal`[^1] | ❌ | ✅ | ❌ |
84
+ | `Reliable` **without** distinguishable standards | ✅ | ✅ | ✅ |
85
+ | `Reliable` **with** distinguishable standards | ✅ | ✅ | ✅ |
86
+ | `License` | _Disputed_[^2]<br>_restrictive_ | MIT | MPL-1.1<br>_restrictive_ |
87
+ | `Native Python` | ✅ | ✅ | ❌ |
88
+ | `Detect spoken language` | ✅ | ✅ | N/A |
89
+ | `UnicodeDecodeError Safety` | ✅ | ✅ | ❌ |
90
+ | `Whl Size (min)` | 500 kB | 150 kB | ~200 kB |
91
+ | `Supported Encoding` | 99 | [99](https://charset-normalizer.readthedocs.io/en/latest/user/support.html#supported-encodings) | 40 |
92
+ | `Can register custom encoding` | ❌ | ✅ | ❌ |
93
+
94
+ <p align="center">
95
+ <img src="https://i.imgflip.com/373iay.gif" alt="Reading Normalized Text" width="226"/><img src="https://media.tenor.com/images/c0180f70732a18b4965448d33adba3d0/tenor.gif" alt="Cat Reading Text" width="200"/>
96
+ </p>
97
+
98
+ [^1]: They are clearly using specific code for a specific encoding even if covering most of used one.
99
+ [^2]: Chardet 7.0+ was relicensed from LGPL-2.1 to MIT following an AI-assisted rewrite. This relicensing is disputed on two independent grounds: **(a)** the original author [contests](https://github.com/chardet/chardet/issues/327) that the maintainer had the right to relicense, arguing the rewrite is a derivative work of the LGPL-licensed codebase since it was not a clean room implementation; **(b)** the copyright claim itself is [questionable](https://github.com/chardet/chardet/issues/334) given the code was primarily generated by an LLM, and AI-generated output may not be copyrightable under most jurisdictions. Either issue alone could undermine the MIT license. Beyond licensing, the rewrite raises questions about responsible use of AI in open source: key architectural ideas pioneered by charset-normalizer - notably decode-first validity filtering (our foundational approach since v1) and encoding pairwise similarity with the same algorithm and threshold — surfaced in chardet 7 without acknowledgment. The project also imported test files from charset-normalizer to train and benchmark against it, then claimed superior accuracy on those very files. Charset-normalizer has always been MIT-licensed, encoding-agnostic by design, and built on a verifiable human-authored history.
100
+
101
+ ## ⚡ Performance
102
+
103
+ This package offer better performances (99th, and 95th) against Chardet. Here are some numbers.
104
+
105
+ | Package | Accuracy | Mean per file (ms) | File per sec (est) |
106
+ |---------------------------------------------------|:--------:|:------------------:|:------------------:|
107
+ | [chardet 7.1](https://github.com/chardet/chardet) | 89 % | 3 ms | 333 file/sec |
108
+ | charset-normalizer | **97 %** | 3 ms | 333 file/sec |
109
+
110
+ | Package | 99th percentile | 95th percentile | 50th percentile |
111
+ |---------------------------------------------------|:---------------:|:---------------:|:---------------:|
112
+ | [chardet 7.1](https://github.com/chardet/chardet) | 32 ms | 17 ms | < 1 ms |
113
+ | charset-normalizer | 16 ms | 10 ms | 1 ms |
114
+
115
+ _updated as of March 2026 using CPython 3.12, Charset-Normalizer 3.4.6, and Chardet 7.1.0_
116
+
117
+ ~Chardet's performance on larger file (1MB+) are very poor. Expect huge difference on large payload.~ No longer the case since Chardet 7.0+
118
+
119
+ > Stats are generated using 400+ files using default parameters. More details on used files, see GHA workflows.
120
+ > And yes, these results might change at any time. The dataset can be updated to include more files.
121
+ > The actual delays heavily depends on your CPU capabilities. The factors should remain the same.
122
+ > Chardet claims on his documentation to have a greater accuracy than us based on the dataset they trained Chardet on(...)
123
+ > Well, it's normal, the opposite would have been worrying. Whereas charset-normalizer don't train on anything, our solution
124
+ > is based on a completely different algorithm, still heuristic through, it does not need weights across every encoding tables.
125
+
126
+ ## ✨ Installation
127
+
128
+ Using pip:
129
+
130
+ ```sh
131
+ pip install charset-normalizer -U
132
+ ```
133
+
134
+ ## 🚀 Basic Usage
135
+
136
+ ### CLI
137
+ This package comes with a CLI.
138
+
139
+ ```
140
+ usage: normalizer [-h] [-v] [-a] [-n] [-m] [-r] [-f] [-t THRESHOLD]
141
+ file [file ...]
142
+
143
+ The Real First Universal Charset Detector. Discover originating encoding used
144
+ on text file. Normalize text to unicode.
145
+
146
+ positional arguments:
147
+ files File(s) to be analysed
148
+
149
+ optional arguments:
150
+ -h, --help show this help message and exit
151
+ -v, --verbose Display complementary information about file if any.
152
+ Stdout will contain logs about the detection process.
153
+ -a, --with-alternative
154
+ Output complementary possibilities if any. Top-level
155
+ JSON WILL be a list.
156
+ -n, --normalize Permit to normalize input file. If not set, program
157
+ does not write anything.
158
+ -m, --minimal Only output the charset detected to STDOUT. Disabling
159
+ JSON output.
160
+ -r, --replace Replace file when trying to normalize it instead of
161
+ creating a new one.
162
+ -f, --force Replace file without asking if you are sure, use this
163
+ flag with caution.
164
+ -t THRESHOLD, --threshold THRESHOLD
165
+ Define a custom maximum amount of chaos allowed in
166
+ decoded content. 0. <= chaos <= 1.
167
+ --version Show version information and exit.
168
+ ```
169
+
170
+ ```bash
171
+ normalizer ./data/sample.1.fr.srt
172
+ ```
173
+
174
+ or
175
+
176
+ ```bash
177
+ python -m charset_normalizer ./data/sample.1.fr.srt
178
+ ```
179
+
180
+ 🎉 Since version 1.4.0 the CLI produce easily usable stdout result in JSON format.
181
+
182
+ ```json
183
+ {
184
+ "path": "/home/default/projects/charset_normalizer/data/sample.1.fr.srt",
185
+ "encoding": "cp1252",
186
+ "encoding_aliases": [
187
+ "1252",
188
+ "windows_1252"
189
+ ],
190
+ "alternative_encodings": [
191
+ "cp1254",
192
+ "cp1256",
193
+ "cp1258",
194
+ "iso8859_14",
195
+ "iso8859_15",
196
+ "iso8859_16",
197
+ "iso8859_3",
198
+ "iso8859_9",
199
+ "latin_1",
200
+ "mbcs"
201
+ ],
202
+ "language": "French",
203
+ "alphabets": [
204
+ "Basic Latin",
205
+ "Latin-1 Supplement"
206
+ ],
207
+ "has_sig_or_bom": false,
208
+ "chaos": 0.149,
209
+ "coherence": 97.152,
210
+ "unicode_path": null,
211
+ "is_preferred": true
212
+ }
213
+ ```
214
+
215
+ ### Python
216
+ *Just print out normalized text*
217
+ ```python
218
+ from charset_normalizer import from_path
219
+
220
+ results = from_path('./my_subtitle.srt')
221
+
222
+ print(str(results.best()))
223
+ ```
224
+
225
+ *Upgrade your code without effort*
226
+ ```python
227
+ from charset_normalizer import detect
228
+ ```
229
+
230
+ The above code will behave the same as **chardet**. We ensure that we offer the best (reasonable) BC result possible.
231
+
232
+ See the docs for advanced usage : [readthedocs.io](https://charset-normalizer.readthedocs.io/en/latest/)
233
+
234
+ ## 😇 Why
235
+
236
+ When I started using Chardet, I noticed that it was not suited to my expectations, and I wanted to propose a
237
+ reliable alternative using a completely different method. Also! I never back down on a good challenge!
238
+
239
+ I **don't care** about the **originating charset** encoding, because **two different tables** can
240
+ produce **two identical rendered string.**
241
+ What I want is to get readable text, the best I can.
242
+
243
+ In a way, **I'm brute forcing text decoding.** How cool is that ? 😎
244
+
245
+ Don't confuse package **ftfy** with charset-normalizer or chardet. ftfy goal is to repair Unicode string whereas charset-normalizer to convert raw file in unknown encoding to unicode.
246
+
247
+ ## 🍰 How
248
+
249
+ - Discard all charset encoding table that could not fit the binary content.
250
+ - Measure noise, or the mess once opened (by chunks) with a corresponding charset encoding.
251
+ - Extract matches with the lowest mess detected.
252
+ - Additionally, we measure coherence / probe for a language.
253
+
254
+ **Wait a minute**, what is noise/mess and coherence according to **YOU ?**
255
+
256
+ *Noise :* I opened hundred of text files, **written by humans**, with the wrong encoding table. **I observed**, then
257
+ **I established** some ground rules about **what is obvious** when **it seems like** a mess (aka. defining noise in rendered text).
258
+ I know that my interpretation of what is noise is probably incomplete, feel free to contribute in order to
259
+ improve or rewrite it.
260
+
261
+ *Coherence :* For each language there is on earth, we have computed ranked letter appearance occurrences (the best we can). So I thought
262
+ that intel is worth something here. So I use those records against decoded text to check if I can detect intelligent design.
263
+
264
+ ## ⚡ Known limitations
265
+
266
+ - Language detection is unreliable when text contains two or more languages sharing identical letters. (eg. HTML (english tags) + Turkish content (Sharing Latin characters))
267
+ - Every charset detector heavily depends on sufficient content. In common cases, do not bother run detection on very tiny content.
268
+
269
+ ## ⚠️ About Python EOLs
270
+
271
+ **If you are running:**
272
+
273
+ - Python >=2.7,<3.5: Unsupported
274
+ - Python 3.5: charset-normalizer < 2.1
275
+ - Python 3.6: charset-normalizer < 3.1
276
+
277
+ Upgrade your Python interpreter as soon as possible.
278
+
279
+ ## 👤 Contributing
280
+
281
+ Contributions, issues and feature requests are very much welcome.<br />
282
+ Feel free to check [issues page](https://github.com/ousret/charset_normalizer/issues) if you want to contribute.
283
+
284
+ ## 📝 License
285
+
286
+ Copyright © [Ahmed TAHRI @Ousret](https://github.com/Ousret).<br />
287
+ This project is [MIT](https://github.com/Ousret/charset_normalizer/blob/master/LICENSE) licensed.
288
+
289
+ Characters frequencies used in this project © 2012 [Denny Vrandečić](http://simia.net/letters/)
290
+
291
+ ## 💼 For Enterprise
292
+
293
+ Professional support for charset-normalizer is available as part of the [Tidelift
294
+ Subscription][1]. Tidelift gives software development teams a single source for
295
+ purchasing and maintaining their software, with professional grade assurances
296
+ from the experts who know it best, while seamlessly integrating with existing
297
+ tools.
298
+
299
+ [1]: https://tidelift.com/subscription/pkg/pypi-charset-normalizer?utm_source=pypi-charset-normalizer&utm_medium=readme
300
+
301
+ [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/7297/badge)](https://www.bestpractices.dev/projects/7297)
302
+
303
+ # Changelog
304
+ All notable changes to charset-normalizer will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
305
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
306
+
307
+ ## [3.4.7](https://github.com/Ousret/charset_normalizer/compare/3.4.6...3.4.7) (2026-04-02)
308
+
309
+ ### Changed
310
+ - Pre-built optimized version using mypy[c] v1.20.
311
+ - Relax `setuptools` constraint to `setuptools>=68,<82.1`.
312
+
313
+ ### Fixed
314
+ - Correctly remove SIG remnant in utf-7 decoded string. (#718) (#716)
315
+
316
+ ## [3.4.6](https://github.com/Ousret/charset_normalizer/compare/3.4.5...3.4.6) (2026-03-15)
317
+
318
+ ### Changed
319
+ - Flattened the logic in `charset_normalizer.md` for higher performance. Removed `eligible(..)` and `feed(...)`
320
+ in favor of `feed_info(...)`.
321
+ - Raised upper bound for mypy[c] to 1.20, for our optimized version.
322
+ - Updated `UNICODE_RANGES_COMBINED` using Unicode blocks v17.
323
+
324
+ ### Fixed
325
+ - Edge case where noise difference between two candidates can be almost insignificant. (#672)
326
+ - CLI `--normalize` writing to wrong path when passing multiple files in. (#702)
327
+
328
+ ### Misc
329
+ - Freethreaded pre-built wheels now shipped in PyPI starting with 3.14t. (#616)
330
+
331
+ ## [3.4.5](https://github.com/Ousret/charset_normalizer/compare/3.4.4...3.4.5) (2026-03-06)
332
+
333
+ ### Changed
334
+ - Update `setuptools` constraint to `setuptools>=68,<=82`.
335
+ - Raised upper bound of mypyc for the optional pre-built extension to v1.19.1
336
+
337
+ ### Fixed
338
+ - Add explicit link to lib math in our optimized build. (#692)
339
+ - Logger level not restored correctly for empty byte sequences. (#701)
340
+ - TypeError when passing bytearray to from_bytes. (#703)
341
+
342
+ ### Misc
343
+ - Applied safe micro-optimizations in both our noise detector and language detector.
344
+ - Rewrote the `query_yes_no` function (inside CLI) to avoid using ambiguous licensed code.
345
+ - Added `cd.py` submodule into mypyc optional compilation to reduce further the performance impact.
346
+
347
+ ## [3.4.4](https://github.com/Ousret/charset_normalizer/compare/3.4.2...3.4.4) (2025-10-13)
348
+
349
+ ### Changed
350
+ - Bound `setuptools` to a specific constraint `setuptools>=68,<=81`.
351
+ - Raised upper bound of mypyc for the optional pre-built extension to v1.18.2
352
+
353
+ ### Removed
354
+ - `setuptools-scm` as a build dependency.
355
+
356
+ ### Misc
357
+ - Enforced hashes in `dev-requirements.txt` and created `ci-requirements.txt` for security purposes.
358
+ - Additional pre-built wheels for riscv64, s390x, and armv7l architectures.
359
+ - Restore ` multiple.intoto.jsonl` in GitHub releases in addition to individual attestation file per wheel.
360
+
361
+ ## [3.4.3](https://github.com/Ousret/charset_normalizer/compare/3.4.2...3.4.3) (2025-08-09)
362
+
363
+ ### Changed
364
+ - mypy(c) is no longer a required dependency at build time if `CHARSET_NORMALIZER_USE_MYPYC` isn't set to `1`. (#595) (#583)
365
+ - automatically lower confidence on small bytes samples that are not Unicode in `detect` output legacy function. (#391)
366
+
367
+ ### Added
368
+ - Custom build backend to overcome inability to mark mypy as an optional dependency in the build phase.
369
+ - Support for Python 3.14
370
+
371
+ ### Fixed
372
+ - sdist archive contained useless directories.
373
+ - automatically fallback on valid UTF-16 or UTF-32 even if the md says it's noisy. (#633)
374
+
375
+ ### Misc
376
+ - SBOM are automatically published to the relevant GitHub release to comply with regulatory changes.
377
+ Each published wheel comes with its SBOM. We choose CycloneDX as the format.
378
+ - Prebuilt optimized wheel are no longer distributed by default for CPython 3.7 due to a change in cibuildwheel.
379
+
380
+ ## [3.4.2](https://github.com/Ousret/charset_normalizer/compare/3.4.1...3.4.2) (2025-05-02)
381
+
382
+ ### Fixed
383
+ - Addressed the DeprecationWarning in our CLI regarding `argparse.FileType` by backporting the target class into the package. (#591)
384
+ - Improved the overall reliability of the detector with CJK Ideographs. (#605) (#587)
385
+
386
+ ### Changed
387
+ - Optional mypyc compilation upgraded to version 1.15 for Python >= 3.8
388
+
389
+ ## [3.4.1](https://github.com/Ousret/charset_normalizer/compare/3.4.0...3.4.1) (2024-12-24)
390
+
391
+ ### Changed
392
+ - Project metadata are now stored using `pyproject.toml` instead of `setup.cfg` using setuptools as the build backend.
393
+ - Enforce annotation delayed loading for a simpler and consistent types in the project.
394
+ - Optional mypyc compilation upgraded to version 1.14 for Python >= 3.8
395
+
396
+ ### Added
397
+ - pre-commit configuration.
398
+ - noxfile.
399
+
400
+ ### Removed
401
+ - `build-requirements.txt` as per using `pyproject.toml` native build configuration.
402
+ - `bin/integration.py` and `bin/serve.py` in favor of downstream integration test (see noxfile).
403
+ - `setup.cfg` in favor of `pyproject.toml` metadata configuration.
404
+ - Unused `utils.range_scan` function.
405
+
406
+ ### Fixed
407
+ - Converting content to Unicode bytes may insert `utf_8` instead of preferred `utf-8`. (#572)
408
+ - Deprecation warning "'count' is passed as positional argument" when converting to Unicode bytes on Python 3.13+
409
+
410
+ ## [3.4.0](https://github.com/Ousret/charset_normalizer/compare/3.3.2...3.4.0) (2024-10-08)
411
+
412
+ ### Added
413
+ - Argument `--no-preemptive` in the CLI to prevent the detector to search for hints.
414
+ - Support for Python 3.13 (#512)
415
+
416
+ ### Fixed
417
+ - Relax the TypeError exception thrown when trying to compare a CharsetMatch with anything else than a CharsetMatch.
418
+ - Improved the general reliability of the detector based on user feedbacks. (#520) (#509) (#498) (#407) (#537)
419
+ - Declared charset in content (preemptive detection) not changed when converting to utf-8 bytes. (#381)
420
+
421
+ ## [3.3.2](https://github.com/Ousret/charset_normalizer/compare/3.3.1...3.3.2) (2023-10-31)
422
+
423
+ ### Fixed
424
+ - Unintentional memory usage regression when using large payload that match several encoding (#376)
425
+ - Regression on some detection case showcased in the documentation (#371)
426
+
427
+ ### Added
428
+ - Noise (md) probe that identify malformed arabic representation due to the presence of letters in isolated form (credit to my wife)
429
+
430
+ ## [3.3.1](https://github.com/Ousret/charset_normalizer/compare/3.3.0...3.3.1) (2023-10-22)
431
+
432
+ ### Changed
433
+ - Optional mypyc compilation upgraded to version 1.6.1 for Python >= 3.8
434
+ - Improved the general detection reliability based on reports from the community
435
+
436
+ ## [3.3.0](https://github.com/Ousret/charset_normalizer/compare/3.2.0...3.3.0) (2023-09-30)
437
+
438
+ ### Added
439
+ - Allow to execute the CLI (e.g. normalizer) through `python -m charset_normalizer.cli` or `python -m charset_normalizer`
440
+ - Support for 9 forgotten encoding that are supported by Python but unlisted in `encoding.aliases` as they have no alias (#323)
441
+
442
+ ### Removed
443
+ - (internal) Redundant utils.is_ascii function and unused function is_private_use_only
444
+ - (internal) charset_normalizer.assets is moved inside charset_normalizer.constant
445
+
446
+ ### Changed
447
+ - (internal) Unicode code blocks in constants are updated using the latest v15.0.0 definition to improve detection
448
+ - Optional mypyc compilation upgraded to version 1.5.1 for Python >= 3.8
449
+
450
+ ### Fixed
451
+ - Unable to properly sort CharsetMatch when both chaos/noise and coherence were close due to an unreachable condition in \_\_lt\_\_ (#350)
452
+
453
+ ## [3.2.0](https://github.com/Ousret/charset_normalizer/compare/3.1.0...3.2.0) (2023-06-07)
454
+
455
+ ### Changed
456
+ - Typehint for function `from_path` no longer enforce `PathLike` as its first argument
457
+ - Minor improvement over the global detection reliability
458
+
459
+ ### Added
460
+ - Introduce function `is_binary` that relies on main capabilities, and optimized to detect binaries
461
+ - Propagate `enable_fallback` argument throughout `from_bytes`, `from_path`, and `from_fp` that allow a deeper control over the detection (default True)
462
+ - Explicit support for Python 3.12
463
+
464
+ ### Fixed
465
+ - Edge case detection failure where a file would contain 'very-long' camel cased word (Issue #289)
466
+
467
+ ## [3.1.0](https://github.com/Ousret/charset_normalizer/compare/3.0.1...3.1.0) (2023-03-06)
468
+
469
+ ### Added
470
+ - Argument `should_rename_legacy` for legacy function `detect` and disregard any new arguments without errors (PR #262)
471
+
472
+ ### Removed
473
+ - Support for Python 3.6 (PR #260)
474
+
475
+ ### Changed
476
+ - Optional speedup provided by mypy/c 1.0.1
477
+
478
+ ## [3.0.1](https://github.com/Ousret/charset_normalizer/compare/3.0.0...3.0.1) (2022-11-18)
479
+
480
+ ### Fixed
481
+ - Multi-bytes cutter/chunk generator did not always cut correctly (PR #233)
482
+
483
+ ### Changed
484
+ - Speedup provided by mypy/c 0.990 on Python >= 3.7
485
+
486
+ ## [3.0.0](https://github.com/Ousret/charset_normalizer/compare/2.1.1...3.0.0) (2022-10-20)
487
+
488
+ ### Added
489
+ - Extend the capability of explain=True when cp_isolation contains at most two entries (min one), will log in details of the Mess-detector results
490
+ - Support for alternative language frequency set in charset_normalizer.assets.FREQUENCIES
491
+ - Add parameter `language_threshold` in `from_bytes`, `from_path` and `from_fp` to adjust the minimum expected coherence ratio
492
+ - `normalizer --version` now specify if current version provide extra speedup (meaning mypyc compilation whl)
493
+
494
+ ### Changed
495
+ - Build with static metadata using 'build' frontend
496
+ - Make the language detection stricter
497
+ - Optional: Module `md.py` can be compiled using Mypyc to provide an extra speedup up to 4x faster than v2.1
498
+
499
+ ### Fixed
500
+ - CLI with opt --normalize fail when using full path for files
501
+ - TooManyAccentuatedPlugin induce false positive on the mess detection when too few alpha character have been fed to it
502
+ - Sphinx warnings when generating the documentation
503
+
504
+ ### Removed
505
+ - Coherence detector no longer return 'Simple English' instead return 'English'
506
+ - Coherence detector no longer return 'Classical Chinese' instead return 'Chinese'
507
+ - Breaking: Method `first()` and `best()` from CharsetMatch
508
+ - UTF-7 will no longer appear as "detected" without a recognized SIG/mark (is unreliable/conflict with ASCII)
509
+ - Breaking: Class aliases CharsetDetector, CharsetDoctor, CharsetNormalizerMatch and CharsetNormalizerMatches
510
+ - Breaking: Top-level function `normalize`
511
+ - Breaking: Properties `chaos_secondary_pass`, `coherence_non_latin` and `w_counter` from CharsetMatch
512
+ - Support for the backport `unicodedata2`
513
+
514
+ ## [3.0.0rc1](https://github.com/Ousret/charset_normalizer/compare/3.0.0b2...3.0.0rc1) (2022-10-18)
515
+
516
+ ### Added
517
+ - Extend the capability of explain=True when cp_isolation contains at most two entries (min one), will log in details of the Mess-detector results
518
+ - Support for alternative language frequency set in charset_normalizer.assets.FREQUENCIES
519
+ - Add parameter `language_threshold` in `from_bytes`, `from_path` and `from_fp` to adjust the minimum expected coherence ratio
520
+
521
+ ### Changed
522
+ - Build with static metadata using 'build' frontend
523
+ - Make the language detection stricter
524
+
525
+ ### Fixed
526
+ - CLI with opt --normalize fail when using full path for files
527
+ - TooManyAccentuatedPlugin induce false positive on the mess detection when too few alpha character have been fed to it
528
+
529
+ ### Removed
530
+ - Coherence detector no longer return 'Simple English' instead return 'English'
531
+ - Coherence detector no longer return 'Classical Chinese' instead return 'Chinese'
532
+
533
+ ## [3.0.0b2](https://github.com/Ousret/charset_normalizer/compare/3.0.0b1...3.0.0b2) (2022-08-21)
534
+
535
+ ### Added
536
+ - `normalizer --version` now specify if current version provide extra speedup (meaning mypyc compilation whl)
537
+
538
+ ### Removed
539
+ - Breaking: Method `first()` and `best()` from CharsetMatch
540
+ - UTF-7 will no longer appear as "detected" without a recognized SIG/mark (is unreliable/conflict with ASCII)
541
+
542
+ ### Fixed
543
+ - Sphinx warnings when generating the documentation
544
+
545
+ ## [3.0.0b1](https://github.com/Ousret/charset_normalizer/compare/2.1.0...3.0.0b1) (2022-08-15)
546
+
547
+ ### Changed
548
+ - Optional: Module `md.py` can be compiled using Mypyc to provide an extra speedup up to 4x faster than v2.1
549
+
550
+ ### Removed
551
+ - Breaking: Class aliases CharsetDetector, CharsetDoctor, CharsetNormalizerMatch and CharsetNormalizerMatches
552
+ - Breaking: Top-level function `normalize`
553
+ - Breaking: Properties `chaos_secondary_pass`, `coherence_non_latin` and `w_counter` from CharsetMatch
554
+ - Support for the backport `unicodedata2`
555
+
556
+ ## [2.1.1](https://github.com/Ousret/charset_normalizer/compare/2.1.0...2.1.1) (2022-08-19)
557
+
558
+ ### Deprecated
559
+ - Function `normalize` scheduled for removal in 3.0
560
+
561
+ ### Changed
562
+ - Removed useless call to decode in fn is_unprintable (#206)
563
+
564
+ ### Fixed
565
+ - Third-party library (i18n xgettext) crashing not recognizing utf_8 (PEP 263) with underscore from [@aleksandernovikov](https://github.com/aleksandernovikov) (#204)
566
+
567
+ ## [2.1.0](https://github.com/Ousret/charset_normalizer/compare/2.0.12...2.1.0) (2022-06-19)
568
+
569
+ ### Added
570
+ - Output the Unicode table version when running the CLI with `--version` (PR #194)
571
+
572
+ ### Changed
573
+ - Re-use decoded buffer for single byte character sets from [@nijel](https://github.com/nijel) (PR #175)
574
+ - Fixing some performance bottlenecks from [@deedy5](https://github.com/deedy5) (PR #183)
575
+
576
+ ### Fixed
577
+ - Workaround potential bug in cpython with Zero Width No-Break Space located in Arabic Presentation Forms-B, Unicode 1.1 not acknowledged as space (PR #175)
578
+ - CLI default threshold aligned with the API threshold from [@oleksandr-kuzmenko](https://github.com/oleksandr-kuzmenko) (PR #181)
579
+
580
+ ### Removed
581
+ - Support for Python 3.5 (PR #192)
582
+
583
+ ### Deprecated
584
+ - Use of backport unicodedata from `unicodedata2` as Python is quickly catching up, scheduled for removal in 3.0 (PR #194)
585
+
586
+ ## [2.0.12](https://github.com/Ousret/charset_normalizer/compare/2.0.11...2.0.12) (2022-02-12)
587
+
588
+ ### Fixed
589
+ - ASCII miss-detection on rare cases (PR #170)
590
+
591
+ ## [2.0.11](https://github.com/Ousret/charset_normalizer/compare/2.0.10...2.0.11) (2022-01-30)
592
+
593
+ ### Added
594
+ - Explicit support for Python 3.11 (PR #164)
595
+
596
+ ### Changed
597
+ - The logging behavior have been completely reviewed, now using only TRACE and DEBUG levels (PR #163 #165)
598
+
599
+ ## [2.0.10](https://github.com/Ousret/charset_normalizer/compare/2.0.9...2.0.10) (2022-01-04)
600
+
601
+ ### Fixed
602
+ - Fallback match entries might lead to UnicodeDecodeError for large bytes sequence (PR #154)
603
+
604
+ ### Changed
605
+ - Skipping the language-detection (CD) on ASCII (PR #155)
606
+
607
+ ## [2.0.9](https://github.com/Ousret/charset_normalizer/compare/2.0.8...2.0.9) (2021-12-03)
608
+
609
+ ### Changed
610
+ - Moderating the logging impact (since 2.0.8) for specific environments (PR #147)
611
+
612
+ ### Fixed
613
+ - Wrong logging level applied when setting kwarg `explain` to True (PR #146)
614
+
615
+ ## [2.0.8](https://github.com/Ousret/charset_normalizer/compare/2.0.7...2.0.8) (2021-11-24)
616
+ ### Changed
617
+ - Improvement over Vietnamese detection (PR #126)
618
+ - MD improvement on trailing data and long foreign (non-pure latin) data (PR #124)
619
+ - Efficiency improvements in cd/alphabet_languages from [@adbar](https://github.com/adbar) (PR #122)
620
+ - call sum() without an intermediary list following PEP 289 recommendations from [@adbar](https://github.com/adbar) (PR #129)
621
+ - Code style as refactored by Sourcery-AI (PR #131)
622
+ - Minor adjustment on the MD around european words (PR #133)
623
+ - Remove and replace SRTs from assets / tests (PR #139)
624
+ - Initialize the library logger with a `NullHandler` by default from [@nmaynes](https://github.com/nmaynes) (PR #135)
625
+ - Setting kwarg `explain` to True will add provisionally (bounded to function lifespan) a specific stream handler (PR #135)
626
+
627
+ ### Fixed
628
+ - Fix large (misleading) sequence giving UnicodeDecodeError (PR #137)
629
+ - Avoid using too insignificant chunk (PR #137)
630
+
631
+ ### Added
632
+ - Add and expose function `set_logging_handler` to configure a specific StreamHandler from [@nmaynes](https://github.com/nmaynes) (PR #135)
633
+ - Add `CHANGELOG.md` entries, format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) (PR #141)
634
+
635
+ ## [2.0.7](https://github.com/Ousret/charset_normalizer/compare/2.0.6...2.0.7) (2021-10-11)
636
+ ### Added
637
+ - Add support for Kazakh (Cyrillic) language detection (PR #109)
638
+
639
+ ### Changed
640
+ - Further, improve inferring the language from a given single-byte code page (PR #112)
641
+ - Vainly trying to leverage PEP263 when PEP3120 is not supported (PR #116)
642
+ - Refactoring for potential performance improvements in loops from [@adbar](https://github.com/adbar) (PR #113)
643
+ - Various detection improvement (MD+CD) (PR #117)
644
+
645
+ ### Removed
646
+ - Remove redundant logging entry about detected language(s) (PR #115)
647
+
648
+ ### Fixed
649
+ - Fix a minor inconsistency between Python 3.5 and other versions regarding language detection (PR #117 #102)
650
+
651
+ ## [2.0.6](https://github.com/Ousret/charset_normalizer/compare/2.0.5...2.0.6) (2021-09-18)
652
+ ### Fixed
653
+ - Unforeseen regression with the loss of the backward-compatibility with some older minor of Python 3.5.x (PR #100)
654
+ - Fix CLI crash when using --minimal output in certain cases (PR #103)
655
+
656
+ ### Changed
657
+ - Minor improvement to the detection efficiency (less than 1%) (PR #106 #101)
658
+
659
+ ## [2.0.5](https://github.com/Ousret/charset_normalizer/compare/2.0.4...2.0.5) (2021-09-14)
660
+ ### Changed
661
+ - The project now comply with: flake8, mypy, isort and black to ensure a better overall quality (PR #81)
662
+ - The BC-support with v1.x was improved, the old staticmethods are restored (PR #82)
663
+ - The Unicode detection is slightly improved (PR #93)
664
+ - Add syntax sugar \_\_bool\_\_ for results CharsetMatches list-container (PR #91)
665
+
666
+ ### Removed
667
+ - The project no longer raise warning on tiny content given for detection, will be simply logged as warning instead (PR #92)
668
+
669
+ ### Fixed
670
+ - In some rare case, the chunks extractor could cut in the middle of a multi-byte character and could mislead the mess detection (PR #95)
671
+ - Some rare 'space' characters could trip up the UnprintablePlugin/Mess detection (PR #96)
672
+ - The MANIFEST.in was not exhaustive (PR #78)
673
+
674
+ ## [2.0.4](https://github.com/Ousret/charset_normalizer/compare/2.0.3...2.0.4) (2021-07-30)
675
+ ### Fixed
676
+ - The CLI no longer raise an unexpected exception when no encoding has been found (PR #70)
677
+ - Fix accessing the 'alphabets' property when the payload contains surrogate characters (PR #68)
678
+ - The logger could mislead (explain=True) on detected languages and the impact of one MBCS match (PR #72)
679
+ - Submatch factoring could be wrong in rare edge cases (PR #72)
680
+ - Multiple files given to the CLI were ignored when publishing results to STDOUT. (After the first path) (PR #72)
681
+ - Fix line endings from CRLF to LF for certain project files (PR #67)
682
+
683
+ ### Changed
684
+ - Adjust the MD to lower the sensitivity, thus improving the global detection reliability (PR #69 #76)
685
+ - Allow fallback on specified encoding if any (PR #71)
686
+
687
+ ## [2.0.3](https://github.com/Ousret/charset_normalizer/compare/2.0.2...2.0.3) (2021-07-16)
688
+ ### Changed
689
+ - Part of the detection mechanism has been improved to be less sensitive, resulting in more accurate detection results. Especially ASCII. (PR #63)
690
+ - According to the community wishes, the detection will fall back on ASCII or UTF-8 in a last-resort case. (PR #64)
691
+
692
+ ## [2.0.2](https://github.com/Ousret/charset_normalizer/compare/2.0.1...2.0.2) (2021-07-15)
693
+ ### Fixed
694
+ - Empty/Too small JSON payload miss-detection fixed. Report from [@tseaver](https://github.com/tseaver) (PR #59)
695
+
696
+ ### Changed
697
+ - Don't inject unicodedata2 into sys.modules from [@akx](https://github.com/akx) (PR #57)
698
+
699
+ ## [2.0.1](https://github.com/Ousret/charset_normalizer/compare/2.0.0...2.0.1) (2021-07-13)
700
+ ### Fixed
701
+ - Make it work where there isn't a filesystem available, dropping assets frequencies.json. Report from [@sethmlarson](https://github.com/sethmlarson). (PR #55)
702
+ - Using explain=False permanently disable the verbose output in the current runtime (PR #47)
703
+ - One log entry (language target preemptive) was not show in logs when using explain=True (PR #47)
704
+ - Fix undesired exception (ValueError) on getitem of instance CharsetMatches (PR #52)
705
+
706
+ ### Changed
707
+ - Public function normalize default args values were not aligned with from_bytes (PR #53)
708
+
709
+ ### Added
710
+ - You may now use charset aliases in cp_isolation and cp_exclusion arguments (PR #47)
711
+
712
+ ## [2.0.0](https://github.com/Ousret/charset_normalizer/compare/1.4.1...2.0.0) (2021-07-02)
713
+ ### Changed
714
+ - 4x to 5 times faster than the previous 1.4.0 release. At least 2x faster than Chardet.
715
+ - Accent has been made on UTF-8 detection, should perform rather instantaneous.
716
+ - The backward compatibility with Chardet has been greatly improved. The legacy detect function returns an identical charset name whenever possible.
717
+ - The detection mechanism has been slightly improved, now Turkish content is detected correctly (most of the time)
718
+ - The program has been rewritten to ease the readability and maintainability. (+Using static typing)+
719
+ - utf_7 detection has been reinstated.
720
+
721
+ ### Removed
722
+ - This package no longer require anything when used with Python 3.5 (Dropped cached_property)
723
+ - Removed support for these languages: Catalan, Esperanto, Kazakh, Baque, Volapük, Azeri, Galician, Nynorsk, Macedonian, and Serbocroatian.
724
+ - The exception hook on UnicodeDecodeError has been removed.
725
+
726
+ ### Deprecated
727
+ - Methods coherence_non_latin, w_counter, chaos_secondary_pass of the class CharsetMatch are now deprecated and scheduled for removal in v3.0
728
+
729
+ ### Fixed
730
+ - The CLI output used the relative path of the file(s). Should be absolute.
731
+
732
+ ## [1.4.1](https://github.com/Ousret/charset_normalizer/compare/1.4.0...1.4.1) (2021-05-28)
733
+ ### Fixed
734
+ - Logger configuration/usage no longer conflict with others (PR #44)
735
+
736
+ ## [1.4.0](https://github.com/Ousret/charset_normalizer/compare/1.3.9...1.4.0) (2021-05-21)
737
+ ### Removed
738
+ - Using standard logging instead of using the package loguru.
739
+ - Dropping nose test framework in favor of the maintained pytest.
740
+ - Choose to not use dragonmapper package to help with gibberish Chinese/CJK text.
741
+ - Require cached_property only for Python 3.5 due to constraint. Dropping for every other interpreter version.
742
+ - Stop support for UTF-7 that does not contain a SIG.
743
+ - Dropping PrettyTable, replaced with pure JSON output in CLI.
744
+
745
+ ### Fixed
746
+ - BOM marker in a CharsetNormalizerMatch instance could be False in rare cases even if obviously present. Due to the sub-match factoring process.
747
+ - Not searching properly for the BOM when trying utf32/16 parent codec.
748
+
749
+ ### Changed
750
+ - Improving the package final size by compressing frequencies.json.
751
+ - Huge improvement over the larges payload.
752
+
753
+ ### Added
754
+ - CLI now produces JSON consumable output.
755
+ - Return ASCII if given sequences fit. Given reasonable confidence.
756
+
757
+ ## [1.3.9](https://github.com/Ousret/charset_normalizer/compare/1.3.8...1.3.9) (2021-05-13)
758
+
759
+ ### Fixed
760
+ - In some very rare cases, you may end up getting encode/decode errors due to a bad bytes payload (PR #40)
761
+
762
+ ## [1.3.8](https://github.com/Ousret/charset_normalizer/compare/1.3.7...1.3.8) (2021-05-12)
763
+
764
+ ### Fixed
765
+ - Empty given payload for detection may cause an exception if trying to access the `alphabets` property. (PR #39)
766
+
767
+ ## [1.3.7](https://github.com/Ousret/charset_normalizer/compare/1.3.6...1.3.7) (2021-05-12)
768
+
769
+ ### Fixed
770
+ - The legacy detect function should return UTF-8-SIG if sig is present in the payload. (PR #38)
771
+
772
+ ## [1.3.6](https://github.com/Ousret/charset_normalizer/compare/1.3.5...1.3.6) (2021-02-09)
773
+
774
+ ### Changed
775
+ - Amend the previous release to allow prettytable 2.0 (PR #35)
776
+
777
+ ## [1.3.5](https://github.com/Ousret/charset_normalizer/compare/1.3.4...1.3.5) (2021-02-08)
778
+
779
+ ### Fixed
780
+ - Fix error while using the package with a python pre-release interpreter (PR #33)
781
+
782
+ ### Changed
783
+ - Dependencies refactoring, constraints revised.
784
+
785
+ ### Added
786
+ - Add python 3.9 and 3.10 to the supported interpreters
787
+
788
+ MIT License
789
+
790
+ Copyright (c) 2025 TAHRI Ahmed R.
791
+
792
+ Permission is hereby granted, free of charge, to any person obtaining a copy
793
+ of this software and associated documentation files (the "Software"), to deal
794
+ in the Software without restriction, including without limitation the rights
795
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
796
+ copies of the Software, and to permit persons to whom the Software is
797
+ furnished to do so, subject to the following conditions:
798
+
799
+ The above copyright notice and this permission notice shall be included in all
800
+ copies or substantial portions of the Software.
801
+
802
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
803
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
804
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
805
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
806
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
807
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
808
+ SOFTWARE.
.venv/lib/python3.13/site-packages/charset_normalizer-3.4.7.dist-info/RECORD ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ../../../bin/normalizer,sha256=4gzKBgTzi3WHCt_-H2X_CLylJyNYnMojowe9wtWaJro,209
2
+ 81d243bd2c585b0f4821__mypyc.cpython-313-x86_64-linux-gnu.so,sha256=8IFjzHZXUFe_Uuixw6KwoASKFYoTQ-VwZw_nEV49sRM,433440
3
+ charset_normalizer-3.4.7.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
4
+ charset_normalizer-3.4.7.dist-info/METADATA,sha256=K8lK8L8LaZ1YmKvWLt3zEkpIxiCOC58xNhzFQrfQJxQ,40931
5
+ charset_normalizer-3.4.7.dist-info/RECORD,,
6
+ charset_normalizer-3.4.7.dist-info/WHEEL,sha256=4T7oOGCRuHVdSB-NrtoEAnRBz4FQJhZ3jEaYJ6MRp5c,190
7
+ charset_normalizer-3.4.7.dist-info/entry_points.txt,sha256=ADSTKrkXZ3hhdOVFi6DcUEHQRS0xfxDIE_pEz4wLIXA,65
8
+ charset_normalizer-3.4.7.dist-info/licenses/LICENSE,sha256=bQ1Bv-FwrGx9wkjJpj4lTQ-0WmDVCoJX0K-SxuJJuIc,1071
9
+ charset_normalizer-3.4.7.dist-info/top_level.txt,sha256=c_vZbitqecT2GfK3zdxSTLCn8C-6pGnHQY5o_5Y32M0,47
10
+ charset_normalizer/__init__.py,sha256=OKRxRv2Zhnqk00tqkN0c1BtJjm165fWXLydE52IKuHc,1590
11
+ charset_normalizer/__main__.py,sha256=yzYxMR-IhKRHYwcSlavEv8oGdwxsR89mr2X09qXGdps,109
12
+ charset_normalizer/__pycache__/__init__.cpython-313.pyc,,
13
+ charset_normalizer/__pycache__/__main__.cpython-313.pyc,,
14
+ charset_normalizer/__pycache__/api.cpython-313.pyc,,
15
+ charset_normalizer/__pycache__/cd.cpython-313.pyc,,
16
+ charset_normalizer/__pycache__/constant.cpython-313.pyc,,
17
+ charset_normalizer/__pycache__/legacy.cpython-313.pyc,,
18
+ charset_normalizer/__pycache__/md.cpython-313.pyc,,
19
+ charset_normalizer/__pycache__/models.cpython-313.pyc,,
20
+ charset_normalizer/__pycache__/utils.cpython-313.pyc,,
21
+ charset_normalizer/__pycache__/version.cpython-313.pyc,,
22
+ charset_normalizer/api.py,sha256=387F3n23MlMu-xfSbFULW2DLGsBmVrZVGhnkiGXeKBo,38844
23
+ charset_normalizer/cd.cpython-313-x86_64-linux-gnu.so,sha256=gOe65H__3O8_4a-aSVMB8gxHsRxVyQDUqqaIurPmIhE,15912
24
+ charset_normalizer/cd.py,sha256=v0iPJweGsRegXywrM1LzUgqW9bJ1KFvIblQHP1jm5FQ,15174
25
+ charset_normalizer/cli/__init__.py,sha256=D8I86lFk2-py45JvqxniTirSj_sFyE6sjaY_0-G1shc,136
26
+ charset_normalizer/cli/__main__.py,sha256=E9FFSV1E2iOE_B2B1tJHQT9ExJqc60Ks_c-08sNawh8,11940
27
+ charset_normalizer/cli/__pycache__/__init__.cpython-313.pyc,,
28
+ charset_normalizer/cli/__pycache__/__main__.cpython-313.pyc,,
29
+ charset_normalizer/constant.py,sha256=yvLAWDrdSC743Cu4amhwHLIO-FGuRTOTZouCzZKGikc,44431
30
+ charset_normalizer/legacy.py,sha256=yBIFMNABNPE5JkdKOWyVo36fZtV9nm8bf37LrDWulz8,2661
31
+ charset_normalizer/md.cpython-313-x86_64-linux-gnu.so,sha256=iYaQbya7NVRR7xg5FtK1yAKS5shmTFwmtkqqQbbvEWs,15912
32
+ charset_normalizer/md.py,sha256=AYCdfDX79FrgoId3zXqmbCuDcbGr1NRuGqgJN94Rx9Q,30441
33
+ charset_normalizer/models.py,sha256=FbaQnI6ECmVmyHRSvVM5fHNeMAQ3KSGdwLjGcQqWDws,12821
34
+ charset_normalizer/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
+ charset_normalizer/utils.py,sha256=9cpi-_0-vC9pGDfuoarhC6VlF_Jxwx5Jsa_8I4w2D8k,12282
36
+ charset_normalizer/version.py,sha256=2LxFuGp3BBuIwt95cp64y7v8bCNHcMAi08IfXt_47Co,115
.venv/lib/python3.13/site-packages/charset_normalizer-3.4.7.dist-info/WHEEL ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: false
4
+ Tag: cp313-cp313-manylinux_2_17_x86_64
5
+ Tag: cp313-cp313-manylinux2014_x86_64
6
+ Tag: cp313-cp313-manylinux_2_28_x86_64
7
+
.venv/lib/python3.13/site-packages/charset_normalizer-3.4.7.dist-info/entry_points.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [console_scripts]
2
+ normalizer = charset_normalizer.cli:cli_detect