xiaoanyu123 commited on
Commit
3581217
·
verified ·
1 Parent(s): 55e8cd3

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +2 -0
  2. pythonProject/.venv/Lib/site-packages/PyYAML-6.0.2.dist-info/INSTALLER +1 -0
  3. pythonProject/.venv/Lib/site-packages/PyYAML-6.0.2.dist-info/LICENSE +20 -0
  4. pythonProject/.venv/Lib/site-packages/PyYAML-6.0.2.dist-info/METADATA +46 -0
  5. pythonProject/.venv/Lib/site-packages/PyYAML-6.0.2.dist-info/RECORD +43 -0
  6. pythonProject/.venv/Lib/site-packages/PyYAML-6.0.2.dist-info/WHEEL +5 -0
  7. pythonProject/.venv/Lib/site-packages/PyYAML-6.0.2.dist-info/top_level.txt +2 -0
  8. pythonProject/.venv/Lib/site-packages/psutil-7.0.0.dist-info/INSTALLER +1 -0
  9. pythonProject/.venv/Lib/site-packages/psutil-7.0.0.dist-info/LICENSE +29 -0
  10. pythonProject/.venv/Lib/site-packages/psutil-7.0.0.dist-info/METADATA +551 -0
  11. pythonProject/.venv/Lib/site-packages/psutil-7.0.0.dist-info/RECORD +63 -0
  12. pythonProject/.venv/Lib/site-packages/psutil-7.0.0.dist-info/WHEEL +5 -0
  13. pythonProject/.venv/Lib/site-packages/psutil-7.0.0.dist-info/top_level.txt +1 -0
  14. pythonProject/.venv/Lib/site-packages/psutil/__pycache__/__init__.cpython-310.pyc +0 -0
  15. pythonProject/.venv/Lib/site-packages/regex-2025.9.1.dist-info/INSTALLER +1 -0
  16. pythonProject/.venv/Lib/site-packages/regex-2025.9.1.dist-info/METADATA +1059 -0
  17. pythonProject/.venv/Lib/site-packages/regex-2025.9.1.dist-info/RECORD +15 -0
  18. pythonProject/.venv/Lib/site-packages/regex-2025.9.1.dist-info/WHEEL +5 -0
  19. pythonProject/.venv/Lib/site-packages/regex-2025.9.1.dist-info/licenses/LICENSE.txt +208 -0
  20. pythonProject/.venv/Lib/site-packages/regex-2025.9.1.dist-info/top_level.txt +1 -0
  21. pythonProject/.venv/Lib/site-packages/regex/__init__.py +3 -0
  22. pythonProject/.venv/Lib/site-packages/regex/__pycache__/__init__.cpython-310.pyc +0 -0
  23. pythonProject/.venv/Lib/site-packages/regex/__pycache__/regex.cpython-310.pyc +0 -0
  24. pythonProject/.venv/Lib/site-packages/regex/_regex_core.py +0 -0
  25. pythonProject/.venv/Lib/site-packages/regex/regex.py +746 -0
  26. pythonProject/.venv/Lib/site-packages/regex/test_regex.py +0 -0
  27. pythonProject/.venv/Lib/site-packages/requests-2.32.5.dist-info/INSTALLER +1 -0
  28. pythonProject/.venv/Lib/site-packages/requests-2.32.5.dist-info/METADATA +133 -0
  29. pythonProject/.venv/Lib/site-packages/requests-2.32.5.dist-info/RECORD +42 -0
  30. pythonProject/.venv/Lib/site-packages/requests-2.32.5.dist-info/WHEEL +5 -0
  31. pythonProject/.venv/Lib/site-packages/requests-2.32.5.dist-info/licenses/LICENSE +175 -0
  32. pythonProject/.venv/Lib/site-packages/requests-2.32.5.dist-info/top_level.txt +1 -0
  33. pythonProject/.venv/Lib/site-packages/requests/__init__.py +184 -0
  34. pythonProject/.venv/Lib/site-packages/requests/__pycache__/__init__.cpython-310.pyc +0 -0
  35. pythonProject/.venv/Lib/site-packages/requests/__pycache__/__version__.cpython-310.pyc +0 -0
  36. pythonProject/.venv/Lib/site-packages/requests/__pycache__/_internal_utils.cpython-310.pyc +0 -0
  37. pythonProject/.venv/Lib/site-packages/requests/__pycache__/adapters.cpython-310.pyc +0 -0
  38. pythonProject/.venv/Lib/site-packages/requests/__pycache__/api.cpython-310.pyc +0 -0
  39. pythonProject/.venv/Lib/site-packages/requests/__pycache__/auth.cpython-310.pyc +0 -0
  40. pythonProject/.venv/Lib/site-packages/requests/__pycache__/certs.cpython-310.pyc +0 -0
  41. pythonProject/.venv/Lib/site-packages/requests/__pycache__/compat.cpython-310.pyc +0 -0
  42. pythonProject/.venv/Lib/site-packages/requests/__pycache__/cookies.cpython-310.pyc +0 -0
  43. pythonProject/.venv/Lib/site-packages/requests/__pycache__/exceptions.cpython-310.pyc +0 -0
  44. pythonProject/.venv/Lib/site-packages/requests/__pycache__/help.cpython-310.pyc +0 -0
  45. pythonProject/.venv/Lib/site-packages/requests/__pycache__/hooks.cpython-310.pyc +0 -0
  46. pythonProject/.venv/Lib/site-packages/requests/__pycache__/models.cpython-310.pyc +0 -0
  47. pythonProject/.venv/Lib/site-packages/requests/__pycache__/packages.cpython-310.pyc +0 -0
  48. pythonProject/.venv/Lib/site-packages/requests/__pycache__/sessions.cpython-310.pyc +0 -0
  49. pythonProject/.venv/Lib/site-packages/requests/__pycache__/status_codes.cpython-310.pyc +0 -0
  50. pythonProject/.venv/Lib/site-packages/requests/__pycache__/structures.cpython-310.pyc +0 -0
.gitattributes CHANGED
@@ -64,3 +64,5 @@ pythonProject/.venv/Lib/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpy
64
  pythonProject/.venv/Lib/site-packages/pkg_resources/_vendor/more_itertools/__pycache__/more.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
65
  pythonProject/.venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/core.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
66
  pythonProject/.venv/Lib/site-packages/pkg_resources/__pycache__/__init__.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
 
 
 
64
  pythonProject/.venv/Lib/site-packages/pkg_resources/_vendor/more_itertools/__pycache__/more.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
65
  pythonProject/.venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/__pycache__/core.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
66
  pythonProject/.venv/Lib/site-packages/pkg_resources/__pycache__/__init__.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
67
+ pythonProject/.venv/Lib/site-packages/setuptools/_vendor/more_itertools/__pycache__/more.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
68
+ pythonProject/.venv/Lib/site-packages/setuptools/_vendor/pyparsing/__pycache__/core.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
pythonProject/.venv/Lib/site-packages/PyYAML-6.0.2.dist-info/INSTALLER ADDED
@@ -0,0 +1 @@
 
 
1
+ pip
pythonProject/.venv/Lib/site-packages/PyYAML-6.0.2.dist-info/LICENSE ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2017-2021 Ingy döt Net
2
+ Copyright (c) 2006-2016 Kirill Simonov
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
5
+ this software and associated documentation files (the "Software"), to deal in
6
+ the Software without restriction, including without limitation the rights to
7
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8
+ of the Software, and to permit persons to whom the Software is furnished to do
9
+ so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
pythonProject/.venv/Lib/site-packages/PyYAML-6.0.2.dist-info/METADATA ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.1
2
+ Name: PyYAML
3
+ Version: 6.0.2
4
+ Summary: YAML parser and emitter for Python
5
+ Home-page: https://pyyaml.org/
6
+ Download-URL: https://pypi.org/project/PyYAML/
7
+ Author: Kirill Simonov
8
+ Author-email: xi@resolvent.net
9
+ License: MIT
10
+ Project-URL: Bug Tracker, https://github.com/yaml/pyyaml/issues
11
+ Project-URL: CI, https://github.com/yaml/pyyaml/actions
12
+ Project-URL: Documentation, https://pyyaml.org/wiki/PyYAMLDocumentation
13
+ Project-URL: Mailing lists, http://lists.sourceforge.net/lists/listinfo/yaml-core
14
+ Project-URL: Source Code, https://github.com/yaml/pyyaml
15
+ Platform: Any
16
+ Classifier: Development Status :: 5 - Production/Stable
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Cython
21
+ Classifier: Programming Language :: Python
22
+ Classifier: Programming Language :: Python :: 3
23
+ Classifier: Programming Language :: Python :: 3.8
24
+ Classifier: Programming Language :: Python :: 3.9
25
+ Classifier: Programming Language :: Python :: 3.10
26
+ Classifier: Programming Language :: Python :: 3.11
27
+ Classifier: Programming Language :: Python :: 3.12
28
+ Classifier: Programming Language :: Python :: 3.13
29
+ Classifier: Programming Language :: Python :: Implementation :: CPython
30
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
31
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
32
+ Classifier: Topic :: Text Processing :: Markup
33
+ Requires-Python: >=3.8
34
+ License-File: LICENSE
35
+
36
+ YAML is a data serialization format designed for human readability
37
+ and interaction with scripting languages. PyYAML is a YAML parser
38
+ and emitter for Python.
39
+
40
+ PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
41
+ support, capable extension API, and sensible error messages. PyYAML
42
+ supports standard YAML tags and provides Python-specific tags that
43
+ allow to represent an arbitrary Python object.
44
+
45
+ PyYAML is applicable for a broad range of tasks from complex
46
+ configuration files to object serialization and persistence.
pythonProject/.venv/Lib/site-packages/PyYAML-6.0.2.dist-info/RECORD ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ PyYAML-6.0.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2
+ PyYAML-6.0.2.dist-info/LICENSE,sha256=jTko-dxEkP1jVwfLiOsmvXZBAqcoKVQwfT5RZ6V36KQ,1101
3
+ PyYAML-6.0.2.dist-info/METADATA,sha256=9lwXqTOrXPts-jI2Lo5UwuaAYo0hiRA0BZqjch0WjAk,2106
4
+ PyYAML-6.0.2.dist-info/RECORD,,
5
+ PyYAML-6.0.2.dist-info/WHEEL,sha256=NqhLytidpiVMxVzCvxIrEoueiikLHpRZRJaZbBFhXVU,102
6
+ PyYAML-6.0.2.dist-info/top_level.txt,sha256=rpj0IVMTisAjh_1vG3Ccf9v5jpCQwAz6cD1IVU5ZdhQ,11
7
+ _yaml/__init__.py,sha256=04Ae_5osxahpJHa3XBZUAf4wi6XX32gR8D6X6p64GEA,1402
8
+ _yaml/__pycache__/__init__.cpython-310.pyc,,
9
+ yaml/__init__.py,sha256=N35S01HMesFTe0aRRMWkPj0Pa8IEbHpE9FK7cr5Bdtw,12311
10
+ yaml/__pycache__/__init__.cpython-310.pyc,,
11
+ yaml/__pycache__/composer.cpython-310.pyc,,
12
+ yaml/__pycache__/constructor.cpython-310.pyc,,
13
+ yaml/__pycache__/cyaml.cpython-310.pyc,,
14
+ yaml/__pycache__/dumper.cpython-310.pyc,,
15
+ yaml/__pycache__/emitter.cpython-310.pyc,,
16
+ yaml/__pycache__/error.cpython-310.pyc,,
17
+ yaml/__pycache__/events.cpython-310.pyc,,
18
+ yaml/__pycache__/loader.cpython-310.pyc,,
19
+ yaml/__pycache__/nodes.cpython-310.pyc,,
20
+ yaml/__pycache__/parser.cpython-310.pyc,,
21
+ yaml/__pycache__/reader.cpython-310.pyc,,
22
+ yaml/__pycache__/representer.cpython-310.pyc,,
23
+ yaml/__pycache__/resolver.cpython-310.pyc,,
24
+ yaml/__pycache__/scanner.cpython-310.pyc,,
25
+ yaml/__pycache__/serializer.cpython-310.pyc,,
26
+ yaml/__pycache__/tokens.cpython-310.pyc,,
27
+ yaml/_yaml.cp310-win_amd64.pyd,sha256=29_R5JeD0yo5gTPN2_Ijtkw7kdr69J-q7ZH2b462iyg,271872
28
+ yaml/composer.py,sha256=_Ko30Wr6eDWUeUpauUGT3Lcg9QPBnOPVlTnIMRGJ9FM,4883
29
+ yaml/constructor.py,sha256=kNgkfaeLUkwQYY_Q6Ff1Tz2XVw_pG1xVE9Ak7z-viLA,28639
30
+ yaml/cyaml.py,sha256=6ZrAG9fAYvdVe2FK_w0hmXoG7ZYsoYUwapG8CiC72H0,3851
31
+ yaml/dumper.py,sha256=PLctZlYwZLp7XmeUdwRuv4nYOZ2UBnDIUy8-lKfLF-o,2837
32
+ yaml/emitter.py,sha256=jghtaU7eFwg31bG0B7RZea_29Adi9CKmXq_QjgQpCkQ,43006
33
+ yaml/error.py,sha256=Ah9z-toHJUbE9j-M8YpxgSRM5CgLCcwVzJgLLRF2Fxo,2533
34
+ yaml/events.py,sha256=50_TksgQiE4up-lKo_V-nBy-tAIxkIPQxY5qDhKCeHw,2445
35
+ yaml/loader.py,sha256=UVa-zIqmkFSCIYq_PgSGm4NSJttHY2Rf_zQ4_b1fHN0,2061
36
+ yaml/nodes.py,sha256=gPKNj8pKCdh2d4gr3gIYINnPOaOxGhJAUiYhGRnPE84,1440
37
+ yaml/parser.py,sha256=ilWp5vvgoHFGzvOZDItFoGjD6D42nhlZrZyjAwa0oJo,25495
38
+ yaml/reader.py,sha256=0dmzirOiDG4Xo41RnuQS7K9rkY3xjHiVasfDMNTqCNw,6794
39
+ yaml/representer.py,sha256=IuWP-cAW9sHKEnS0gCqSa894k1Bg4cgTxaDwIcbRQ-Y,14190
40
+ yaml/resolver.py,sha256=9L-VYfm4mWHxUD1Vg4X7rjDRK_7VZd6b92wzq7Y2IKY,9004
41
+ yaml/scanner.py,sha256=YEM3iLZSaQwXcQRg2l2R4MdT0zGP2F9eHkKGKnHyWQY,51279
42
+ yaml/serializer.py,sha256=ChuFgmhU01hj4xgI8GaKv6vfM2Bujwa9i7d2FAHj7cA,4165
43
+ yaml/tokens.py,sha256=lTQIzSVw8Mg9wv459-TjiOQe6wVziqaRlqX2_89rp54,2573
pythonProject/.venv/Lib/site-packages/PyYAML-6.0.2.dist-info/WHEEL ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.44.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp310-cp310-win_amd64
5
+
pythonProject/.venv/Lib/site-packages/PyYAML-6.0.2.dist-info/top_level.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ _yaml
2
+ yaml
pythonProject/.venv/Lib/site-packages/psutil-7.0.0.dist-info/INSTALLER ADDED
@@ -0,0 +1 @@
 
 
1
+ pip
pythonProject/.venv/Lib/site-packages/psutil-7.0.0.dist-info/LICENSE ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2009, Jay Loden, Dave Daeschler, Giampaolo Rodola
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without modification,
7
+ are permitted provided that the following conditions are met:
8
+
9
+ * Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ * Neither the name of the psutil authors nor the names of its contributors
17
+ may be used to endorse or promote products derived from this software without
18
+ specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
24
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
pythonProject/.venv/Lib/site-packages/psutil-7.0.0.dist-info/METADATA ADDED
@@ -0,0 +1,551 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.1
2
+ Name: psutil
3
+ Version: 7.0.0
4
+ Summary: Cross-platform lib for process and system monitoring in Python. NOTE: the syntax of this script MUST be kept compatible with Python 2.7.
5
+ Home-page: https://github.com/giampaolo/psutil
6
+ Author: Giampaolo Rodola
7
+ Author-email: g.rodola@gmail.com
8
+ License: BSD-3-Clause
9
+ Keywords: ps,top,kill,free,lsof,netstat,nice,tty,ionice,uptime,taskmgr,process,df,iotop,iostat,ifconfig,taskset,who,pidof,pmap,smem,pstree,monitoring,ulimit,prlimit,smem,performance,metrics,agent,observability
10
+ Platform: Platform Independent
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Environment :: Console
13
+ Classifier: Environment :: Win32 (MS Windows)
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Information Technology
16
+ Classifier: Intended Audience :: System Administrators
17
+ Classifier: License :: OSI Approved :: BSD License
18
+ Classifier: Operating System :: MacOS :: MacOS X
19
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 10
20
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 7
21
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 8
22
+ Classifier: Operating System :: Microsoft :: Windows :: Windows 8.1
23
+ Classifier: Operating System :: Microsoft :: Windows :: Windows Server 2003
24
+ Classifier: Operating System :: Microsoft :: Windows :: Windows Server 2008
25
+ Classifier: Operating System :: Microsoft :: Windows :: Windows Vista
26
+ Classifier: Operating System :: Microsoft
27
+ Classifier: Operating System :: OS Independent
28
+ Classifier: Operating System :: POSIX :: AIX
29
+ Classifier: Operating System :: POSIX :: BSD :: FreeBSD
30
+ Classifier: Operating System :: POSIX :: BSD :: NetBSD
31
+ Classifier: Operating System :: POSIX :: BSD :: OpenBSD
32
+ Classifier: Operating System :: POSIX :: BSD
33
+ Classifier: Operating System :: POSIX :: Linux
34
+ Classifier: Operating System :: POSIX :: SunOS/Solaris
35
+ Classifier: Operating System :: POSIX
36
+ Classifier: Programming Language :: C
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: Implementation :: CPython
39
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
40
+ Classifier: Programming Language :: Python
41
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
42
+ Classifier: Topic :: Software Development :: Libraries
43
+ Classifier: Topic :: System :: Benchmark
44
+ Classifier: Topic :: System :: Hardware :: Hardware Drivers
45
+ Classifier: Topic :: System :: Hardware
46
+ Classifier: Topic :: System :: Monitoring
47
+ Classifier: Topic :: System :: Networking :: Monitoring :: Hardware Watchdog
48
+ Classifier: Topic :: System :: Networking :: Monitoring
49
+ Classifier: Topic :: System :: Networking
50
+ Classifier: Topic :: System :: Operating System
51
+ Classifier: Topic :: System :: Systems Administration
52
+ Classifier: Topic :: Utilities
53
+ Requires-Python: >=3.6
54
+ Description-Content-Type: text/x-rst
55
+ License-File: LICENSE
56
+ Provides-Extra: dev
57
+ Requires-Dist: pytest ; extra == 'dev'
58
+ Requires-Dist: pytest-xdist ; extra == 'dev'
59
+ Requires-Dist: setuptools ; extra == 'dev'
60
+ Requires-Dist: pywin32 ; extra == 'dev'
61
+ Requires-Dist: wheel ; extra == 'dev'
62
+ Requires-Dist: wmi ; extra == 'dev'
63
+ Requires-Dist: abi3audit ; extra == 'dev'
64
+ Requires-Dist: black ==24.10.0 ; extra == 'dev'
65
+ Requires-Dist: check-manifest ; extra == 'dev'
66
+ Requires-Dist: coverage ; extra == 'dev'
67
+ Requires-Dist: packaging ; extra == 'dev'
68
+ Requires-Dist: pylint ; extra == 'dev'
69
+ Requires-Dist: pyperf ; extra == 'dev'
70
+ Requires-Dist: pypinfo ; extra == 'dev'
71
+ Requires-Dist: pytest-cov ; extra == 'dev'
72
+ Requires-Dist: requests ; extra == 'dev'
73
+ Requires-Dist: rstcheck ; extra == 'dev'
74
+ Requires-Dist: ruff ; extra == 'dev'
75
+ Requires-Dist: sphinx ; extra == 'dev'
76
+ Requires-Dist: sphinx-rtd-theme ; extra == 'dev'
77
+ Requires-Dist: toml-sort ; extra == 'dev'
78
+ Requires-Dist: twine ; extra == 'dev'
79
+ Requires-Dist: virtualenv ; extra == 'dev'
80
+ Requires-Dist: vulture ; extra == 'dev'
81
+ Requires-Dist: pyreadline ; extra == 'dev'
82
+ Requires-Dist: pdbpp ; extra == 'dev'
83
+ Provides-Extra: test
84
+ Requires-Dist: pytest ; extra == 'test'
85
+ Requires-Dist: pytest-xdist ; extra == 'test'
86
+ Requires-Dist: setuptools ; extra == 'test'
87
+ Requires-Dist: pywin32 ; extra == 'test'
88
+ Requires-Dist: wheel ; extra == 'test'
89
+ Requires-Dist: wmi ; extra == 'test'
90
+
91
+ | |downloads| |stars| |forks| |contributors| |coverage|
92
+ | |version| |py-versions| |packages| |license|
93
+ | |github-actions-wheels| |github-actions-bsd| |doc| |twitter| |tidelift|
94
+
95
+ .. |downloads| image:: https://img.shields.io/pypi/dm/psutil.svg
96
+ :target: https://pepy.tech/project/psutil
97
+ :alt: Downloads
98
+
99
+ .. |stars| image:: https://img.shields.io/github/stars/giampaolo/psutil.svg
100
+ :target: https://github.com/giampaolo/psutil/stargazers
101
+ :alt: Github stars
102
+
103
+ .. |forks| image:: https://img.shields.io/github/forks/giampaolo/psutil.svg
104
+ :target: https://github.com/giampaolo/psutil/network/members
105
+ :alt: Github forks
106
+
107
+ .. |contributors| image:: https://img.shields.io/github/contributors/giampaolo/psutil.svg
108
+ :target: https://github.com/giampaolo/psutil/graphs/contributors
109
+ :alt: Contributors
110
+
111
+ .. |github-actions-wheels| image:: https://img.shields.io/github/actions/workflow/status/giampaolo/psutil/.github/workflows/build.yml.svg?label=Linux%2C%20macOS%2C%20Windows
112
+ :target: https://github.com/giampaolo/psutil/actions?query=workflow%3Abuild
113
+ :alt: Linux, macOS, Windows
114
+
115
+ .. |github-actions-bsd| image:: https://img.shields.io/github/actions/workflow/status/giampaolo/psutil/.github/workflows/bsd.yml.svg?label=FreeBSD,%20NetBSD,%20OpenBSD
116
+ :target: https://github.com/giampaolo/psutil/actions?query=workflow%3Absd-tests
117
+ :alt: FreeBSD, NetBSD, OpenBSD
118
+
119
+ .. |coverage| image:: https://coveralls.io/repos/github/giampaolo/psutil/badge.svg?branch=master
120
+ :target: https://coveralls.io/github/giampaolo/psutil?branch=master
121
+ :alt: Test coverage (coverall.io)
122
+
123
+ .. |doc| image:: https://readthedocs.org/projects/psutil/badge/?version=latest
124
+ :target: https://psutil.readthedocs.io/en/latest/
125
+ :alt: Documentation Status
126
+
127
+ .. |version| image:: https://img.shields.io/pypi/v/psutil.svg?label=pypi
128
+ :target: https://pypi.org/project/psutil
129
+ :alt: Latest version
130
+
131
+ .. |py-versions| image:: https://img.shields.io/pypi/pyversions/psutil.svg
132
+ :alt: Supported Python versions
133
+
134
+ .. |packages| image:: https://repology.org/badge/tiny-repos/python:psutil.svg
135
+ :target: https://repology.org/metapackage/python:psutil/versions
136
+ :alt: Binary packages
137
+
138
+ .. |license| image:: https://img.shields.io/pypi/l/psutil.svg
139
+ :target: https://github.com/giampaolo/psutil/blob/master/LICENSE
140
+ :alt: License
141
+
142
+ .. |twitter| image:: https://img.shields.io/twitter/follow/grodola.svg?label=follow&style=flat&logo=twitter&logoColor=4FADFF
143
+ :target: https://twitter.com/grodola
144
+ :alt: Twitter Follow
145
+
146
+ .. |tidelift| image:: https://tidelift.com/badges/github/giampaolo/psutil?style=flat
147
+ :target: https://tidelift.com/subscription/pkg/pypi-psutil?utm_source=pypi-psutil&utm_medium=referral&utm_campaign=readme
148
+ :alt: Tidelift
149
+
150
+ -----
151
+
152
+ Quick links
153
+ ===========
154
+
155
+ - `Home page <https://github.com/giampaolo/psutil>`_
156
+ - `Install <https://github.com/giampaolo/psutil/blob/master/INSTALL.rst>`_
157
+ - `Documentation <http://psutil.readthedocs.io>`_
158
+ - `Download <https://pypi.org/project/psutil/#files>`_
159
+ - `Forum <http://groups.google.com/group/psutil/topics>`_
160
+ - `StackOverflow <https://stackoverflow.com/questions/tagged/psutil>`_
161
+ - `Blog <https://gmpy.dev/tags/psutil>`_
162
+ - `What's new <https://github.com/giampaolo/psutil/blob/master/HISTORY.rst>`_
163
+
164
+
165
+ Summary
166
+ =======
167
+
168
+ psutil (process and system utilities) is a cross-platform library for
169
+ retrieving information on **running processes** and **system utilization**
170
+ (CPU, memory, disks, network, sensors) in Python.
171
+ It is useful mainly for **system monitoring**, **profiling and limiting process
172
+ resources** and **management of running processes**.
173
+ It implements many functionalities offered by classic UNIX command line tools
174
+ such as *ps, top, iotop, lsof, netstat, ifconfig, free* and others.
175
+ psutil currently supports the following platforms:
176
+
177
+ - **Linux**
178
+ - **Windows**
179
+ - **macOS**
180
+ - **FreeBSD, OpenBSD**, **NetBSD**
181
+ - **Sun Solaris**
182
+ - **AIX**
183
+
184
+ Supported Python versions are cPython 3.6+ and `PyPy <https://pypy.org/>`__.
185
+ Latest psutil version supporting Python 2.7 is
186
+ `psutil 6.1.1 <https://pypi.org/project/psutil/6.1.1/>`__.
187
+
188
+ Funding
189
+ =======
190
+
191
+ While psutil is free software and will always be, the project would benefit
192
+ immensely from some funding.
193
+ Keeping up with bug reports and maintenance has become hardly sustainable for
194
+ me alone in terms of time.
195
+ If you're a company that's making significant use of psutil you can consider
196
+ becoming a sponsor via `GitHub Sponsors <https://github.com/sponsors/giampaolo>`__,
197
+ `Open Collective <https://opencollective.com/psutil>`__ or
198
+ `PayPal <https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A9ZS7PKKRM3S8>`__
199
+ and have your logo displayed in here and psutil `doc <https://psutil.readthedocs.io>`__.
200
+
201
+ Sponsors
202
+ ========
203
+
204
+ .. image:: https://github.com/giampaolo/psutil/raw/master/docs/_static/tidelift-logo.png
205
+ :width: 200
206
+ :alt: Alternative text
207
+
208
+ `Add your logo <https://github.com/sponsors/giampaolo>`__.
209
+
210
+ Example usages
211
+ ==============
212
+
213
+ This represents pretty much the whole psutil API.
214
+
215
+ CPU
216
+ ---
217
+
218
+ .. code-block:: python
219
+
220
+ >>> import psutil
221
+ >>>
222
+ >>> psutil.cpu_times()
223
+ scputimes(user=3961.46, nice=169.729, system=2150.659, idle=16900.540, iowait=629.59, irq=0.0, softirq=19.42, steal=0.0, guest=0, guest_nice=0.0)
224
+ >>>
225
+ >>> for x in range(3):
226
+ ... psutil.cpu_percent(interval=1)
227
+ ...
228
+ 4.0
229
+ 5.9
230
+ 3.8
231
+ >>>
232
+ >>> for x in range(3):
233
+ ... psutil.cpu_percent(interval=1, percpu=True)
234
+ ...
235
+ [4.0, 6.9, 3.7, 9.2]
236
+ [7.0, 8.5, 2.4, 2.1]
237
+ [1.2, 9.0, 9.9, 7.2]
238
+ >>>
239
+ >>> for x in range(3):
240
+ ... psutil.cpu_times_percent(interval=1, percpu=False)
241
+ ...
242
+ scputimes(user=1.5, nice=0.0, system=0.5, idle=96.5, iowait=1.5, irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0)
243
+ scputimes(user=1.0, nice=0.0, system=0.0, idle=99.0, iowait=0.0, irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0)
244
+ scputimes(user=2.0, nice=0.0, system=0.0, idle=98.0, iowait=0.0, irq=0.0, softirq=0.0, steal=0.0, guest=0.0, guest_nice=0.0)
245
+ >>>
246
+ >>> psutil.cpu_count()
247
+ 4
248
+ >>> psutil.cpu_count(logical=False)
249
+ 2
250
+ >>>
251
+ >>> psutil.cpu_stats()
252
+ scpustats(ctx_switches=20455687, interrupts=6598984, soft_interrupts=2134212, syscalls=0)
253
+ >>>
254
+ >>> psutil.cpu_freq()
255
+ scpufreq(current=931.42925, min=800.0, max=3500.0)
256
+ >>>
257
+ >>> psutil.getloadavg() # also on Windows (emulated)
258
+ (3.14, 3.89, 4.67)
259
+
260
+ Memory
261
+ ------
262
+
263
+ .. code-block:: python
264
+
265
+ >>> psutil.virtual_memory()
266
+ svmem(total=10367352832, available=6472179712, percent=37.6, used=8186245120, free=2181107712, active=4748992512, inactive=2758115328, buffers=790724608, cached=3500347392, shared=787554304)
267
+ >>> psutil.swap_memory()
268
+ sswap(total=2097147904, used=296128512, free=1801019392, percent=14.1, sin=304193536, sout=677842944)
269
+ >>>
270
+
271
+ Disks
272
+ -----
273
+
274
+ .. code-block:: python
275
+
276
+ >>> psutil.disk_partitions()
277
+ [sdiskpart(device='/dev/sda1', mountpoint='/', fstype='ext4', opts='rw,nosuid'),
278
+ sdiskpart(device='/dev/sda2', mountpoint='/home', fstype='ext', opts='rw')]
279
+ >>>
280
+ >>> psutil.disk_usage('/')
281
+ sdiskusage(total=21378641920, used=4809781248, free=15482871808, percent=22.5)
282
+ >>>
283
+ >>> psutil.disk_io_counters(perdisk=False)
284
+ sdiskio(read_count=719566, write_count=1082197, read_bytes=18626220032, write_bytes=24081764352, read_time=5023392, write_time=63199568, read_merged_count=619166, write_merged_count=812396, busy_time=4523412)
285
+ >>>
286
+
287
+ Network
288
+ -------
289
+
290
+ .. code-block:: python
291
+
292
+ >>> psutil.net_io_counters(pernic=True)
293
+ {'eth0': netio(bytes_sent=485291293, bytes_recv=6004858642, packets_sent=3251564, packets_recv=4787798, errin=0, errout=0, dropin=0, dropout=0),
294
+ 'lo': netio(bytes_sent=2838627, bytes_recv=2838627, packets_sent=30567, packets_recv=30567, errin=0, errout=0, dropin=0, dropout=0)}
295
+ >>>
296
+ >>> psutil.net_connections(kind='tcp')
297
+ [sconn(fd=115, family=<AddressFamily.AF_INET: 2>, type=<SocketType.SOCK_STREAM: 1>, laddr=addr(ip='10.0.0.1', port=48776), raddr=addr(ip='93.186.135.91', port=80), status='ESTABLISHED', pid=1254),
298
+ sconn(fd=117, family=<AddressFamily.AF_INET: 2>, type=<SocketType.SOCK_STREAM: 1>, laddr=addr(ip='10.0.0.1', port=43761), raddr=addr(ip='72.14.234.100', port=80), status='CLOSING', pid=2987),
299
+ ...]
300
+ >>>
301
+ >>> psutil.net_if_addrs()
302
+ {'lo': [snicaddr(family=<AddressFamily.AF_INET: 2>, address='127.0.0.1', netmask='255.0.0.0', broadcast='127.0.0.1', ptp=None),
303
+ snicaddr(family=<AddressFamily.AF_INET6: 10>, address='::1', netmask='ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', broadcast=None, ptp=None),
304
+ snicaddr(family=<AddressFamily.AF_LINK: 17>, address='00:00:00:00:00:00', netmask=None, broadcast='00:00:00:00:00:00', ptp=None)],
305
+ 'wlan0': [snicaddr(family=<AddressFamily.AF_INET: 2>, address='192.168.1.3', netmask='255.255.255.0', broadcast='192.168.1.255', ptp=None),
306
+ snicaddr(family=<AddressFamily.AF_INET6: 10>, address='fe80::c685:8ff:fe45:641%wlan0', netmask='ffff:ffff:ffff:ffff::', broadcast=None, ptp=None),
307
+ snicaddr(family=<AddressFamily.AF_LINK: 17>, address='c4:85:08:45:06:41', netmask=None, broadcast='ff:ff:ff:ff:ff:ff', ptp=None)]}
308
+ >>>
309
+ >>> psutil.net_if_stats()
310
+ {'lo': snicstats(isup=True, duplex=<NicDuplex.NIC_DUPLEX_UNKNOWN: 0>, speed=0, mtu=65536, flags='up,loopback,running'),
311
+ 'wlan0': snicstats(isup=True, duplex=<NicDuplex.NIC_DUPLEX_FULL: 2>, speed=100, mtu=1500, flags='up,broadcast,running,multicast')}
312
+ >>>
313
+
314
+ Sensors
315
+ -------
316
+
317
+ .. code-block:: python
318
+
319
+ >>> import psutil
320
+ >>> psutil.sensors_temperatures()
321
+ {'acpitz': [shwtemp(label='', current=47.0, high=103.0, critical=103.0)],
322
+ 'asus': [shwtemp(label='', current=47.0, high=None, critical=None)],
323
+ 'coretemp': [shwtemp(label='Physical id 0', current=52.0, high=100.0, critical=100.0),
324
+ shwtemp(label='Core 0', current=45.0, high=100.0, critical=100.0)]}
325
+ >>>
326
+ >>> psutil.sensors_fans()
327
+ {'asus': [sfan(label='cpu_fan', current=3200)]}
328
+ >>>
329
+ >>> psutil.sensors_battery()
330
+ sbattery(percent=93, secsleft=16628, power_plugged=False)
331
+ >>>
332
+
333
+ Other system info
334
+ -----------------
335
+
336
+ .. code-block:: python
337
+
338
+ >>> import psutil
339
+ >>> psutil.users()
340
+ [suser(name='giampaolo', terminal='pts/2', host='localhost', started=1340737536.0, pid=1352),
341
+ suser(name='giampaolo', terminal='pts/3', host='localhost', started=1340737792.0, pid=1788)]
342
+ >>>
343
+ >>> psutil.boot_time()
344
+ 1365519115.0
345
+ >>>
346
+
347
+ Process management
348
+ ------------------
349
+
350
+ .. code-block:: python
351
+
352
+ >>> import psutil
353
+ >>> psutil.pids()
354
+ [1, 2, 3, 4, 5, 6, 7, 46, 48, 50, 51, 178, 182, 222, 223, 224, 268, 1215,
355
+ 1216, 1220, 1221, 1243, 1244, 1301, 1601, 2237, 2355, 2637, 2774, 3932,
356
+ 4176, 4177, 4185, 4187, 4189, 4225, 4243, 4245, 4263, 4282, 4306, 4311,
357
+ 4312, 4313, 4314, 4337, 4339, 4357, 4358, 4363, 4383, 4395, 4408, 4433,
358
+ 4443, 4445, 4446, 5167, 5234, 5235, 5252, 5318, 5424, 5644, 6987, 7054,
359
+ 7055, 7071]
360
+ >>>
361
+ >>> p = psutil.Process(7055)
362
+ >>> p
363
+ psutil.Process(pid=7055, name='python3', status='running', started='09:04:44')
364
+ >>> p.pid
365
+ 7055
366
+ >>> p.name()
367
+ 'python3'
368
+ >>> p.exe()
369
+ '/usr/bin/python3'
370
+ >>> p.cwd()
371
+ '/home/giampaolo'
372
+ >>> p.cmdline()
373
+ ['/usr/bin/python3', 'main.py']
374
+ >>>
375
+ >>> p.ppid()
376
+ 7054
377
+ >>> p.parent()
378
+ psutil.Process(pid=4699, name='bash', status='sleeping', started='09:06:44')
379
+ >>> p.parents()
380
+ [psutil.Process(pid=4699, name='bash', started='09:06:44'),
381
+ psutil.Process(pid=4689, name='gnome-terminal-server', status='sleeping', started='0:06:44'),
382
+ psutil.Process(pid=1, name='systemd', status='sleeping', started='05:56:55')]
383
+ >>> p.children(recursive=True)
384
+ [psutil.Process(pid=29835, name='python3', status='sleeping', started='11:45:38'),
385
+ psutil.Process(pid=29836, name='python3', status='waking', started='11:43:39')]
386
+ >>>
387
+ >>> p.status()
388
+ 'running'
389
+ >>> p.create_time()
390
+ 1267551141.5019531
391
+ >>> p.terminal()
392
+ '/dev/pts/0'
393
+ >>>
394
+ >>> p.username()
395
+ 'giampaolo'
396
+ >>> p.uids()
397
+ puids(real=1000, effective=1000, saved=1000)
398
+ >>> p.gids()
399
+ pgids(real=1000, effective=1000, saved=1000)
400
+ >>>
401
+ >>> p.cpu_times()
402
+ pcputimes(user=1.02, system=0.31, children_user=0.32, children_system=0.1, iowait=0.0)
403
+ >>> p.cpu_percent(interval=1.0)
404
+ 12.1
405
+ >>> p.cpu_affinity()
406
+ [0, 1, 2, 3]
407
+ >>> p.cpu_affinity([0, 1]) # set
408
+ >>> p.cpu_num()
409
+ 1
410
+ >>>
411
+ >>> p.memory_info()
412
+ pmem(rss=10915840, vms=67608576, shared=3313664, text=2310144, lib=0, data=7262208, dirty=0)
413
+ >>> p.memory_full_info() # "real" USS memory usage (Linux, macOS, Win only)
414
+ pfullmem(rss=10199040, vms=52133888, shared=3887104, text=2867200, lib=0, data=5967872, dirty=0, uss=6545408, pss=6872064, swap=0)
415
+ >>> p.memory_percent()
416
+ 0.7823
417
+ >>> p.memory_maps()
418
+ [pmmap_grouped(path='/lib/x8664-linux-gnu/libutil-2.15.so', rss=32768, size=2125824, pss=32768, shared_clean=0, shared_dirty=0, private_clean=20480, private_dirty=12288, referenced=32768, anonymous=12288, swap=0),
419
+ pmmap_grouped(path='/lib/x8664-linux-gnu/libc-2.15.so', rss=3821568, size=3842048, pss=3821568, shared_clean=0, shared_dirty=0, private_clean=0, private_dirty=3821568, referenced=3575808, anonymous=3821568, swap=0),
420
+ pmmap_grouped(path='[heap]', rss=32768, size=139264, pss=32768, shared_clean=0, shared_dirty=0, private_clean=0, private_dirty=32768, referenced=32768, anonymous=32768, swap=0),
421
+ pmmap_grouped(path='[stack]', rss=2465792, size=2494464, pss=2465792, shared_clean=0, shared_dirty=0, private_clean=0, private_dirty=2465792, referenced=2277376, anonymous=2465792, swap=0),
422
+ ...]
423
+ >>>
424
+ >>> p.io_counters()
425
+ pio(read_count=478001, write_count=59371, read_bytes=700416, write_bytes=69632, read_chars=456232, write_chars=517543)
426
+ >>>
427
+ >>> p.open_files()
428
+ [popenfile(path='/home/giampaolo/monit.py', fd=3, position=0, mode='r', flags=32768),
429
+ popenfile(path='/var/log/monit.log', fd=4, position=235542, mode='a', flags=33793)]
430
+ >>>
431
+ >>> p.net_connections(kind='tcp')
432
+ [pconn(fd=115, family=<AddressFamily.AF_INET: 2>, type=<SocketType.SOCK_STREAM: 1>, laddr=addr(ip='10.0.0.1', port=48776), raddr=addr(ip='93.186.135.91', port=80), status='ESTABLISHED'),
433
+ pconn(fd=117, family=<AddressFamily.AF_INET: 2>, type=<SocketType.SOCK_STREAM: 1>, laddr=addr(ip='10.0.0.1', port=43761), raddr=addr(ip='72.14.234.100', port=80), status='CLOSING')]
434
+ >>>
435
+ >>> p.threads()
436
+ [pthread(id=5234, user_time=22.5, system_time=9.2891),
437
+ pthread(id=5237, user_time=0.0707, system_time=1.1)]
438
+ >>>
439
+ >>> p.num_threads()
440
+ 4
441
+ >>> p.num_fds()
442
+ 8
443
+ >>> p.num_ctx_switches()
444
+ pctxsw(voluntary=78, involuntary=19)
445
+ >>>
446
+ >>> p.nice()
447
+ 0
448
+ >>> p.nice(10) # set
449
+ >>>
450
+ >>> p.ionice(psutil.IOPRIO_CLASS_IDLE) # IO priority (Win and Linux only)
451
+ >>> p.ionice()
452
+ pionice(ioclass=<IOPriority.IOPRIO_CLASS_IDLE: 3>, value=0)
453
+ >>>
454
+ >>> p.rlimit(psutil.RLIMIT_NOFILE, (5, 5)) # set resource limits (Linux only)
455
+ >>> p.rlimit(psutil.RLIMIT_NOFILE)
456
+ (5, 5)
457
+ >>>
458
+ >>> p.environ()
459
+ {'LC_PAPER': 'it_IT.UTF-8', 'SHELL': '/bin/bash', 'GREP_OPTIONS': '--color=auto',
460
+ 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg',
461
+ ...}
462
+ >>>
463
+ >>> p.as_dict()
464
+ {'status': 'running', 'num_ctx_switches': pctxsw(voluntary=63, involuntary=1), 'pid': 5457, ...}
465
+ >>> p.is_running()
466
+ True
467
+ >>> p.suspend()
468
+ >>> p.resume()
469
+ >>>
470
+ >>> p.terminate()
471
+ >>> p.kill()
472
+ >>> p.wait(timeout=3)
473
+ <Exitcode.EX_OK: 0>
474
+ >>>
475
+ >>> psutil.test()
476
+ USER PID %CPU %MEM VSZ RSS TTY START TIME COMMAND
477
+ root 1 0.0 0.0 24584 2240 Jun17 00:00 init
478
+ root 2 0.0 0.0 0 0 Jun17 00:00 kthreadd
479
+ ...
480
+ giampaolo 31475 0.0 0.0 20760 3024 /dev/pts/0 Jun19 00:00 python2.4
481
+ giampaolo 31721 0.0 2.2 773060 181896 00:04 10:30 chrome
482
+ root 31763 0.0 0.0 0 0 00:05 00:00 kworker/0:1
483
+ >>>
484
+
485
+ Further process APIs
486
+ --------------------
487
+
488
+ .. code-block:: python
489
+
490
+ >>> import psutil
491
+ >>> for proc in psutil.process_iter(['pid', 'name']):
492
+ ... print(proc.info)
493
+ ...
494
+ {'pid': 1, 'name': 'systemd'}
495
+ {'pid': 2, 'name': 'kthreadd'}
496
+ {'pid': 3, 'name': 'ksoftirqd/0'}
497
+ ...
498
+ >>>
499
+ >>> psutil.pid_exists(3)
500
+ True
501
+ >>>
502
+ >>> def on_terminate(proc):
503
+ ... print("process {} terminated".format(proc))
504
+ ...
505
+ >>> # waits for multiple processes to terminate
506
+ >>> gone, alive = psutil.wait_procs(procs_list, timeout=3, callback=on_terminate)
507
+ >>>
508
+
509
+ Windows services
510
+ ----------------
511
+
512
+ .. code-block:: python
513
+
514
+ >>> list(psutil.win_service_iter())
515
+ [<WindowsService(name='AeLookupSvc', display_name='Application Experience') at 38850096>,
516
+ <WindowsService(name='ALG', display_name='Application Layer Gateway Service') at 38850128>,
517
+ <WindowsService(name='APNMCP', display_name='Ask Update Service') at 38850160>,
518
+ <WindowsService(name='AppIDSvc', display_name='Application Identity') at 38850192>,
519
+ ...]
520
+ >>> s = psutil.win_service_get('alg')
521
+ >>> s.as_dict()
522
+ {'binpath': 'C:\\Windows\\System32\\alg.exe',
523
+ 'description': 'Provides support for 3rd party protocol plug-ins for Internet Connection Sharing',
524
+ 'display_name': 'Application Layer Gateway Service',
525
+ 'name': 'alg',
526
+ 'pid': None,
527
+ 'start_type': 'manual',
528
+ 'status': 'stopped',
529
+ 'username': 'NT AUTHORITY\\LocalService'}
530
+
531
+ Projects using psutil
532
+ =====================
533
+
534
+ Here's some I find particularly interesting:
535
+
536
+ - https://github.com/google/grr
537
+ - https://github.com/facebook/osquery/
538
+ - https://github.com/nicolargo/glances
539
+ - https://github.com/aristocratos/bpytop
540
+ - https://github.com/Jahaja/psdash
541
+ - https://github.com/ajenti/ajenti
542
+ - https://github.com/home-assistant/home-assistant/
543
+
544
+ Portings
545
+ ========
546
+
547
+ - Go: https://github.com/shirou/gopsutil
548
+ - C: https://github.com/hamon-in/cpslib
549
+ - Rust: https://github.com/rust-psutil/rust-psutil
550
+ - Nim: https://github.com/johnscillieri/psutil-nim
551
+
pythonProject/.venv/Lib/site-packages/psutil-7.0.0.dist-info/RECORD ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ psutil-7.0.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2
+ psutil-7.0.0.dist-info/LICENSE,sha256=x63E1dEzelSLlnQh8fviWLkwM6BBdwj9b044-Oy864A,1577
3
+ psutil-7.0.0.dist-info/METADATA,sha256=jEGY38opff7gdO5GOUIH8xeWXCXcGvitOIYrlUeVp8E,23136
4
+ psutil-7.0.0.dist-info/RECORD,,
5
+ psutil-7.0.0.dist-info/WHEEL,sha256=-EX5DQzNGQEoyL99Q-0P0-D-CXbfqafenaAeiSQ_Ufk,100
6
+ psutil-7.0.0.dist-info/top_level.txt,sha256=gCNhn57wzksDjSAISmgMJ0aiXzQulk0GJhb2-BAyYgw,7
7
+ psutil/__init__.py,sha256=lvZWdYQ3W0flcZeW1vbN5QgoSHuqofXBnMxHZLzwgrU,89075
8
+ psutil/__pycache__/__init__.cpython-310.pyc,,
9
+ psutil/__pycache__/_common.cpython-310.pyc,,
10
+ psutil/__pycache__/_psaix.cpython-310.pyc,,
11
+ psutil/__pycache__/_psbsd.cpython-310.pyc,,
12
+ psutil/__pycache__/_pslinux.cpython-310.pyc,,
13
+ psutil/__pycache__/_psosx.cpython-310.pyc,,
14
+ psutil/__pycache__/_psposix.cpython-310.pyc,,
15
+ psutil/__pycache__/_pssunos.cpython-310.pyc,,
16
+ psutil/__pycache__/_pswindows.cpython-310.pyc,,
17
+ psutil/_common.py,sha256=tPE7YVzC0ZIBhZzYdzqOFnh-geJVALbyBY3TSAwASXw,29592
18
+ psutil/_psaix.py,sha256=CFBLwUi8DR5KsDC0yCs0jlLtLf2dhhyGArAhG_udqK8,18817
19
+ psutil/_psbsd.py,sha256=UXd-QXUVk_H_wbFHWt2vshcChWxBrPwn38PX0HeYXfo,32727
20
+ psutil/_pslinux.py,sha256=wKT1c3HX8XhnZ8sDNX1hiKRbVj7p53ASJ6VaniKaxs4,88323
21
+ psutil/_psosx.py,sha256=LwFP6AtKp2hzNWRSaSLaWHB6nh1CiKSMu_KvP5009IE,16421
22
+ psutil/_psposix.py,sha256=AJxyaRPf1h8dyT9rnsF8c-psHwXEbKqaNEt3OOm4Zuk,7349
23
+ psutil/_pssunos.py,sha256=B58FY4JjbfndrdmbEV7QGX6lVi0v--V-g_Hxsg958MM,25654
24
+ psutil/_psutil_windows.pyd,sha256=nH_IVdnRYU5wcFx9zG9Kw83Kta3-tqZ9OC9a3gnq3BU,67072
25
+ psutil/_pswindows.py,sha256=is_Cq3yMuFnqGUfpOeiU8oWzZQNWmK_-Xt7asb8YCu4,37052
26
+ psutil/tests/__init__.py,sha256=tFfa1RqnPJP9UuVe-JN7sAavHVoHlmqiN0pyk3I4KI0,66129
27
+ psutil/tests/__main__.py,sha256=AQDwErrSFPsBGSY5wIKmh7LziqWTAARYKEqz_zrXMTc,321
28
+ psutil/tests/__pycache__/__init__.cpython-310.pyc,,
29
+ psutil/tests/__pycache__/__main__.cpython-310.pyc,,
30
+ psutil/tests/__pycache__/test_aix.cpython-310.pyc,,
31
+ psutil/tests/__pycache__/test_bsd.cpython-310.pyc,,
32
+ psutil/tests/__pycache__/test_connections.cpython-310.pyc,,
33
+ psutil/tests/__pycache__/test_contracts.cpython-310.pyc,,
34
+ psutil/tests/__pycache__/test_linux.cpython-310.pyc,,
35
+ psutil/tests/__pycache__/test_memleaks.cpython-310.pyc,,
36
+ psutil/tests/__pycache__/test_misc.cpython-310.pyc,,
37
+ psutil/tests/__pycache__/test_osx.cpython-310.pyc,,
38
+ psutil/tests/__pycache__/test_posix.cpython-310.pyc,,
39
+ psutil/tests/__pycache__/test_process.cpython-310.pyc,,
40
+ psutil/tests/__pycache__/test_process_all.cpython-310.pyc,,
41
+ psutil/tests/__pycache__/test_scripts.cpython-310.pyc,,
42
+ psutil/tests/__pycache__/test_sunos.cpython-310.pyc,,
43
+ psutil/tests/__pycache__/test_system.cpython-310.pyc,,
44
+ psutil/tests/__pycache__/test_testutils.cpython-310.pyc,,
45
+ psutil/tests/__pycache__/test_unicode.cpython-310.pyc,,
46
+ psutil/tests/__pycache__/test_windows.cpython-310.pyc,,
47
+ psutil/tests/test_aix.py,sha256=M84ZfM1EeSDRyzrf404JGu5zy_ErRn5MK3t3yT11lz0,4550
48
+ psutil/tests/test_bsd.py,sha256=GRbzguegV7K2m-O4dQJlUJGh7M7UH9fI8jvE2UjFOks,20784
49
+ psutil/tests/test_connections.py,sha256=1D4HEQl_bZfZbk_4g-hc4rnrDqUD7q42rb9aIoJ1Amc,21723
50
+ psutil/tests/test_contracts.py,sha256=8enorS1KmOftKyC4XTINXtnWNnmh18qFEYdLHKtrknY,12326
51
+ psutil/tests/test_linux.py,sha256=Gap-GA6Bv9TfKbRupph49NwZC0vjv1V5isa5l-Eg3VY,91187
52
+ psutil/tests/test_memleaks.py,sha256=yGEhTOOllW2NV-R2S5lybD2S8iO9CiS7--ND2E9rZTY,15608
53
+ psutil/tests/test_misc.py,sha256=eQUmQqnh7nM0aIND_yOtgO4-Lwyspw3tgt3aWje0BPY,30545
54
+ psutil/tests/test_osx.py,sha256=Y_NubjMylA88A7WAepiDkYTZl4YWvwgtCRFvu23Rm8A,6512
55
+ psutil/tests/test_posix.py,sha256=yKL9N6ixiFUPNmv5v7cBS1OaoOZl-bm7hGdf7m2_M0E,17675
56
+ psutil/tests/test_process.py,sha256=lmVD9FO6GJp4GZqSxR0j4Wsr7dcG8Py2qWsiv-furbY,61548
57
+ psutil/tests/test_process_all.py,sha256=MfKc2BpL3pFBKqdmkq5gJ1GDD4CZzxUvesQ7sgnzzJg,18882
58
+ psutil/tests/test_scripts.py,sha256=a3z4vFdBNlto_2pKe37kOPK6zVenfWzCsibduzyeO1c,7965
59
+ psutil/tests/test_sunos.py,sha256=FxIAhIC3hycvJhgdVK8_98AmmV1pTZgXtovBgDmD9RA,1229
60
+ psutil/tests/test_system.py,sha256=gi5Mci_pL5za6Q1Wp3nOv4J6Bj7L-IeM76rR5-1rFZk,37086
61
+ psutil/tests/test_testutils.py,sha256=IUc3mMHGKGdnPpf_mhMWbDq0UDK9sXI4DZZ2dwujS7A,18915
62
+ psutil/tests/test_unicode.py,sha256=kH08SGFmi0bxnL-LHEA7JX0fwauGPvY9W3zfkQumgTw,10705
63
+ psutil/tests/test_windows.py,sha256=Zpg4Ek9KHkloYHpgHtHIrYBDXIgSf8HppSWcgWgogWE,34128
pythonProject/.venv/Lib/site-packages/psutil-7.0.0.dist-info/WHEEL ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.42.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp37-abi3-win_amd64
5
+
pythonProject/.venv/Lib/site-packages/psutil-7.0.0.dist-info/top_level.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ psutil
pythonProject/.venv/Lib/site-packages/psutil/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (63.5 kB). View file
 
pythonProject/.venv/Lib/site-packages/regex-2025.9.1.dist-info/INSTALLER ADDED
@@ -0,0 +1 @@
 
 
1
+ pip
pythonProject/.venv/Lib/site-packages/regex-2025.9.1.dist-info/METADATA ADDED
@@ -0,0 +1,1059 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: regex
3
+ Version: 2025.9.1
4
+ Summary: Alternative regular expression module, to replace re.
5
+ Author-email: Matthew Barnett <regex@mrabarnett.plus.com>
6
+ License-Expression: Apache-2.0 AND CNRI-Python
7
+ Project-URL: Homepage, https://github.com/mrabarnett/mrab-regex
8
+ Classifier: Development Status :: 5 - Production/Stable
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Classifier: Topic :: Text Processing
20
+ Classifier: Topic :: Text Processing :: General
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/x-rst
23
+ License-File: LICENSE.txt
24
+ Dynamic: license-file
25
+
26
+ Introduction
27
+ ------------
28
+
29
+ This regex implementation is backwards-compatible with the standard 're' module, but offers additional functionality.
30
+
31
+ Python 2
32
+ --------
33
+
34
+ Python 2 is no longer supported. The last release that supported Python 2 was 2021.11.10.
35
+
36
+ PyPy
37
+ ----
38
+
39
+ This module is targeted at CPython. It expects that all codepoints are the same width, so it won't behave properly with PyPy outside U+0000..U+007F because PyPy stores strings as UTF-8.
40
+
41
+ Multithreading
42
+ --------------
43
+
44
+ The regex module releases the GIL during matching on instances of the built-in (immutable) string classes, enabling other Python threads to run concurrently. It is also possible to force the regex module to release the GIL during matching by calling the matching methods with the keyword argument ``concurrent=True``. The behaviour is undefined if the string changes during matching, so use it *only* when it is guaranteed that that won't happen.
45
+
46
+ Unicode
47
+ -------
48
+
49
+ This module supports Unicode 16.0.0. Full Unicode case-folding is supported.
50
+
51
+ Flags
52
+ -----
53
+
54
+ There are 2 kinds of flag: scoped and global. Scoped flags can apply to only part of a pattern and can be turned on or off; global flags apply to the entire pattern and can only be turned on.
55
+
56
+ The scoped flags are: ``ASCII (?a)``, ``FULLCASE (?f)``, ``IGNORECASE (?i)``, ``LOCALE (?L)``, ``MULTILINE (?m)``, ``DOTALL (?s)``, ``UNICODE (?u)``, ``VERBOSE (?x)``, ``WORD (?w)``.
57
+
58
+ The global flags are: ``BESTMATCH (?b)``, ``ENHANCEMATCH (?e)``, ``POSIX (?p)``, ``REVERSE (?r)``, ``VERSION0 (?V0)``, ``VERSION1 (?V1)``.
59
+
60
+ If neither the ``ASCII``, ``LOCALE`` nor ``UNICODE`` flag is specified, it will default to ``UNICODE`` if the regex pattern is a Unicode string and ``ASCII`` if it's a bytestring.
61
+
62
+ The ``ENHANCEMATCH`` flag makes fuzzy matching attempt to improve the fit of the next match that it finds.
63
+
64
+ The ``BESTMATCH`` flag makes fuzzy matching search for the best match instead of the next match.
65
+
66
+ Old vs new behaviour
67
+ --------------------
68
+
69
+ In order to be compatible with the re module, this module has 2 behaviours:
70
+
71
+ * **Version 0** behaviour (old behaviour, compatible with the re module):
72
+
73
+ Please note that the re module's behaviour may change over time, and I'll endeavour to match that behaviour in version 0.
74
+
75
+ * Indicated by the ``VERSION0`` flag.
76
+
77
+ * Zero-width matches are not handled correctly in the re module before Python 3.7. The behaviour in those earlier versions is:
78
+
79
+ * ``.split`` won't split a string at a zero-width match.
80
+
81
+ * ``.sub`` will advance by one character after a zero-width match.
82
+
83
+ * Inline flags apply to the entire pattern, and they can't be turned off.
84
+
85
+ * Only simple sets are supported.
86
+
87
+ * Case-insensitive matches in Unicode use simple case-folding by default.
88
+
89
+ * **Version 1** behaviour (new behaviour, possibly different from the re module):
90
+
91
+ * Indicated by the ``VERSION1`` flag.
92
+
93
+ * Zero-width matches are handled correctly.
94
+
95
+ * Inline flags apply to the end of the group or pattern, and they can be turned off.
96
+
97
+ * Nested sets and set operations are supported.
98
+
99
+ * Case-insensitive matches in Unicode use full case-folding by default.
100
+
101
+ If no version is specified, the regex module will default to ``regex.DEFAULT_VERSION``.
102
+
103
+ Case-insensitive matches in Unicode
104
+ -----------------------------------
105
+
106
+ The regex module supports both simple and full case-folding for case-insensitive matches in Unicode. Use of full case-folding can be turned on using the ``FULLCASE`` flag. Please note that this flag affects how the ``IGNORECASE`` flag works; the ``FULLCASE`` flag itself does not turn on case-insensitive matching.
107
+
108
+ Version 0 behaviour: the flag is off by default.
109
+
110
+ Version 1 behaviour: the flag is on by default.
111
+
112
+ Nested sets and set operations
113
+ ------------------------------
114
+
115
+ It's not possible to support both simple sets, as used in the re module, and nested sets at the same time because of a difference in the meaning of an unescaped ``"["`` in a set.
116
+
117
+ For example, the pattern ``[[a-z]--[aeiou]]`` is treated in the version 0 behaviour (simple sets, compatible with the re module) as:
118
+
119
+ * Set containing "[" and the letters "a" to "z"
120
+
121
+ * Literal "--"
122
+
123
+ * Set containing letters "a", "e", "i", "o", "u"
124
+
125
+ * Literal "]"
126
+
127
+ but in the version 1 behaviour (nested sets, enhanced behaviour) as:
128
+
129
+ * Set which is:
130
+
131
+ * Set containing the letters "a" to "z"
132
+
133
+ * but excluding:
134
+
135
+ * Set containing the letters "a", "e", "i", "o", "u"
136
+
137
+ Version 0 behaviour: only simple sets are supported.
138
+
139
+ Version 1 behaviour: nested sets and set operations are supported.
140
+
141
+ Notes on named groups
142
+ ---------------------
143
+
144
+ All groups have a group number, starting from 1.
145
+
146
+ Groups with the same group name will have the same group number, and groups with a different group name will have a different group number.
147
+
148
+ The same name can be used by more than one group, with later captures 'overwriting' earlier captures. All the captures of the group will be available from the ``captures`` method of the match object.
149
+
150
+ Group numbers will be reused across different branches of a branch reset, eg. ``(?|(first)|(second))`` has only group 1. If groups have different group names then they will, of course, have different group numbers, eg. ``(?|(?P<foo>first)|(?P<bar>second))`` has group 1 ("foo") and group 2 ("bar").
151
+
152
+ In the regex ``(\s+)(?|(?P<foo>[A-Z]+)|(\w+) (?P<foo>[0-9]+)`` there are 2 groups:
153
+
154
+ * ``(\s+)`` is group 1.
155
+
156
+ * ``(?P<foo>[A-Z]+)`` is group 2, also called "foo".
157
+
158
+ * ``(\w+)`` is group 2 because of the branch reset.
159
+
160
+ * ``(?P<foo>[0-9]+)`` is group 2 because it's called "foo".
161
+
162
+ If you want to prevent ``(\w+)`` from being group 2, you need to name it (different name, different group number).
163
+
164
+ Additional features
165
+ -------------------
166
+
167
+ The issue numbers relate to the Python bug tracker, except where listed otherwise.
168
+
169
+ Added ``\p{Horiz_Space}`` and ``\p{Vert_Space}`` (`GitHub issue 477 <https://github.com/mrabarnett/mrab-regex/issues/477#issuecomment-1216779547>`_)
170
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
171
+
172
+ ``\p{Horiz_Space}`` or ``\p{H}`` matches horizontal whitespace and ``\p{Vert_Space}`` or ``\p{V}`` matches vertical whitespace.
173
+
174
+ Added support for lookaround in conditional pattern (`Hg issue 163 <https://github.com/mrabarnett/mrab-regex/issues/163>`_)
175
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
176
+
177
+ The test of a conditional pattern can be a lookaround.
178
+
179
+ .. sourcecode:: python
180
+
181
+ >>> regex.match(r'(?(?=\d)\d+|\w+)', '123abc')
182
+ <regex.Match object; span=(0, 3), match='123'>
183
+ >>> regex.match(r'(?(?=\d)\d+|\w+)', 'abc123')
184
+ <regex.Match object; span=(0, 6), match='abc123'>
185
+
186
+ This is not quite the same as putting a lookaround in the first branch of a pair of alternatives.
187
+
188
+ .. sourcecode:: python
189
+
190
+ >>> print(regex.match(r'(?:(?=\d)\d+\b|\w+)', '123abc'))
191
+ <regex.Match object; span=(0, 6), match='123abc'>
192
+ >>> print(regex.match(r'(?(?=\d)\d+\b|\w+)', '123abc'))
193
+ None
194
+
195
+ In the first example, the lookaround matched, but the remainder of the first branch failed to match, and so the second branch was attempted, whereas in the second example, the lookaround matched, and the first branch failed to match, but the second branch was **not** attempted.
196
+
197
+ Added POSIX matching (leftmost longest) (`Hg issue 150 <https://github.com/mrabarnett/mrab-regex/issues/150>`_)
198
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
199
+
200
+ The POSIX standard for regex is to return the leftmost longest match. This can be turned on using the ``POSIX`` flag.
201
+
202
+ .. sourcecode:: python
203
+
204
+ >>> # Normal matching.
205
+ >>> regex.search(r'Mr|Mrs', 'Mrs')
206
+ <regex.Match object; span=(0, 2), match='Mr'>
207
+ >>> regex.search(r'one(self)?(selfsufficient)?', 'oneselfsufficient')
208
+ <regex.Match object; span=(0, 7), match='oneself'>
209
+ >>> # POSIX matching.
210
+ >>> regex.search(r'(?p)Mr|Mrs', 'Mrs')
211
+ <regex.Match object; span=(0, 3), match='Mrs'>
212
+ >>> regex.search(r'(?p)one(self)?(selfsufficient)?', 'oneselfsufficient')
213
+ <regex.Match object; span=(0, 17), match='oneselfsufficient'>
214
+
215
+ Note that it will take longer to find matches because when it finds a match at a certain position, it won't return that immediately, but will keep looking to see if there's another longer match there.
216
+
217
+ Added ``(?(DEFINE)...)`` (`Hg issue 152 <https://github.com/mrabarnett/mrab-regex/issues/152>`_)
218
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
219
+
220
+ If there's no group called "DEFINE", then ... will be ignored except that any groups defined within it can be called and that the normal rules for numbering groups still apply.
221
+
222
+ .. sourcecode:: python
223
+
224
+ >>> regex.search(r'(?(DEFINE)(?P<quant>\d+)(?P<item>\w+))(?&quant) (?&item)', '5 elephants')
225
+ <regex.Match object; span=(0, 11), match='5 elephants'>
226
+
227
+ Added ``(*PRUNE)``, ``(*SKIP)`` and ``(*FAIL)`` (`Hg issue 153 <https://github.com/mrabarnett/mrab-regex/issues/153>`_)
228
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
229
+
230
+ ``(*PRUNE)`` discards the backtracking info up to that point. When used in an atomic group or a lookaround, it won't affect the enclosing pattern.
231
+
232
+ ``(*SKIP)`` is similar to ``(*PRUNE)``, except that it also sets where in the text the next attempt to match will start. When used in an atomic group or a lookaround, it won't affect the enclosing pattern.
233
+
234
+ ``(*FAIL)`` causes immediate backtracking. ``(*F)`` is a permitted abbreviation.
235
+
236
+ Added ``\K`` (`Hg issue 151 <https://github.com/mrabarnett/mrab-regex/issues/151>`_)
237
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
238
+
239
+ Keeps the part of the entire match after the position where ``\K`` occurred; the part before it is discarded.
240
+
241
+ It does not affect what groups return.
242
+
243
+ .. sourcecode:: python
244
+
245
+ >>> m = regex.search(r'(\w\w\K\w\w\w)', 'abcdef')
246
+ >>> m[0]
247
+ 'cde'
248
+ >>> m[1]
249
+ 'abcde'
250
+ >>>
251
+ >>> m = regex.search(r'(?r)(\w\w\K\w\w\w)', 'abcdef')
252
+ >>> m[0]
253
+ 'bc'
254
+ >>> m[1]
255
+ 'bcdef'
256
+
257
+ Added capture subscripting for ``expandf`` and ``subf``/``subfn`` (`Hg issue 133 <https://github.com/mrabarnett/mrab-regex/issues/133>`_)
258
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
259
+
260
+ You can use subscripting to get the captures of a repeated group.
261
+
262
+ .. sourcecode:: python
263
+
264
+ >>> m = regex.match(r"(\w)+", "abc")
265
+ >>> m.expandf("{1}")
266
+ 'c'
267
+ >>> m.expandf("{1[0]} {1[1]} {1[2]}")
268
+ 'a b c'
269
+ >>> m.expandf("{1[-1]} {1[-2]} {1[-3]}")
270
+ 'c b a'
271
+ >>>
272
+ >>> m = regex.match(r"(?P<letter>\w)+", "abc")
273
+ >>> m.expandf("{letter}")
274
+ 'c'
275
+ >>> m.expandf("{letter[0]} {letter[1]} {letter[2]}")
276
+ 'a b c'
277
+ >>> m.expandf("{letter[-1]} {letter[-2]} {letter[-3]}")
278
+ 'c b a'
279
+
280
+ Added support for referring to a group by number using ``(?P=...)``
281
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
282
+
283
+ This is in addition to the existing ``\g<...>``.
284
+
285
+ Fixed the handling of locale-sensitive regexes
286
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
287
+
288
+ The ``LOCALE`` flag is intended for legacy code and has limited support. You're still recommended to use Unicode instead.
289
+
290
+ Added partial matches (`Hg issue 102 <https://github.com/mrabarnett/mrab-regex/issues/102>`_)
291
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
292
+
293
+ A partial match is one that matches up to the end of string, but that string has been truncated and you want to know whether a complete match could be possible if the string had not been truncated.
294
+
295
+ Partial matches are supported by ``match``, ``search``, ``fullmatch`` and ``finditer`` with the ``partial`` keyword argument.
296
+
297
+ Match objects have a ``partial`` attribute, which is ``True`` if it's a partial match.
298
+
299
+ For example, if you wanted a user to enter a 4-digit number and check it character by character as it was being entered:
300
+
301
+ .. sourcecode:: python
302
+
303
+ >>> pattern = regex.compile(r'\d{4}')
304
+
305
+ >>> # Initially, nothing has been entered:
306
+ >>> print(pattern.fullmatch('', partial=True))
307
+ <regex.Match object; span=(0, 0), match='', partial=True>
308
+
309
+ >>> # An empty string is OK, but it's only a partial match.
310
+ >>> # The user enters a letter:
311
+ >>> print(pattern.fullmatch('a', partial=True))
312
+ None
313
+ >>> # It'll never match.
314
+
315
+ >>> # The user deletes that and enters a digit:
316
+ >>> print(pattern.fullmatch('1', partial=True))
317
+ <regex.Match object; span=(0, 1), match='1', partial=True>
318
+ >>> # It matches this far, but it's only a partial match.
319
+
320
+ >>> # The user enters 2 more digits:
321
+ >>> print(pattern.fullmatch('123', partial=True))
322
+ <regex.Match object; span=(0, 3), match='123', partial=True>
323
+ >>> # It matches this far, but it's only a partial match.
324
+
325
+ >>> # The user enters another digit:
326
+ >>> print(pattern.fullmatch('1234', partial=True))
327
+ <regex.Match object; span=(0, 4), match='1234'>
328
+ >>> # It's a complete match.
329
+
330
+ >>> # If the user enters another digit:
331
+ >>> print(pattern.fullmatch('12345', partial=True))
332
+ None
333
+ >>> # It's no longer a match.
334
+
335
+ >>> # This is a partial match:
336
+ >>> pattern.match('123', partial=True).partial
337
+ True
338
+
339
+ >>> # This is a complete match:
340
+ >>> pattern.match('1233', partial=True).partial
341
+ False
342
+
343
+ ``*`` operator not working correctly with sub() (`Hg issue 106 <https://github.com/mrabarnett/mrab-regex/issues/106>`_)
344
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
345
+
346
+ Sometimes it's not clear how zero-width matches should be handled. For example, should ``.*`` match 0 characters directly after matching >0 characters?
347
+
348
+ .. sourcecode:: python
349
+
350
+ >>> regex.sub('.*', 'x', 'test')
351
+ 'xx'
352
+ >>> regex.sub('.*?', '|', 'test')
353
+ '|||||||||'
354
+
355
+ Added ``capturesdict`` (`Hg issue 86 <https://github.com/mrabarnett/mrab-regex/issues/86>`_)
356
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
357
+
358
+ ``capturesdict`` is a combination of ``groupdict`` and ``captures``:
359
+
360
+ ``groupdict`` returns a dict of the named groups and the last capture of those groups.
361
+
362
+ ``captures`` returns a list of all the captures of a group
363
+
364
+ ``capturesdict`` returns a dict of the named groups and lists of all the captures of those groups.
365
+
366
+ .. sourcecode:: python
367
+
368
+ >>> m = regex.match(r"(?:(?P<word>\w+) (?P<digits>\d+)\n)+", "one 1\ntwo 2\nthree 3\n")
369
+ >>> m.groupdict()
370
+ {'word': 'three', 'digits': '3'}
371
+ >>> m.captures("word")
372
+ ['one', 'two', 'three']
373
+ >>> m.captures("digits")
374
+ ['1', '2', '3']
375
+ >>> m.capturesdict()
376
+ {'word': ['one', 'two', 'three'], 'digits': ['1', '2', '3']}
377
+
378
+ Added ``allcaptures`` and ``allspans`` (`Git issue 474 <https://github.com/mrabarnett/mrab-regex/issues/474>`_)
379
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
380
+
381
+ ``allcaptures`` returns a list of all the captures of all the groups.
382
+
383
+ ``allspans`` returns a list of all the spans of the all captures of all the groups.
384
+
385
+ .. sourcecode:: python
386
+
387
+ >>> m = regex.match(r"(?:(?P<word>\w+) (?P<digits>\d+)\n)+", "one 1\ntwo 2\nthree 3\n")
388
+ >>> m.allcaptures()
389
+ (['one 1\ntwo 2\nthree 3\n'], ['one', 'two', 'three'], ['1', '2', '3'])
390
+ >>> m.allspans()
391
+ ([(0, 20)], [(0, 3), (6, 9), (12, 17)], [(4, 5), (10, 11), (18, 19)])
392
+
393
+ Allow duplicate names of groups (`Hg issue 87 <https://github.com/mrabarnett/mrab-regex/issues/87>`_)
394
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
395
+
396
+ Group names can be duplicated.
397
+
398
+ .. sourcecode:: python
399
+
400
+ >>> # With optional groups:
401
+ >>>
402
+ >>> # Both groups capture, the second capture 'overwriting' the first.
403
+ >>> m = regex.match(r"(?P<item>\w+)? or (?P<item>\w+)?", "first or second")
404
+ >>> m.group("item")
405
+ 'second'
406
+ >>> m.captures("item")
407
+ ['first', 'second']
408
+ >>> # Only the second group captures.
409
+ >>> m = regex.match(r"(?P<item>\w+)? or (?P<item>\w+)?", " or second")
410
+ >>> m.group("item")
411
+ 'second'
412
+ >>> m.captures("item")
413
+ ['second']
414
+ >>> # Only the first group captures.
415
+ >>> m = regex.match(r"(?P<item>\w+)? or (?P<item>\w+)?", "first or ")
416
+ >>> m.group("item")
417
+ 'first'
418
+ >>> m.captures("item")
419
+ ['first']
420
+ >>>
421
+ >>> # With mandatory groups:
422
+ >>>
423
+ >>> # Both groups capture, the second capture 'overwriting' the first.
424
+ >>> m = regex.match(r"(?P<item>\w*) or (?P<item>\w*)?", "first or second")
425
+ >>> m.group("item")
426
+ 'second'
427
+ >>> m.captures("item")
428
+ ['first', 'second']
429
+ >>> # Again, both groups capture, the second capture 'overwriting' the first.
430
+ >>> m = regex.match(r"(?P<item>\w*) or (?P<item>\w*)", " or second")
431
+ >>> m.group("item")
432
+ 'second'
433
+ >>> m.captures("item")
434
+ ['', 'second']
435
+ >>> # And yet again, both groups capture, the second capture 'overwriting' the first.
436
+ >>> m = regex.match(r"(?P<item>\w*) or (?P<item>\w*)", "first or ")
437
+ >>> m.group("item")
438
+ ''
439
+ >>> m.captures("item")
440
+ ['first', '']
441
+
442
+ Added ``fullmatch`` (`issue #16203 <https://bugs.python.org/issue16203>`_)
443
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
444
+
445
+ ``fullmatch`` behaves like ``match``, except that it must match all of the string.
446
+
447
+ .. sourcecode:: python
448
+
449
+ >>> print(regex.fullmatch(r"abc", "abc").span())
450
+ (0, 3)
451
+ >>> print(regex.fullmatch(r"abc", "abcx"))
452
+ None
453
+ >>> print(regex.fullmatch(r"abc", "abcx", endpos=3).span())
454
+ (0, 3)
455
+ >>> print(regex.fullmatch(r"abc", "xabcy", pos=1, endpos=4).span())
456
+ (1, 4)
457
+ >>>
458
+ >>> regex.match(r"a.*?", "abcd").group(0)
459
+ 'a'
460
+ >>> regex.fullmatch(r"a.*?", "abcd").group(0)
461
+ 'abcd'
462
+
463
+ Added ``subf`` and ``subfn``
464
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
465
+
466
+ ``subf`` and ``subfn`` are alternatives to ``sub`` and ``subn`` respectively. When passed a replacement string, they treat it as a format string.
467
+
468
+ .. sourcecode:: python
469
+
470
+ >>> regex.subf(r"(\w+) (\w+)", "{0} => {2} {1}", "foo bar")
471
+ 'foo bar => bar foo'
472
+ >>> regex.subf(r"(?P<word1>\w+) (?P<word2>\w+)", "{word2} {word1}", "foo bar")
473
+ 'bar foo'
474
+
475
+ Added ``expandf`` to match object
476
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
477
+
478
+ ``expandf`` is an alternative to ``expand``. When passed a replacement string, it treats it as a format string.
479
+
480
+ .. sourcecode:: python
481
+
482
+ >>> m = regex.match(r"(\w+) (\w+)", "foo bar")
483
+ >>> m.expandf("{0} => {2} {1}")
484
+ 'foo bar => bar foo'
485
+ >>>
486
+ >>> m = regex.match(r"(?P<word1>\w+) (?P<word2>\w+)", "foo bar")
487
+ >>> m.expandf("{word2} {word1}")
488
+ 'bar foo'
489
+
490
+ Detach searched string
491
+ ^^^^^^^^^^^^^^^^^^^^^^
492
+
493
+ A match object contains a reference to the string that was searched, via its ``string`` attribute. The ``detach_string`` method will 'detach' that string, making it available for garbage collection, which might save valuable memory if that string is very large.
494
+
495
+ .. sourcecode:: python
496
+
497
+ >>> m = regex.search(r"\w+", "Hello world")
498
+ >>> print(m.group())
499
+ Hello
500
+ >>> print(m.string)
501
+ Hello world
502
+ >>> m.detach_string()
503
+ >>> print(m.group())
504
+ Hello
505
+ >>> print(m.string)
506
+ None
507
+
508
+ Recursive patterns (`Hg issue 27 <https://github.com/mrabarnett/mrab-regex/issues/27>`_)
509
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
510
+
511
+ Recursive and repeated patterns are supported.
512
+
513
+ ``(?R)`` or ``(?0)`` tries to match the entire regex recursively. ``(?1)``, ``(?2)``, etc, try to match the relevant group.
514
+
515
+ ``(?&name)`` tries to match the named group.
516
+
517
+ .. sourcecode:: python
518
+
519
+ >>> regex.match(r"(Tarzan|Jane) loves (?1)", "Tarzan loves Jane").groups()
520
+ ('Tarzan',)
521
+ >>> regex.match(r"(Tarzan|Jane) loves (?1)", "Jane loves Tarzan").groups()
522
+ ('Jane',)
523
+
524
+ >>> m = regex.search(r"(\w)(?:(?R)|(\w?))\1", "kayak")
525
+ >>> m.group(0, 1, 2)
526
+ ('kayak', 'k', None)
527
+
528
+ The first two examples show how the subpattern within the group is reused, but is _not_ itself a group. In other words, ``"(Tarzan|Jane) loves (?1)"`` is equivalent to ``"(Tarzan|Jane) loves (?:Tarzan|Jane)"``.
529
+
530
+ It's possible to backtrack into a recursed or repeated group.
531
+
532
+ You can't call a group if there is more than one group with that group name or group number (``"ambiguous group reference"``).
533
+
534
+ The alternative forms ``(?P>name)`` and ``(?P&name)`` are also supported.
535
+
536
+ Full Unicode case-folding is supported
537
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
538
+
539
+ In version 1 behaviour, the regex module uses full case-folding when performing case-insensitive matches in Unicode.
540
+
541
+ .. sourcecode:: python
542
+
543
+ >>> regex.match(r"(?iV1)strasse", "stra\N{LATIN SMALL LETTER SHARP S}e").span()
544
+ (0, 6)
545
+ >>> regex.match(r"(?iV1)stra\N{LATIN SMALL LETTER SHARP S}e", "STRASSE").span()
546
+ (0, 7)
547
+
548
+ In version 0 behaviour, it uses simple case-folding for backward compatibility with the re module.
549
+
550
+ Approximate "fuzzy" matching (`Hg issue 12 <https://github.com/mrabarnett/mrab-regex/issues/12>`_, `Hg issue 41 <https://github.com/mrabarnett/mrab-regex/issues/41>`_, `Hg issue 109 <https://github.com/mrabarnett/mrab-regex/issues/109>`_)
551
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
552
+
553
+ Regex usually attempts an exact match, but sometimes an approximate, or "fuzzy", match is needed, for those cases where the text being searched may contain errors in the form of inserted, deleted or substituted characters.
554
+
555
+ A fuzzy regex specifies which types of errors are permitted, and, optionally, either the minimum and maximum or only the maximum permitted number of each type. (You cannot specify only a minimum.)
556
+
557
+ The 3 types of error are:
558
+
559
+ * Insertion, indicated by "i"
560
+
561
+ * Deletion, indicated by "d"
562
+
563
+ * Substitution, indicated by "s"
564
+
565
+ In addition, "e" indicates any type of error.
566
+
567
+ The fuzziness of a regex item is specified between "{" and "}" after the item.
568
+
569
+ Examples:
570
+
571
+ * ``foo`` match "foo" exactly
572
+
573
+ * ``(?:foo){i}`` match "foo", permitting insertions
574
+
575
+ * ``(?:foo){d}`` match "foo", permitting deletions
576
+
577
+ * ``(?:foo){s}`` match "foo", permitting substitutions
578
+
579
+ * ``(?:foo){i,s}`` match "foo", permitting insertions and substitutions
580
+
581
+ * ``(?:foo){e}`` match "foo", permitting errors
582
+
583
+ If a certain type of error is specified, then any type not specified will **not** be permitted.
584
+
585
+ In the following examples I'll omit the item and write only the fuzziness:
586
+
587
+ * ``{d<=3}`` permit at most 3 deletions, but no other types
588
+
589
+ * ``{i<=1,s<=2}`` permit at most 1 insertion and at most 2 substitutions, but no deletions
590
+
591
+ * ``{1<=e<=3}`` permit at least 1 and at most 3 errors
592
+
593
+ * ``{i<=2,d<=2,e<=3}`` permit at most 2 insertions, at most 2 deletions, at most 3 errors in total, but no substitutions
594
+
595
+ It's also possible to state the costs of each type of error and the maximum permitted total cost.
596
+
597
+ Examples:
598
+
599
+ * ``{2i+2d+1s<=4}`` each insertion costs 2, each deletion costs 2, each substitution costs 1, the total cost must not exceed 4
600
+
601
+ * ``{i<=1,d<=1,s<=1,2i+2d+1s<=4}`` at most 1 insertion, at most 1 deletion, at most 1 substitution; each insertion costs 2, each deletion costs 2, each substitution costs 1, the total cost must not exceed 4
602
+
603
+ You can also use "<" instead of "<=" if you want an exclusive minimum or maximum.
604
+
605
+ You can add a test to perform on a character that's substituted or inserted.
606
+
607
+ Examples:
608
+
609
+ * ``{s<=2:[a-z]}`` at most 2 substitutions, which must be in the character set ``[a-z]``.
610
+
611
+ * ``{s<=2,i<=3:\d}`` at most 2 substitutions, at most 3 insertions, which must be digits.
612
+
613
+ By default, fuzzy matching searches for the first match that meets the given constraints. The ``ENHANCEMATCH`` flag will cause it to attempt to improve the fit (i.e. reduce the number of errors) of the match that it has found.
614
+
615
+ The ``BESTMATCH`` flag will make it search for the best match instead.
616
+
617
+ Further examples to note:
618
+
619
+ * ``regex.search("(dog){e}", "cat and dog")[1]`` returns ``"cat"`` because that matches ``"dog"`` with 3 errors (an unlimited number of errors is permitted).
620
+
621
+ * ``regex.search("(dog){e<=1}", "cat and dog")[1]`` returns ``" dog"`` (with a leading space) because that matches ``"dog"`` with 1 error, which is within the limit.
622
+
623
+ * ``regex.search("(?e)(dog){e<=1}", "cat and dog")[1]`` returns ``"dog"`` (without a leading space) because the fuzzy search matches ``" dog"`` with 1 error, which is within the limit, and the ``(?e)`` then it attempts a better fit.
624
+
625
+ In the first two examples there are perfect matches later in the string, but in neither case is it the first possible match.
626
+
627
+ The match object has an attribute ``fuzzy_counts`` which gives the total number of substitutions, insertions and deletions.
628
+
629
+ .. sourcecode:: python
630
+
631
+ >>> # A 'raw' fuzzy match:
632
+ >>> regex.fullmatch(r"(?:cats|cat){e<=1}", "cat").fuzzy_counts
633
+ (0, 0, 1)
634
+ >>> # 0 substitutions, 0 insertions, 1 deletion.
635
+
636
+ >>> # A better match might be possible if the ENHANCEMATCH flag used:
637
+ >>> regex.fullmatch(r"(?e)(?:cats|cat){e<=1}", "cat").fuzzy_counts
638
+ (0, 0, 0)
639
+ >>> # 0 substitutions, 0 insertions, 0 deletions.
640
+
641
+ The match object also has an attribute ``fuzzy_changes`` which gives a tuple of the positions of the substitutions, insertions and deletions.
642
+
643
+ .. sourcecode:: python
644
+
645
+ >>> m = regex.search('(fuu){i<=2,d<=2,e<=5}', 'anaconda foo bar')
646
+ >>> m
647
+ <regex.Match object; span=(7, 10), match='a f', fuzzy_counts=(0, 2, 2)>
648
+ >>> m.fuzzy_changes
649
+ ([], [7, 8], [10, 11])
650
+
651
+ What this means is that if the matched part of the string had been:
652
+
653
+ .. sourcecode:: python
654
+
655
+ 'anacondfuuoo bar'
656
+
657
+ it would've been an exact match.
658
+
659
+ However, there were insertions at positions 7 and 8:
660
+
661
+ .. sourcecode:: python
662
+
663
+ 'anaconda fuuoo bar'
664
+ ^^
665
+
666
+ and deletions at positions 10 and 11:
667
+
668
+ .. sourcecode:: python
669
+
670
+ 'anaconda f~~oo bar'
671
+ ^^
672
+
673
+ So the actual string was:
674
+
675
+ .. sourcecode:: python
676
+
677
+ 'anaconda foo bar'
678
+
679
+ Named lists ``\L<name>`` (`Hg issue 11 <https://github.com/mrabarnett/mrab-regex/issues/11>`_)
680
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
681
+
682
+ There are occasions where you may want to include a list (actually, a set) of options in a regex.
683
+
684
+ One way is to build the pattern like this:
685
+
686
+ .. sourcecode:: python
687
+
688
+ >>> p = regex.compile(r"first|second|third|fourth|fifth")
689
+
690
+ but if the list is large, parsing the resulting regex can take considerable time, and care must also be taken that the strings are properly escaped and properly ordered, for example, "cats" before "cat".
691
+
692
+ The new alternative is to use a named list:
693
+
694
+ .. sourcecode:: python
695
+
696
+ >>> option_set = ["first", "second", "third", "fourth", "fifth"]
697
+ >>> p = regex.compile(r"\L<options>", options=option_set)
698
+
699
+ The order of the items is irrelevant, they are treated as a set. The named lists are available as the ``.named_lists`` attribute of the pattern object :
700
+
701
+ .. sourcecode:: python
702
+
703
+ >>> print(p.named_lists)
704
+ {'options': frozenset({'third', 'first', 'fifth', 'fourth', 'second'})}
705
+
706
+ If there are any unused keyword arguments, ``ValueError`` will be raised unless you tell it otherwise:
707
+
708
+ .. sourcecode:: python
709
+
710
+ >>> option_set = ["first", "second", "third", "fourth", "fifth"]
711
+ >>> p = regex.compile(r"\L<options>", options=option_set, other_options=[])
712
+ Traceback (most recent call last):
713
+ File "<stdin>", line 1, in <module>
714
+ File "C:\Python310\lib\site-packages\regex\regex.py", line 353, in compile
715
+ return _compile(pattern, flags, ignore_unused, kwargs, cache_pattern)
716
+ File "C:\Python310\lib\site-packages\regex\regex.py", line 500, in _compile
717
+ complain_unused_args()
718
+ File "C:\Python310\lib\site-packages\regex\regex.py", line 483, in complain_unused_args
719
+ raise ValueError('unused keyword argument {!a}'.format(any_one))
720
+ ValueError: unused keyword argument 'other_options'
721
+ >>> p = regex.compile(r"\L<options>", options=option_set, other_options=[], ignore_unused=True)
722
+ >>> p = regex.compile(r"\L<options>", options=option_set, other_options=[], ignore_unused=False)
723
+ Traceback (most recent call last):
724
+ File "<stdin>", line 1, in <module>
725
+ File "C:\Python310\lib\site-packages\regex\regex.py", line 353, in compile
726
+ return _compile(pattern, flags, ignore_unused, kwargs, cache_pattern)
727
+ File "C:\Python310\lib\site-packages\regex\regex.py", line 500, in _compile
728
+ complain_unused_args()
729
+ File "C:\Python310\lib\site-packages\regex\regex.py", line 483, in complain_unused_args
730
+ raise ValueError('unused keyword argument {!a}'.format(any_one))
731
+ ValueError: unused keyword argument 'other_options'
732
+ >>>
733
+
734
+ Start and end of word
735
+ ^^^^^^^^^^^^^^^^^^^^^
736
+
737
+ ``\m`` matches at the start of a word.
738
+
739
+ ``\M`` matches at the end of a word.
740
+
741
+ Compare with ``\b``, which matches at the start or end of a word.
742
+
743
+ Unicode line separators
744
+ ^^^^^^^^^^^^^^^^^^^^^^^
745
+
746
+ Normally the only line separator is ``\n`` (``\x0A``), but if the ``WORD`` flag is turned on then the line separators are ``\x0D\x0A``, ``\x0A``, ``\x0B``, ``\x0C`` and ``\x0D``, plus ``\x85``, ``\u2028`` and ``\u2029`` when working with Unicode.
747
+
748
+ This affects the regex dot ``"."``, which, with the ``DOTALL`` flag turned off, matches any character except a line separator. It also affects the line anchors ``^`` and ``$`` (in multiline mode).
749
+
750
+ Set operators
751
+ ^^^^^^^^^^^^^
752
+
753
+ **Version 1 behaviour only**
754
+
755
+ Set operators have been added, and a set ``[...]`` can include nested sets.
756
+
757
+ The operators, in order of increasing precedence, are:
758
+
759
+ * ``||`` for union ("x||y" means "x or y")
760
+
761
+ * ``~~`` (double tilde) for symmetric difference ("x~~y" means "x or y, but not both")
762
+
763
+ * ``&&`` for intersection ("x&&y" means "x and y")
764
+
765
+ * ``--`` (double dash) for difference ("x--y" means "x but not y")
766
+
767
+ Implicit union, ie, simple juxtaposition like in ``[ab]``, has the highest precedence. Thus, ``[ab&&cd]`` is the same as ``[[a||b]&&[c||d]]``.
768
+
769
+ Examples:
770
+
771
+ * ``[ab]`` # Set containing 'a' and 'b'
772
+
773
+ * ``[a-z]`` # Set containing 'a' .. 'z'
774
+
775
+ * ``[[a-z]--[qw]]`` # Set containing 'a' .. 'z', but not 'q' or 'w'
776
+
777
+ * ``[a-z--qw]`` # Same as above
778
+
779
+ * ``[\p{L}--QW]`` # Set containing all letters except 'Q' and 'W'
780
+
781
+ * ``[\p{N}--[0-9]]`` # Set containing all numbers except '0' .. '9'
782
+
783
+ * ``[\p{ASCII}&&\p{Letter}]`` # Set containing all characters which are ASCII and letter
784
+
785
+ regex.escape (`issue #2650 <https://bugs.python.org/issue2650>`_)
786
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
787
+
788
+ regex.escape has an additional keyword parameter ``special_only``. When True, only 'special' regex characters, such as '?', are escaped.
789
+
790
+ .. sourcecode:: python
791
+
792
+ >>> regex.escape("foo!?", special_only=False)
793
+ 'foo\\!\\?'
794
+ >>> regex.escape("foo!?", special_only=True)
795
+ 'foo!\\?'
796
+
797
+ regex.escape (`Hg issue 249 <https://github.com/mrabarnett/mrab-regex/issues/249>`_)
798
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
799
+
800
+ regex.escape has an additional keyword parameter ``literal_spaces``. When True, spaces are not escaped.
801
+
802
+ .. sourcecode:: python
803
+
804
+ >>> regex.escape("foo bar!?", literal_spaces=False)
805
+ 'foo\\ bar!\\?'
806
+ >>> regex.escape("foo bar!?", literal_spaces=True)
807
+ 'foo bar!\\?'
808
+
809
+ Repeated captures (`issue #7132 <https://bugs.python.org/issue7132>`_)
810
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
811
+
812
+ A match object has additional methods which return information on all the successful matches of a repeated group. These methods are:
813
+
814
+ * ``matchobject.captures([group1, ...])``
815
+
816
+ * Returns a list of the strings matched in a group or groups. Compare with ``matchobject.group([group1, ...])``.
817
+
818
+ * ``matchobject.starts([group])``
819
+
820
+ * Returns a list of the start positions. Compare with ``matchobject.start([group])``.
821
+
822
+ * ``matchobject.ends([group])``
823
+
824
+ * Returns a list of the end positions. Compare with ``matchobject.end([group])``.
825
+
826
+ * ``matchobject.spans([group])``
827
+
828
+ * Returns a list of the spans. Compare with ``matchobject.span([group])``.
829
+
830
+ .. sourcecode:: python
831
+
832
+ >>> m = regex.search(r"(\w{3})+", "123456789")
833
+ >>> m.group(1)
834
+ '789'
835
+ >>> m.captures(1)
836
+ ['123', '456', '789']
837
+ >>> m.start(1)
838
+ 6
839
+ >>> m.starts(1)
840
+ [0, 3, 6]
841
+ >>> m.end(1)
842
+ 9
843
+ >>> m.ends(1)
844
+ [3, 6, 9]
845
+ >>> m.span(1)
846
+ (6, 9)
847
+ >>> m.spans(1)
848
+ [(0, 3), (3, 6), (6, 9)]
849
+
850
+ Atomic grouping ``(?>...)`` (`issue #433030 <https://bugs.python.org/issue433030>`_)
851
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
852
+
853
+ If the following pattern subsequently fails, then the subpattern as a whole will fail.
854
+
855
+ Possessive quantifiers
856
+ ^^^^^^^^^^^^^^^^^^^^^^
857
+
858
+ ``(?:...)?+`` ; ``(?:...)*+`` ; ``(?:...)++`` ; ``(?:...){min,max}+``
859
+
860
+ The subpattern is matched up to 'max' times. If the following pattern subsequently fails, then all the repeated subpatterns will fail as a whole. For example, ``(?:...)++`` is equivalent to ``(?>(?:...)+)``.
861
+
862
+ Scoped flags (`issue #433028 <https://bugs.python.org/issue433028>`_)
863
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
864
+
865
+ ``(?flags-flags:...)``
866
+
867
+ The flags will apply only to the subpattern. Flags can be turned on or off.
868
+
869
+ Definition of 'word' character (`issue #1693050 <https://bugs.python.org/issue1693050>`_)
870
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
871
+
872
+ The definition of a 'word' character has been expanded for Unicode. It conforms to the Unicode specification at ``http://www.unicode.org/reports/tr29/``.
873
+
874
+ Variable-length lookbehind
875
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
876
+
877
+ A lookbehind can match a variable-length string.
878
+
879
+ Flags argument for regex.split, regex.sub and regex.subn (`issue #3482 <https://bugs.python.org/issue3482>`_)
880
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
881
+
882
+ ``regex.split``, ``regex.sub`` and ``regex.subn`` support a 'flags' argument.
883
+
884
+ Pos and endpos arguments for regex.sub and regex.subn
885
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
886
+
887
+ ``regex.sub`` and ``regex.subn`` support 'pos' and 'endpos' arguments.
888
+
889
+ 'Overlapped' argument for regex.findall and regex.finditer
890
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
891
+
892
+ ``regex.findall`` and ``regex.finditer`` support an 'overlapped' flag which permits overlapped matches.
893
+
894
+ Splititer
895
+ ^^^^^^^^^
896
+
897
+ ``regex.splititer`` has been added. It's a generator equivalent of ``regex.split``.
898
+
899
+ Subscripting match objects for groups
900
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
901
+
902
+ A match object accepts access to the groups via subscripting and slicing:
903
+
904
+ .. sourcecode:: python
905
+
906
+ >>> m = regex.search(r"(?P<before>.*?)(?P<num>\d+)(?P<after>.*)", "pqr123stu")
907
+ >>> print(m["before"])
908
+ pqr
909
+ >>> print(len(m))
910
+ 4
911
+ >>> print(m[:])
912
+ ('pqr123stu', 'pqr', '123', 'stu')
913
+
914
+ Named groups
915
+ ^^^^^^^^^^^^
916
+
917
+ Groups can be named with ``(?<name>...)`` as well as the existing ``(?P<name>...)``.
918
+
919
+ Group references
920
+ ^^^^^^^^^^^^^^^^
921
+
922
+ Groups can be referenced within a pattern with ``\g<name>``. This also allows there to be more than 99 groups.
923
+
924
+ Named characters ``\N{name}``
925
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
926
+
927
+ Named characters are supported. Note that only those known by Python's Unicode database will be recognised.
928
+
929
+ Unicode codepoint properties, including scripts and blocks
930
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
931
+
932
+ ``\p{property=value}``; ``\P{property=value}``; ``\p{value}`` ; ``\P{value}``
933
+
934
+ Many Unicode properties are supported, including blocks and scripts. ``\p{property=value}`` or ``\p{property:value}`` matches a character whose property ``property`` has value ``value``. The inverse of ``\p{property=value}`` is ``\P{property=value}`` or ``\p{^property=value}``.
935
+
936
+ If the short form ``\p{value}`` is used, the properties are checked in the order: ``General_Category``, ``Script``, ``Block``, binary property:
937
+
938
+ * ``Latin``, the 'Latin' script (``Script=Latin``).
939
+
940
+ * ``BasicLatin``, the 'BasicLatin' block (``Block=BasicLatin``).
941
+
942
+ * ``Alphabetic``, the 'Alphabetic' binary property (``Alphabetic=Yes``).
943
+
944
+ A short form starting with ``Is`` indicates a script or binary property:
945
+
946
+ * ``IsLatin``, the 'Latin' script (``Script=Latin``).
947
+
948
+ * ``IsAlphabetic``, the 'Alphabetic' binary property (``Alphabetic=Yes``).
949
+
950
+ A short form starting with ``In`` indicates a block property:
951
+
952
+ * ``InBasicLatin``, the 'BasicLatin' block (``Block=BasicLatin``).
953
+
954
+ POSIX character classes
955
+ ^^^^^^^^^^^^^^^^^^^^^^^
956
+
957
+ ``[[:alpha:]]``; ``[[:^alpha:]]``
958
+
959
+ POSIX character classes are supported. These are normally treated as an alternative form of ``\p{...}``.
960
+
961
+ The exceptions are ``alnum``, ``digit``, ``punct`` and ``xdigit``, whose definitions are different from those of Unicode.
962
+
963
+ ``[[:alnum:]]`` is equivalent to ``\p{posix_alnum}``.
964
+
965
+ ``[[:digit:]]`` is equivalent to ``\p{posix_digit}``.
966
+
967
+ ``[[:punct:]]`` is equivalent to ``\p{posix_punct}``.
968
+
969
+ ``[[:xdigit:]]`` is equivalent to ``\p{posix_xdigit}``.
970
+
971
+ Search anchor ``\G``
972
+ ^^^^^^^^^^^^^^^^^^^^
973
+
974
+ A search anchor has been added. It matches at the position where each search started/continued and can be used for contiguous matches or in negative variable-length lookbehinds to limit how far back the lookbehind goes:
975
+
976
+ .. sourcecode:: python
977
+
978
+ >>> regex.findall(r"\w{2}", "abcd ef")
979
+ ['ab', 'cd', 'ef']
980
+ >>> regex.findall(r"\G\w{2}", "abcd ef")
981
+ ['ab', 'cd']
982
+
983
+ * The search starts at position 0 and matches 'ab'.
984
+
985
+ * The search continues at position 2 and matches 'cd'.
986
+
987
+ * The search continues at position 4 and fails to match any letters.
988
+
989
+ * The anchor stops the search start position from being advanced, so there are no more results.
990
+
991
+ Reverse searching
992
+ ^^^^^^^^^^^^^^^^^
993
+
994
+ Searches can also work backwards:
995
+
996
+ .. sourcecode:: python
997
+
998
+ >>> regex.findall(r".", "abc")
999
+ ['a', 'b', 'c']
1000
+ >>> regex.findall(r"(?r).", "abc")
1001
+ ['c', 'b', 'a']
1002
+
1003
+ Note that the result of a reverse search is not necessarily the reverse of a forward search:
1004
+
1005
+ .. sourcecode:: python
1006
+
1007
+ >>> regex.findall(r"..", "abcde")
1008
+ ['ab', 'cd']
1009
+ >>> regex.findall(r"(?r)..", "abcde")
1010
+ ['de', 'bc']
1011
+
1012
+ Matching a single grapheme ``\X``
1013
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1014
+
1015
+ The grapheme matcher is supported. It conforms to the Unicode specification at ``http://www.unicode.org/reports/tr29/``.
1016
+
1017
+ Branch reset ``(?|...|...)``
1018
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1019
+
1020
+ Group numbers will be reused across the alternatives, but groups with different names will have different group numbers.
1021
+
1022
+ .. sourcecode:: python
1023
+
1024
+ >>> regex.match(r"(?|(first)|(second))", "first").groups()
1025
+ ('first',)
1026
+ >>> regex.match(r"(?|(first)|(second))", "second").groups()
1027
+ ('second',)
1028
+
1029
+ Note that there is only one group.
1030
+
1031
+ Default Unicode word boundary
1032
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1033
+
1034
+ The ``WORD`` flag changes the definition of a 'word boundary' to that of a default Unicode word boundary. This applies to ``\b`` and ``\B``.
1035
+
1036
+ Timeout
1037
+ ^^^^^^^
1038
+
1039
+ The matching methods and functions support timeouts. The timeout (in seconds) applies to the entire operation:
1040
+
1041
+ .. sourcecode:: python
1042
+
1043
+ >>> from time import sleep
1044
+ >>>
1045
+ >>> def fast_replace(m):
1046
+ ... return 'X'
1047
+ ...
1048
+ >>> def slow_replace(m):
1049
+ ... sleep(0.5)
1050
+ ... return 'X'
1051
+ ...
1052
+ >>> regex.sub(r'[a-z]', fast_replace, 'abcde', timeout=2)
1053
+ 'XXXXX'
1054
+ >>> regex.sub(r'[a-z]', slow_replace, 'abcde', timeout=2)
1055
+ Traceback (most recent call last):
1056
+ File "<stdin>", line 1, in <module>
1057
+ File "C:\Python310\lib\site-packages\regex\regex.py", line 278, in sub
1058
+ return pat.sub(repl, string, count, pos, endpos, concurrent, timeout)
1059
+ TimeoutError: regex timed out
pythonProject/.venv/Lib/site-packages/regex-2025.9.1.dist-info/RECORD ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ regex-2025.9.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2
+ regex-2025.9.1.dist-info/METADATA,sha256=siCG8ejJcY7wqHWEgZfDSSEXZcHIOJSdjb_YfzYuNww,41525
3
+ regex-2025.9.1.dist-info/RECORD,,
4
+ regex-2025.9.1.dist-info/WHEEL,sha256=KUuBC6lxAbHCKilKua8R9W_TM71_-9Sg5uEP3uDWcoU,101
5
+ regex-2025.9.1.dist-info/licenses/LICENSE.txt,sha256=PSIMBllLgmu6vxEDEvYPOF-Z5X5Sn6S55Tb3kJH4tMc,11792
6
+ regex-2025.9.1.dist-info/top_level.txt,sha256=aQmiDMhNTF26cCK4_7D-qaVvhbxClG0wyCTnEhkzYBs,6
7
+ regex/__init__.py,sha256=6giZBSRLmTZfvQrcVoS6MaL5gKcwtfZlSXATBex49lU,68
8
+ regex/__pycache__/__init__.cpython-310.pyc,,
9
+ regex/__pycache__/_regex_core.cpython-310.pyc,,
10
+ regex/__pycache__/regex.cpython-310.pyc,,
11
+ regex/__pycache__/test_regex.cpython-310.pyc,,
12
+ regex/_regex.cp310-win_amd64.pyd,sha256=ZvWpmBsng2HpstDoQtmHWsysGCB550i8taN6zPJ_vqc,723456
13
+ regex/_regex_core.py,sha256=p98mx2eQ91VrZpqfxm06IT9twUgpvCG40D36CMSMcCw,149248
14
+ regex/regex.py,sha256=hk-x12fqgk-iQXdxKdHFEWGVMAJgziBp4aRXgtp4gio,33429
15
+ regex/test_regex.py,sha256=CWdOoqKj3TeylPZcg-peGjp6qw6RFG7hI_wbnw-isns,230350
pythonProject/.venv/Lib/site-packages/regex-2025.9.1.dist-info/WHEEL ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp310-cp310-win_amd64
5
+
pythonProject/.venv/Lib/site-packages/regex-2025.9.1.dist-info/licenses/LICENSE.txt ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ This work was derived from the 're' module of CPython 2.6 and CPython 3.1,
2
+ copyright (c) 1998-2001 by Secret Labs AB and licensed under CNRI's Python 1.6
3
+ license.
4
+
5
+ All additions and alterations are licensed under the Apache 2.0 License.
6
+
7
+
8
+ Apache License
9
+ Version 2.0, January 2004
10
+ http://www.apache.org/licenses/
11
+
12
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
13
+
14
+ 1. Definitions.
15
+
16
+ "License" shall mean the terms and conditions for use, reproduction,
17
+ and distribution as defined by Sections 1 through 9 of this document.
18
+
19
+ "Licensor" shall mean the copyright owner or entity authorized by
20
+ the copyright owner that is granting the License.
21
+
22
+ "Legal Entity" shall mean the union of the acting entity and all
23
+ other entities that control, are controlled by, or are under common
24
+ control with that entity. For the purposes of this definition,
25
+ "control" means (i) the power, direct or indirect, to cause the
26
+ direction or management of such entity, whether by contract or
27
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
28
+ outstanding shares, or (iii) beneficial ownership of such entity.
29
+
30
+ "You" (or "Your") shall mean an individual or Legal Entity
31
+ exercising permissions granted by this License.
32
+
33
+ "Source" form shall mean the preferred form for making modifications,
34
+ including but not limited to software source code, documentation
35
+ source, and configuration files.
36
+
37
+ "Object" form shall mean any form resulting from mechanical
38
+ transformation or translation of a Source form, including but
39
+ not limited to compiled object code, generated documentation,
40
+ and conversions to other media types.
41
+
42
+ "Work" shall mean the work of authorship, whether in Source or
43
+ Object form, made available under the License, as indicated by a
44
+ copyright notice that is included in or attached to the work
45
+ (an example is provided in the Appendix below).
46
+
47
+ "Derivative Works" shall mean any work, whether in Source or Object
48
+ form, that is based on (or derived from) the Work and for which the
49
+ editorial revisions, annotations, elaborations, or other modifications
50
+ represent, as a whole, an original work of authorship. For the purposes
51
+ of this License, Derivative Works shall not include works that remain
52
+ separable from, or merely link (or bind by name) to the interfaces of,
53
+ the Work and Derivative Works thereof.
54
+
55
+ "Contribution" shall mean any work of authorship, including
56
+ the original version of the Work and any modifications or additions
57
+ to that Work or Derivative Works thereof, that is intentionally
58
+ submitted to Licensor for inclusion in the Work by the copyright owner
59
+ or by an individual or Legal Entity authorized to submit on behalf of
60
+ the copyright owner. For the purposes of this definition, "submitted"
61
+ means any form of electronic, verbal, or written communication sent
62
+ to the Licensor or its representatives, including but not limited to
63
+ communication on electronic mailing lists, source code control systems,
64
+ and issue tracking systems that are managed by, or on behalf of, the
65
+ Licensor for the purpose of discussing and improving the Work, but
66
+ excluding communication that is conspicuously marked or otherwise
67
+ designated in writing by the copyright owner as "Not a Contribution."
68
+
69
+ "Contributor" shall mean Licensor and any individual or Legal Entity
70
+ on behalf of whom a Contribution has been received by Licensor and
71
+ subsequently incorporated within the Work.
72
+
73
+ 2. Grant of Copyright License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ copyright license to reproduce, prepare Derivative Works of,
77
+ publicly display, publicly perform, sublicense, and distribute the
78
+ Work and such Derivative Works in Source or Object form.
79
+
80
+ 3. Grant of Patent License. Subject to the terms and conditions of
81
+ this License, each Contributor hereby grants to You a perpetual,
82
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
83
+ (except as stated in this section) patent license to make, have made,
84
+ use, offer to sell, sell, import, and otherwise transfer the Work,
85
+ where such license applies only to those patent claims licensable
86
+ by such Contributor that are necessarily infringed by their
87
+ Contribution(s) alone or by combination of their Contribution(s)
88
+ with the Work to which such Contribution(s) was submitted. If You
89
+ institute patent litigation against any entity (including a
90
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
91
+ or a Contribution incorporated within the Work constitutes direct
92
+ or contributory patent infringement, then any patent licenses
93
+ granted to You under this License for that Work shall terminate
94
+ as of the date such litigation is filed.
95
+
96
+ 4. Redistribution. You may reproduce and distribute copies of the
97
+ Work or Derivative Works thereof in any medium, with or without
98
+ modifications, and in Source or Object form, provided that You
99
+ meet the following conditions:
100
+
101
+ (a) You must give any other recipients of the Work or
102
+ Derivative Works a copy of this License; and
103
+
104
+ (b) You must cause any modified files to carry prominent notices
105
+ stating that You changed the files; and
106
+
107
+ (c) You must retain, in the Source form of any Derivative Works
108
+ that You distribute, all copyright, patent, trademark, and
109
+ attribution notices from the Source form of the Work,
110
+ excluding those notices that do not pertain to any part of
111
+ the Derivative Works; and
112
+
113
+ (d) If the Work includes a "NOTICE" text file as part of its
114
+ distribution, then any Derivative Works that You distribute must
115
+ include a readable copy of the attribution notices contained
116
+ within such NOTICE file, excluding those notices that do not
117
+ pertain to any part of the Derivative Works, in at least one
118
+ of the following places: within a NOTICE text file distributed
119
+ as part of the Derivative Works; within the Source form or
120
+ documentation, if provided along with the Derivative Works; or,
121
+ within a display generated by the Derivative Works, if and
122
+ wherever such third-party notices normally appear. The contents
123
+ of the NOTICE file are for informational purposes only and
124
+ do not modify the License. You may add Your own attribution
125
+ notices within Derivative Works that You distribute, alongside
126
+ or as an addendum to the NOTICE text from the Work, provided
127
+ that such additional attribution notices cannot be construed
128
+ as modifying the License.
129
+
130
+ You may add Your own copyright statement to Your modifications and
131
+ may provide additional or different license terms and conditions
132
+ for use, reproduction, or distribution of Your modifications, or
133
+ for any such Derivative Works as a whole, provided Your use,
134
+ reproduction, and distribution of the Work otherwise complies with
135
+ the conditions stated in this License.
136
+
137
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
138
+ any Contribution intentionally submitted for inclusion in the Work
139
+ by You to the Licensor shall be under the terms and conditions of
140
+ this License, without any additional terms or conditions.
141
+ Notwithstanding the above, nothing herein shall supersede or modify
142
+ the terms of any separate license agreement you may have executed
143
+ with Licensor regarding such Contributions.
144
+
145
+ 6. Trademarks. This License does not grant permission to use the trade
146
+ names, trademarks, service marks, or product names of the Licensor,
147
+ except as required for reasonable and customary use in describing the
148
+ origin of the Work and reproducing the content of the NOTICE file.
149
+
150
+ 7. Disclaimer of Warranty. Unless required by applicable law or
151
+ agreed to in writing, Licensor provides the Work (and each
152
+ Contributor provides its Contributions) on an "AS IS" BASIS,
153
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
154
+ implied, including, without limitation, any warranties or conditions
155
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
156
+ PARTICULAR PURPOSE. You are solely responsible for determining the
157
+ appropriateness of using or redistributing the Work and assume any
158
+ risks associated with Your exercise of permissions under this License.
159
+
160
+ 8. Limitation of Liability. In no event and under no legal theory,
161
+ whether in tort (including negligence), contract, or otherwise,
162
+ unless required by applicable law (such as deliberate and grossly
163
+ negligent acts) or agreed to in writing, shall any Contributor be
164
+ liable to You for damages, including any direct, indirect, special,
165
+ incidental, or consequential damages of any character arising as a
166
+ result of this License or out of the use or inability to use the
167
+ Work (including but not limited to damages for loss of goodwill,
168
+ work stoppage, computer failure or malfunction, or any and all
169
+ other commercial damages or losses), even if such Contributor
170
+ has been advised of the possibility of such damages.
171
+
172
+ 9. Accepting Warranty or Additional Liability. While redistributing
173
+ the Work or Derivative Works thereof, You may choose to offer,
174
+ and charge a fee for, acceptance of support, warranty, indemnity,
175
+ or other liability obligations and/or rights consistent with this
176
+ License. However, in accepting such obligations, You may act only
177
+ on Your own behalf and on Your sole responsibility, not on behalf
178
+ of any other Contributor, and only if You agree to indemnify,
179
+ defend, and hold each Contributor harmless for any liability
180
+ incurred by, or claims asserted against, such Contributor by reason
181
+ of your accepting any such warranty or additional liability.
182
+
183
+ END OF TERMS AND CONDITIONS
184
+
185
+ APPENDIX: How to apply the Apache License to your work.
186
+
187
+ To apply the Apache License to your work, attach the following
188
+ boilerplate notice, with the fields enclosed by brackets "[]"
189
+ replaced with your own identifying information. (Don't include
190
+ the brackets!) The text should be enclosed in the appropriate
191
+ comment syntax for the file format. We also recommend that a
192
+ file or class name and description of purpose be included on the
193
+ same "printed page" as the copyright notice for easier
194
+ identification within third-party archives.
195
+
196
+ Copyright 2020 Matthew Barnett
197
+
198
+ Licensed under the Apache License, Version 2.0 (the "License");
199
+ you may not use this file except in compliance with the License.
200
+ You may obtain a copy of the License at
201
+
202
+ http://www.apache.org/licenses/LICENSE-2.0
203
+
204
+ Unless required by applicable law or agreed to in writing, software
205
+ distributed under the License is distributed on an "AS IS" BASIS,
206
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
207
+ See the License for the specific language governing permissions and
208
+ limitations under the License.
pythonProject/.venv/Lib/site-packages/regex-2025.9.1.dist-info/top_level.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ regex
pythonProject/.venv/Lib/site-packages/regex/__init__.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ from .regex import *
2
+ from . import regex
3
+ __all__ = regex.__all__
pythonProject/.venv/Lib/site-packages/regex/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (224 Bytes). View file
 
pythonProject/.venv/Lib/site-packages/regex/__pycache__/regex.cpython-310.pyc ADDED
Binary file (25.5 kB). View file
 
pythonProject/.venv/Lib/site-packages/regex/_regex_core.py ADDED
The diff for this file is too large to render. See raw diff
 
pythonProject/.venv/Lib/site-packages/regex/regex.py ADDED
@@ -0,0 +1,746 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #
2
+ # Secret Labs' Regular Expression Engine
3
+ #
4
+ # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
5
+ #
6
+ # This version of the SRE library can be redistributed under CNRI's
7
+ # Python 1.6 license. For any other use, please contact Secret Labs
8
+ # AB (info@pythonware.com).
9
+ #
10
+ # Portions of this engine have been developed in cooperation with
11
+ # CNRI. Hewlett-Packard provided funding for 1.6 integration and
12
+ # other compatibility work.
13
+ #
14
+ # 2010-01-16 mrab Python front-end re-written and extended
15
+
16
+ r"""Support for regular expressions (RE).
17
+
18
+ This module provides regular expression matching operations similar to those
19
+ found in Perl. It supports both 8-bit and Unicode strings; both the pattern and
20
+ the strings being processed can contain null bytes and characters outside the
21
+ US ASCII range.
22
+
23
+ Regular expressions can contain both special and ordinary characters. Most
24
+ ordinary characters, like "A", "a", or "0", are the simplest regular
25
+ expressions; they simply match themselves. You can concatenate ordinary
26
+ characters, so last matches the string 'last'.
27
+
28
+ There are a few differences between the old (legacy) behaviour and the new
29
+ (enhanced) behaviour, which are indicated by VERSION0 or VERSION1.
30
+
31
+ The special characters are:
32
+ "." Matches any character except a newline.
33
+ "^" Matches the start of the string.
34
+ "$" Matches the end of the string or just before the
35
+ newline at the end of the string.
36
+ "*" Matches 0 or more (greedy) repetitions of the preceding
37
+ RE. Greedy means that it will match as many repetitions
38
+ as possible.
39
+ "+" Matches 1 or more (greedy) repetitions of the preceding
40
+ RE.
41
+ "?" Matches 0 or 1 (greedy) of the preceding RE.
42
+ *?,+?,?? Non-greedy versions of the previous three special
43
+ characters.
44
+ *+,++,?+ Possessive versions of the previous three special
45
+ characters.
46
+ {m,n} Matches from m to n repetitions of the preceding RE.
47
+ {m,n}? Non-greedy version of the above.
48
+ {m,n}+ Possessive version of the above.
49
+ {...} Fuzzy matching constraints.
50
+ "\\" Either escapes special characters or signals a special
51
+ sequence.
52
+ [...] Indicates a set of characters. A "^" as the first
53
+ character indicates a complementing set.
54
+ "|" A|B, creates an RE that will match either A or B.
55
+ (...) Matches the RE inside the parentheses. The contents are
56
+ captured and can be retrieved or matched later in the
57
+ string.
58
+ (?flags-flags) VERSION1: Sets/clears the flags for the remainder of
59
+ the group or pattern; VERSION0: Sets the flags for the
60
+ entire pattern.
61
+ (?:...) Non-capturing version of regular parentheses.
62
+ (?>...) Atomic non-capturing version of regular parentheses.
63
+ (?flags-flags:...) Non-capturing version of regular parentheses with local
64
+ flags.
65
+ (?P<name>...) The substring matched by the group is accessible by
66
+ name.
67
+ (?<name>...) The substring matched by the group is accessible by
68
+ name.
69
+ (?P=name) Matches the text matched earlier by the group named
70
+ name.
71
+ (?#...) A comment; ignored.
72
+ (?=...) Matches if ... matches next, but doesn't consume the
73
+ string.
74
+ (?!...) Matches if ... doesn't match next.
75
+ (?<=...) Matches if preceded by ....
76
+ (?<!...) Matches if not preceded by ....
77
+ (?(id)yes|no) Matches yes pattern if group id matched, the (optional)
78
+ no pattern otherwise.
79
+ (?(DEFINE)...) If there's no group called "DEFINE", then ... will be
80
+ ignored, but any group definitions will be available.
81
+ (?|...|...) (?|A|B), creates an RE that will match either A or B,
82
+ but reuses capture group numbers across the
83
+ alternatives.
84
+ (*FAIL) Forces matching to fail, which means immediate
85
+ backtracking.
86
+ (*F) Abbreviation for (*FAIL).
87
+ (*PRUNE) Discards the current backtracking information. Its
88
+ effect doesn't extend outside an atomic group or a
89
+ lookaround.
90
+ (*SKIP) Similar to (*PRUNE), except that it also sets where in
91
+ the text the next attempt at matching the entire
92
+ pattern will start. Its effect doesn't extend outside
93
+ an atomic group or a lookaround.
94
+
95
+ The fuzzy matching constraints are: "i" to permit insertions, "d" to permit
96
+ deletions, "s" to permit substitutions, "e" to permit any of these. Limits are
97
+ optional with "<=" and "<". If any type of error is provided then any type not
98
+ provided is not permitted.
99
+
100
+ A cost equation may be provided.
101
+
102
+ Examples:
103
+ (?:fuzzy){i<=2}
104
+ (?:fuzzy){i<=1,s<=2,d<=1,1i+1s+1d<3}
105
+
106
+ VERSION1: Set operators are supported, and a set can include nested sets. The
107
+ set operators, in order of increasing precedence, are:
108
+ || Set union ("x||y" means "x or y").
109
+ ~~ (double tilde) Symmetric set difference ("x~~y" means "x or y, but not
110
+ both").
111
+ && Set intersection ("x&&y" means "x and y").
112
+ -- (double dash) Set difference ("x--y" means "x but not y").
113
+
114
+ Implicit union, ie, simple juxtaposition like in [ab], has the highest
115
+ precedence.
116
+
117
+ VERSION0 and VERSION1:
118
+ The special sequences consist of "\\" and a character from the list below. If
119
+ the ordinary character is not on the list, then the resulting RE will match the
120
+ second character.
121
+ \number Matches the contents of the group of the same number if
122
+ number is no more than 2 digits, otherwise the character
123
+ with the 3-digit octal code.
124
+ \a Matches the bell character.
125
+ \A Matches only at the start of the string.
126
+ \b Matches the empty string, but only at the start or end of a
127
+ word.
128
+ \B Matches the empty string, but not at the start or end of a
129
+ word.
130
+ \d Matches any decimal digit; equivalent to the set [0-9] when
131
+ matching a bytestring or a Unicode string with the ASCII
132
+ flag, or the whole range of Unicode digits when matching a
133
+ Unicode string.
134
+ \D Matches any non-digit character; equivalent to [^\d].
135
+ \f Matches the formfeed character.
136
+ \g<name> Matches the text matched by the group named name.
137
+ \G Matches the empty string, but only at the position where
138
+ the search started.
139
+ \h Matches horizontal whitespace.
140
+ \K Keeps only what follows for the entire match.
141
+ \L<name> Named list. The list is provided as a keyword argument.
142
+ \m Matches the empty string, but only at the start of a word.
143
+ \M Matches the empty string, but only at the end of a word.
144
+ \n Matches the newline character.
145
+ \N{name} Matches the named character.
146
+ \p{name=value} Matches the character if its property has the specified
147
+ value.
148
+ \P{name=value} Matches the character if its property hasn't the specified
149
+ value.
150
+ \r Matches the carriage-return character.
151
+ \s Matches any whitespace character; equivalent to
152
+ [ \t\n\r\f\v].
153
+ \S Matches any non-whitespace character; equivalent to [^\s].
154
+ \t Matches the tab character.
155
+ \uXXXX Matches the Unicode codepoint with 4-digit hex code XXXX.
156
+ \UXXXXXXXX Matches the Unicode codepoint with 8-digit hex code
157
+ XXXXXXXX.
158
+ \v Matches the vertical tab character.
159
+ \w Matches any alphanumeric character; equivalent to
160
+ [a-zA-Z0-9_] when matching a bytestring or a Unicode string
161
+ with the ASCII flag, or the whole range of Unicode
162
+ alphanumeric characters (letters plus digits plus
163
+ underscore) when matching a Unicode string. With LOCALE, it
164
+ will match the set [0-9_] plus characters defined as
165
+ letters for the current locale.
166
+ \W Matches the complement of \w; equivalent to [^\w].
167
+ \xXX Matches the character with 2-digit hex code XX.
168
+ \X Matches a grapheme.
169
+ \Z Matches only at the end of the string.
170
+ \\ Matches a literal backslash.
171
+
172
+ This module exports the following functions:
173
+ match Match a regular expression pattern at the beginning of a string.
174
+ fullmatch Match a regular expression pattern against all of a string.
175
+ search Search a string for the presence of a pattern.
176
+ sub Substitute occurrences of a pattern found in a string using a
177
+ template string.
178
+ subf Substitute occurrences of a pattern found in a string using a
179
+ format string.
180
+ subn Same as sub, but also return the number of substitutions made.
181
+ subfn Same as subf, but also return the number of substitutions made.
182
+ split Split a string by the occurrences of a pattern. VERSION1: will
183
+ split at zero-width match; VERSION0: won't split at zero-width
184
+ match.
185
+ splititer Return an iterator yielding the parts of a split string.
186
+ findall Find all occurrences of a pattern in a string.
187
+ finditer Return an iterator yielding a match object for each match.
188
+ compile Compile a pattern into a Pattern object.
189
+ purge Clear the regular expression cache.
190
+ escape Backslash all non-alphanumerics or special characters in a
191
+ string.
192
+
193
+ Most of the functions support a concurrent parameter: if True, the GIL will be
194
+ released during matching, allowing other Python threads to run concurrently. If
195
+ the string changes during matching, the behaviour is undefined. This parameter
196
+ is not needed when working on the builtin (immutable) string classes.
197
+
198
+ Some of the functions in this module take flags as optional parameters. Most of
199
+ these flags can also be set within an RE:
200
+ A a ASCII Make \w, \W, \b, \B, \d, and \D match the
201
+ corresponding ASCII character categories. Default
202
+ when matching a bytestring.
203
+ B b BESTMATCH Find the best fuzzy match (default is first).
204
+ D DEBUG Print the parsed pattern.
205
+ E e ENHANCEMATCH Attempt to improve the fit after finding the first
206
+ fuzzy match.
207
+ F f FULLCASE Use full case-folding when performing
208
+ case-insensitive matching in Unicode.
209
+ I i IGNORECASE Perform case-insensitive matching.
210
+ L L LOCALE Make \w, \W, \b, \B, \d, and \D dependent on the
211
+ current locale. (One byte per character only.)
212
+ M m MULTILINE "^" matches the beginning of lines (after a newline)
213
+ as well as the string. "$" matches the end of lines
214
+ (before a newline) as well as the end of the string.
215
+ P p POSIX Perform POSIX-standard matching (leftmost longest).
216
+ R r REVERSE Searches backwards.
217
+ S s DOTALL "." matches any character at all, including the
218
+ newline.
219
+ U u UNICODE Make \w, \W, \b, \B, \d, and \D dependent on the
220
+ Unicode locale. Default when matching a Unicode
221
+ string.
222
+ V0 V0 VERSION0 Turn on the old legacy behaviour.
223
+ V1 V1 VERSION1 Turn on the new enhanced behaviour. This flag
224
+ includes the FULLCASE flag.
225
+ W w WORD Make \b and \B work with default Unicode word breaks
226
+ and make ".", "^" and "$" work with Unicode line
227
+ breaks.
228
+ X x VERBOSE Ignore whitespace and comments for nicer looking REs.
229
+
230
+ This module also defines an exception 'error'.
231
+
232
+ """
233
+
234
+ # Public symbols.
235
+ __all__ = ["cache_all", "compile", "DEFAULT_VERSION", "escape", "findall",
236
+ "finditer", "fullmatch", "match", "purge", "search", "split", "splititer",
237
+ "sub", "subf", "subfn", "subn", "template", "Scanner", "A", "ASCII", "B",
238
+ "BESTMATCH", "D", "DEBUG", "E", "ENHANCEMATCH", "S", "DOTALL", "F",
239
+ "FULLCASE", "I", "IGNORECASE", "L", "LOCALE", "M", "MULTILINE", "P", "POSIX",
240
+ "R", "REVERSE", "T", "TEMPLATE", "U", "UNICODE", "V0", "VERSION0", "V1",
241
+ "VERSION1", "X", "VERBOSE", "W", "WORD", "error", "Regex", "__version__",
242
+ "__doc__", "RegexFlag"]
243
+
244
+ __version__ = "2.5.161"
245
+
246
+ # --------------------------------------------------------------------
247
+ # Public interface.
248
+
249
+ def match(pattern, string, flags=0, pos=None, endpos=None, partial=False,
250
+ concurrent=None, timeout=None, ignore_unused=False, **kwargs):
251
+ """Try to apply the pattern at the start of the string, returning a match
252
+ object, or None if no match was found."""
253
+ pat = _compile(pattern, flags, ignore_unused, kwargs, True)
254
+ return pat.match(string, pos, endpos, concurrent, partial, timeout)
255
+
256
+ def fullmatch(pattern, string, flags=0, pos=None, endpos=None, partial=False,
257
+ concurrent=None, timeout=None, ignore_unused=False, **kwargs):
258
+ """Try to apply the pattern against all of the string, returning a match
259
+ object, or None if no match was found."""
260
+ pat = _compile(pattern, flags, ignore_unused, kwargs, True)
261
+ return pat.fullmatch(string, pos, endpos, concurrent, partial, timeout)
262
+
263
+ def search(pattern, string, flags=0, pos=None, endpos=None, partial=False,
264
+ concurrent=None, timeout=None, ignore_unused=False, **kwargs):
265
+ """Search through string looking for a match to the pattern, returning a
266
+ match object, or None if no match was found."""
267
+ pat = _compile(pattern, flags, ignore_unused, kwargs, True)
268
+ return pat.search(string, pos, endpos, concurrent, partial, timeout)
269
+
270
+ def sub(pattern, repl, string, count=0, flags=0, pos=None, endpos=None,
271
+ concurrent=None, timeout=None, ignore_unused=False, **kwargs):
272
+ """Return the string obtained by replacing the leftmost (or rightmost with a
273
+ reverse pattern) non-overlapping occurrences of the pattern in string by the
274
+ replacement repl. repl can be either a string or a callable; if a string,
275
+ backslash escapes in it are processed; if a callable, it's passed the match
276
+ object and must return a replacement string to be used."""
277
+ pat = _compile(pattern, flags, ignore_unused, kwargs, True)
278
+ return pat.sub(repl, string, count, pos, endpos, concurrent, timeout)
279
+
280
+ def subf(pattern, format, string, count=0, flags=0, pos=None, endpos=None,
281
+ concurrent=None, timeout=None, ignore_unused=False, **kwargs):
282
+ """Return the string obtained by replacing the leftmost (or rightmost with a
283
+ reverse pattern) non-overlapping occurrences of the pattern in string by the
284
+ replacement format. format can be either a string or a callable; if a string,
285
+ it's treated as a format string; if a callable, it's passed the match object
286
+ and must return a replacement string to be used."""
287
+ pat = _compile(pattern, flags, ignore_unused, kwargs, True)
288
+ return pat.subf(format, string, count, pos, endpos, concurrent, timeout)
289
+
290
+ def subn(pattern, repl, string, count=0, flags=0, pos=None, endpos=None,
291
+ concurrent=None, timeout=None, ignore_unused=False, **kwargs):
292
+ """Return a 2-tuple containing (new_string, number). new_string is the string
293
+ obtained by replacing the leftmost (or rightmost with a reverse pattern)
294
+ non-overlapping occurrences of the pattern in the source string by the
295
+ replacement repl. number is the number of substitutions that were made. repl
296
+ can be either a string or a callable; if a string, backslash escapes in it
297
+ are processed; if a callable, it's passed the match object and must return a
298
+ replacement string to be used."""
299
+ pat = _compile(pattern, flags, ignore_unused, kwargs, True)
300
+ return pat.subn(repl, string, count, pos, endpos, concurrent, timeout)
301
+
302
+ def subfn(pattern, format, string, count=0, flags=0, pos=None, endpos=None,
303
+ concurrent=None, timeout=None, ignore_unused=False, **kwargs):
304
+ """Return a 2-tuple containing (new_string, number). new_string is the string
305
+ obtained by replacing the leftmost (or rightmost with a reverse pattern)
306
+ non-overlapping occurrences of the pattern in the source string by the
307
+ replacement format. number is the number of substitutions that were made. format
308
+ can be either a string or a callable; if a string, it's treated as a format
309
+ string; if a callable, it's passed the match object and must return a
310
+ replacement string to be used."""
311
+ pat = _compile(pattern, flags, ignore_unused, kwargs, True)
312
+ return pat.subfn(format, string, count, pos, endpos, concurrent, timeout)
313
+
314
+ def split(pattern, string, maxsplit=0, flags=0, concurrent=None, timeout=None,
315
+ ignore_unused=False, **kwargs):
316
+ """Split the source string by the occurrences of the pattern, returning a
317
+ list containing the resulting substrings. If capturing parentheses are used
318
+ in pattern, then the text of all groups in the pattern are also returned as
319
+ part of the resulting list. If maxsplit is nonzero, at most maxsplit splits
320
+ occur, and the remainder of the string is returned as the final element of
321
+ the list."""
322
+ pat = _compile(pattern, flags, ignore_unused, kwargs, True)
323
+ return pat.split(string, maxsplit, concurrent, timeout)
324
+
325
+ def splititer(pattern, string, maxsplit=0, flags=0, concurrent=None,
326
+ timeout=None, ignore_unused=False, **kwargs):
327
+ "Return an iterator yielding the parts of a split string."
328
+ pat = _compile(pattern, flags, ignore_unused, kwargs, True)
329
+ return pat.splititer(string, maxsplit, concurrent, timeout)
330
+
331
+ def findall(pattern, string, flags=0, pos=None, endpos=None, overlapped=False,
332
+ concurrent=None, timeout=None, ignore_unused=False, **kwargs):
333
+ """Return a list of all matches in the string. The matches may be overlapped
334
+ if overlapped is True. If one or more groups are present in the pattern,
335
+ return a list of groups; this will be a list of tuples if the pattern has
336
+ more than one group. Empty matches are included in the result."""
337
+ pat = _compile(pattern, flags, ignore_unused, kwargs, True)
338
+ return pat.findall(string, pos, endpos, overlapped, concurrent, timeout)
339
+
340
+ def finditer(pattern, string, flags=0, pos=None, endpos=None, overlapped=False,
341
+ partial=False, concurrent=None, timeout=None, ignore_unused=False, **kwargs):
342
+ """Return an iterator over all matches in the string. The matches may be
343
+ overlapped if overlapped is True. For each match, the iterator returns a
344
+ match object. Empty matches are included in the result."""
345
+ pat = _compile(pattern, flags, ignore_unused, kwargs, True)
346
+ return pat.finditer(string, pos, endpos, overlapped, concurrent, partial,
347
+ timeout)
348
+
349
+ def compile(pattern, flags=0, ignore_unused=False, cache_pattern=None, **kwargs):
350
+ "Compile a regular expression pattern, returning a pattern object."
351
+ if cache_pattern is None:
352
+ cache_pattern = _cache_all
353
+ return _compile(pattern, flags, ignore_unused, kwargs, cache_pattern)
354
+
355
+ def purge():
356
+ "Clear the regular expression cache"
357
+ _cache.clear()
358
+ _locale_sensitive.clear()
359
+
360
+ # Whether to cache all patterns.
361
+ _cache_all = True
362
+
363
+ def cache_all(value=True):
364
+ """Sets whether to cache all patterns, even those are compiled explicitly.
365
+ Passing None has no effect, but returns the current setting."""
366
+ global _cache_all
367
+
368
+ if value is None:
369
+ return _cache_all
370
+
371
+ _cache_all = value
372
+
373
+ def template(pattern, flags=0):
374
+ "Compile a template pattern, returning a pattern object."
375
+ return _compile(pattern, flags | TEMPLATE, False, {}, False)
376
+
377
+ def escape(pattern, special_only=True, literal_spaces=False):
378
+ """Escape a string for use as a literal in a pattern. If special_only is
379
+ True, escape only special characters, else escape all non-alphanumeric
380
+ characters. If literal_spaces is True, don't escape spaces."""
381
+ # Convert it to Unicode.
382
+ if isinstance(pattern, bytes):
383
+ p = pattern.decode("latin-1")
384
+ else:
385
+ p = pattern
386
+
387
+ s = []
388
+ if special_only:
389
+ for c in p:
390
+ if c == " " and literal_spaces:
391
+ s.append(c)
392
+ elif c in _METACHARS or c.isspace():
393
+ s.append("\\")
394
+ s.append(c)
395
+ else:
396
+ s.append(c)
397
+ else:
398
+ for c in p:
399
+ if c == " " and literal_spaces:
400
+ s.append(c)
401
+ elif c in _ALNUM:
402
+ s.append(c)
403
+ else:
404
+ s.append("\\")
405
+ s.append(c)
406
+
407
+ r = "".join(s)
408
+ # Convert it back to bytes if necessary.
409
+ if isinstance(pattern, bytes):
410
+ r = r.encode("latin-1")
411
+
412
+ return r
413
+
414
+ # --------------------------------------------------------------------
415
+ # Internals.
416
+
417
+ import regex._regex_core as _regex_core
418
+ import regex._regex as _regex
419
+ from threading import RLock as _RLock
420
+ from locale import getpreferredencoding as _getpreferredencoding
421
+ from regex._regex_core import *
422
+ from regex._regex_core import (_ALL_VERSIONS, _ALL_ENCODINGS, _FirstSetError,
423
+ _UnscopedFlagSet, _check_group_features, _compile_firstset,
424
+ _compile_replacement, _flatten_code, _fold_case, _get_required_string,
425
+ _parse_pattern, _shrink_cache)
426
+ from regex._regex_core import (ALNUM as _ALNUM, Info as _Info, OP as _OP, Source
427
+ as _Source, Fuzzy as _Fuzzy)
428
+
429
+ # Version 0 is the old behaviour, compatible with the original 're' module.
430
+ # Version 1 is the new behaviour, which differs slightly.
431
+
432
+ DEFAULT_VERSION = VERSION0
433
+
434
+ _METACHARS = frozenset("()[]{}?*+|^$\\.-#&~")
435
+
436
+ _regex_core.DEFAULT_VERSION = DEFAULT_VERSION
437
+
438
+ # Caches for the patterns and replacements.
439
+ _cache = {}
440
+ _cache_lock = _RLock()
441
+ _named_args = {}
442
+ _replacement_cache = {}
443
+ _locale_sensitive = {}
444
+
445
+ # Maximum size of the cache.
446
+ _MAXCACHE = 500
447
+ _MAXREPCACHE = 500
448
+
449
+ def _compile(pattern, flags, ignore_unused, kwargs, cache_it):
450
+ "Compiles a regular expression to a PatternObject."
451
+
452
+ global DEFAULT_VERSION
453
+ try:
454
+ from regex import DEFAULT_VERSION
455
+ except ImportError:
456
+ pass
457
+
458
+ # We won't bother to cache the pattern if we're debugging.
459
+ if (flags & DEBUG) != 0:
460
+ cache_it = False
461
+
462
+ # What locale is this pattern using?
463
+ locale_key = (type(pattern), pattern)
464
+ if _locale_sensitive.get(locale_key, True) or (flags & LOCALE) != 0:
465
+ # This pattern is, or might be, locale-sensitive.
466
+ pattern_locale = _getpreferredencoding()
467
+ else:
468
+ # This pattern is definitely not locale-sensitive.
469
+ pattern_locale = None
470
+
471
+ def complain_unused_args():
472
+ if ignore_unused:
473
+ return
474
+
475
+ # Complain about any unused keyword arguments, possibly resulting from a typo.
476
+ unused_kwargs = set(kwargs) - {k for k, v in args_needed}
477
+ if unused_kwargs:
478
+ any_one = next(iter(unused_kwargs))
479
+ raise ValueError('unused keyword argument {!a}'.format(any_one))
480
+
481
+ if cache_it:
482
+ try:
483
+ # Do we know what keyword arguments are needed?
484
+ args_key = pattern, type(pattern), flags
485
+ args_needed = _named_args[args_key]
486
+
487
+ # Are we being provided with its required keyword arguments?
488
+ args_supplied = set()
489
+ if args_needed:
490
+ for k, v in args_needed:
491
+ try:
492
+ args_supplied.add((k, frozenset(kwargs[k])))
493
+ except KeyError:
494
+ raise error("missing named list: {!r}".format(k))
495
+
496
+ complain_unused_args()
497
+
498
+ args_supplied = frozenset(args_supplied)
499
+
500
+ # Have we already seen this regular expression and named list?
501
+ pattern_key = (pattern, type(pattern), flags, args_supplied,
502
+ DEFAULT_VERSION, pattern_locale)
503
+ return _cache[pattern_key]
504
+ except KeyError:
505
+ # It's a new pattern, or new named list for a known pattern.
506
+ pass
507
+
508
+ # Guess the encoding from the class of the pattern string.
509
+ if isinstance(pattern, str):
510
+ guess_encoding = UNICODE
511
+ elif isinstance(pattern, bytes):
512
+ guess_encoding = ASCII
513
+ elif isinstance(pattern, Pattern):
514
+ if flags:
515
+ raise ValueError("cannot process flags argument with a compiled pattern")
516
+
517
+ return pattern
518
+ else:
519
+ raise TypeError("first argument must be a string or compiled pattern")
520
+
521
+ # Set the default version in the core code in case it has been changed.
522
+ _regex_core.DEFAULT_VERSION = DEFAULT_VERSION
523
+
524
+ global_flags = flags
525
+
526
+ while True:
527
+ caught_exception = None
528
+ try:
529
+ source = _Source(pattern)
530
+ info = _Info(global_flags, source.char_type, kwargs)
531
+ info.guess_encoding = guess_encoding
532
+ source.ignore_space = bool(info.flags & VERBOSE)
533
+ parsed = _parse_pattern(source, info)
534
+ break
535
+ except _UnscopedFlagSet:
536
+ # Remember the global flags for the next attempt.
537
+ global_flags = info.global_flags
538
+ except error as e:
539
+ caught_exception = e
540
+
541
+ if caught_exception:
542
+ raise error(caught_exception.msg, caught_exception.pattern,
543
+ caught_exception.pos)
544
+
545
+ if not source.at_end():
546
+ raise error("unbalanced parenthesis", pattern, source.pos)
547
+
548
+ # Check the global flags for conflicts.
549
+ version = (info.flags & _ALL_VERSIONS) or DEFAULT_VERSION
550
+ if version not in (0, VERSION0, VERSION1):
551
+ raise ValueError("VERSION0 and VERSION1 flags are mutually incompatible")
552
+
553
+ if (info.flags & _ALL_ENCODINGS) not in (0, ASCII, LOCALE, UNICODE):
554
+ raise ValueError("ASCII, LOCALE and UNICODE flags are mutually incompatible")
555
+
556
+ if isinstance(pattern, bytes) and (info.flags & UNICODE):
557
+ raise ValueError("cannot use UNICODE flag with a bytes pattern")
558
+
559
+ if not (info.flags & _ALL_ENCODINGS):
560
+ if isinstance(pattern, str):
561
+ info.flags |= UNICODE
562
+ else:
563
+ info.flags |= ASCII
564
+
565
+ reverse = bool(info.flags & REVERSE)
566
+ fuzzy = isinstance(parsed, _Fuzzy)
567
+
568
+ # Remember whether this pattern as an inline locale flag.
569
+ _locale_sensitive[locale_key] = info.inline_locale
570
+
571
+ # Fix the group references.
572
+ caught_exception = None
573
+ try:
574
+ parsed.fix_groups(pattern, reverse, False)
575
+ except error as e:
576
+ caught_exception = e
577
+
578
+ if caught_exception:
579
+ raise error(caught_exception.msg, caught_exception.pattern,
580
+ caught_exception.pos)
581
+
582
+ # Should we print the parsed pattern?
583
+ if flags & DEBUG:
584
+ parsed.dump(indent=0, reverse=reverse)
585
+
586
+ # Optimise the parsed pattern.
587
+ parsed = parsed.optimise(info, reverse)
588
+ parsed = parsed.pack_characters(info)
589
+
590
+ # Get the required string.
591
+ req_offset, req_chars, req_flags = _get_required_string(parsed, info.flags)
592
+
593
+ # Build the named lists.
594
+ named_lists = {}
595
+ named_list_indexes = [None] * len(info.named_lists_used)
596
+ args_needed = set()
597
+ for key, index in info.named_lists_used.items():
598
+ name, case_flags = key
599
+ values = frozenset(kwargs[name])
600
+ if case_flags:
601
+ items = frozenset(_fold_case(info, v) for v in values)
602
+ else:
603
+ items = values
604
+ named_lists[name] = values
605
+ named_list_indexes[index] = items
606
+ args_needed.add((name, values))
607
+
608
+ complain_unused_args()
609
+
610
+ # Check the features of the groups.
611
+ _check_group_features(info, parsed)
612
+
613
+ # Compile the parsed pattern. The result is a list of tuples.
614
+ code = parsed.compile(reverse)
615
+
616
+ # Is there a group call to the pattern as a whole?
617
+ key = (0, reverse, fuzzy)
618
+ ref = info.call_refs.get(key)
619
+ if ref is not None:
620
+ code = [(_OP.CALL_REF, ref)] + code + [(_OP.END, )]
621
+
622
+ # Add the final 'success' opcode.
623
+ code += [(_OP.SUCCESS, )]
624
+
625
+ # Compile the additional copies of the groups that we need.
626
+ for group, rev, fuz in info.additional_groups:
627
+ code += group.compile(rev, fuz)
628
+
629
+ # Flatten the code into a list of ints.
630
+ code = _flatten_code(code)
631
+
632
+ if not parsed.has_simple_start():
633
+ # Get the first set, if possible.
634
+ try:
635
+ fs_code = _compile_firstset(info, parsed.get_firstset(reverse))
636
+ fs_code = _flatten_code(fs_code)
637
+ code = fs_code + code
638
+ except _FirstSetError:
639
+ pass
640
+
641
+ # The named capture groups.
642
+ index_group = dict((v, n) for n, v in info.group_index.items())
643
+
644
+ # Create the PatternObject.
645
+ #
646
+ # Local flags like IGNORECASE affect the code generation, but aren't needed
647
+ # by the PatternObject itself. Conversely, global flags like LOCALE _don't_
648
+ # affect the code generation but _are_ needed by the PatternObject.
649
+ compiled_pattern = _regex.compile(pattern, info.flags | version, code,
650
+ info.group_index, index_group, named_lists, named_list_indexes,
651
+ req_offset, req_chars, req_flags, info.group_count)
652
+
653
+ # Do we need to reduce the size of the cache?
654
+ if len(_cache) >= _MAXCACHE:
655
+ with _cache_lock:
656
+ _shrink_cache(_cache, _named_args, _locale_sensitive, _MAXCACHE)
657
+
658
+ if cache_it:
659
+ if (info.flags & LOCALE) == 0:
660
+ pattern_locale = None
661
+
662
+ args_needed = frozenset(args_needed)
663
+
664
+ # Store this regular expression and named list.
665
+ pattern_key = (pattern, type(pattern), flags, args_needed,
666
+ DEFAULT_VERSION, pattern_locale)
667
+ _cache[pattern_key] = compiled_pattern
668
+
669
+ # Store what keyword arguments are needed.
670
+ _named_args[args_key] = args_needed
671
+
672
+ return compiled_pattern
673
+
674
+ def _compile_replacement_helper(pattern, template):
675
+ "Compiles a replacement template."
676
+ # This function is called by the _regex module.
677
+
678
+ # Have we seen this before?
679
+ key = pattern.pattern, pattern.flags, template
680
+ compiled = _replacement_cache.get(key)
681
+ if compiled is not None:
682
+ return compiled
683
+
684
+ if len(_replacement_cache) >= _MAXREPCACHE:
685
+ _replacement_cache.clear()
686
+
687
+ is_unicode = isinstance(template, str)
688
+ source = _Source(template)
689
+ if is_unicode:
690
+ def make_string(char_codes):
691
+ return "".join(chr(c) for c in char_codes)
692
+ else:
693
+ def make_string(char_codes):
694
+ return bytes(char_codes)
695
+
696
+ compiled = []
697
+ literal = []
698
+ while True:
699
+ ch = source.get()
700
+ if not ch:
701
+ break
702
+ if ch == "\\":
703
+ # '_compile_replacement' will return either an int group reference
704
+ # or a string literal. It returns items (plural) in order to handle
705
+ # a 2-character literal (an invalid escape sequence).
706
+ is_group, items = _compile_replacement(source, pattern, is_unicode)
707
+ if is_group:
708
+ # It's a group, so first flush the literal.
709
+ if literal:
710
+ compiled.append(make_string(literal))
711
+ literal = []
712
+ compiled.extend(items)
713
+ else:
714
+ literal.extend(items)
715
+ else:
716
+ literal.append(ord(ch))
717
+
718
+ # Flush the literal.
719
+ if literal:
720
+ compiled.append(make_string(literal))
721
+
722
+ _replacement_cache[key] = compiled
723
+
724
+ return compiled
725
+
726
+ # We define Pattern here after all the support objects have been defined.
727
+ _pat = _compile('', 0, False, {}, False)
728
+ Pattern = type(_pat)
729
+ Match = type(_pat.match(''))
730
+ del _pat
731
+
732
+ # Make Pattern public for typing annotations.
733
+ __all__.append("Pattern")
734
+ __all__.append("Match")
735
+
736
+ # We'll define an alias for the 'compile' function so that the repr of a
737
+ # pattern object is eval-able.
738
+ Regex = compile
739
+
740
+ # Register myself for pickling.
741
+ import copyreg as _copy_reg
742
+
743
+ def _pickle(pattern):
744
+ return _regex.compile, pattern._pickled_data
745
+
746
+ _copy_reg.pickle(Pattern, _pickle)
pythonProject/.venv/Lib/site-packages/regex/test_regex.py ADDED
The diff for this file is too large to render. See raw diff
 
pythonProject/.venv/Lib/site-packages/requests-2.32.5.dist-info/INSTALLER ADDED
@@ -0,0 +1 @@
 
 
1
+ pip
pythonProject/.venv/Lib/site-packages/requests-2.32.5.dist-info/METADATA ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Metadata-Version: 2.4
2
+ Name: requests
3
+ Version: 2.32.5
4
+ Summary: Python HTTP for Humans.
5
+ Home-page: https://requests.readthedocs.io
6
+ Author: Kenneth Reitz
7
+ Author-email: me@kennethreitz.org
8
+ License: Apache-2.0
9
+ Project-URL: Documentation, https://requests.readthedocs.io
10
+ Project-URL: Source, https://github.com/psf/requests
11
+ Classifier: Development Status :: 5 - Production/Stable
12
+ Classifier: Environment :: Web Environment
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Natural Language :: English
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3
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
+ Classifier: Programming Language :: Python :: 3 :: Only
26
+ Classifier: Programming Language :: Python :: Implementation :: CPython
27
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
28
+ Classifier: Topic :: Internet :: WWW/HTTP
29
+ Classifier: Topic :: Software Development :: Libraries
30
+ Requires-Python: >=3.9
31
+ Description-Content-Type: text/markdown
32
+ License-File: LICENSE
33
+ Requires-Dist: charset_normalizer<4,>=2
34
+ Requires-Dist: idna<4,>=2.5
35
+ Requires-Dist: urllib3<3,>=1.21.1
36
+ Requires-Dist: certifi>=2017.4.17
37
+ Provides-Extra: security
38
+ Provides-Extra: socks
39
+ Requires-Dist: PySocks!=1.5.7,>=1.5.6; extra == "socks"
40
+ Provides-Extra: use-chardet-on-py3
41
+ Requires-Dist: chardet<6,>=3.0.2; extra == "use-chardet-on-py3"
42
+ Dynamic: author
43
+ Dynamic: author-email
44
+ Dynamic: classifier
45
+ Dynamic: description
46
+ Dynamic: description-content-type
47
+ Dynamic: home-page
48
+ Dynamic: license
49
+ Dynamic: license-file
50
+ Dynamic: project-url
51
+ Dynamic: provides-extra
52
+ Dynamic: requires-dist
53
+ Dynamic: requires-python
54
+ Dynamic: summary
55
+
56
+ # Requests
57
+
58
+ **Requests** is a simple, yet elegant, HTTP library.
59
+
60
+ ```python
61
+ >>> import requests
62
+ >>> r = requests.get('https://httpbin.org/basic-auth/user/pass', auth=('user', 'pass'))
63
+ >>> r.status_code
64
+ 200
65
+ >>> r.headers['content-type']
66
+ 'application/json; charset=utf8'
67
+ >>> r.encoding
68
+ 'utf-8'
69
+ >>> r.text
70
+ '{"authenticated": true, ...'
71
+ >>> r.json()
72
+ {'authenticated': True, ...}
73
+ ```
74
+
75
+ Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode your `PUT` & `POST` data — but nowadays, just use the `json` method!
76
+
77
+ Requests is one of the most downloaded Python packages today, pulling in around `30M downloads / week`— according to GitHub, Requests is currently [depended upon](https://github.com/psf/requests/network/dependents?package_id=UGFja2FnZS01NzA4OTExNg%3D%3D) by `1,000,000+` repositories. You may certainly put your trust in this code.
78
+
79
+ [![Downloads](https://static.pepy.tech/badge/requests/month)](https://pepy.tech/project/requests)
80
+ [![Supported Versions](https://img.shields.io/pypi/pyversions/requests.svg)](https://pypi.org/project/requests)
81
+ [![Contributors](https://img.shields.io/github/contributors/psf/requests.svg)](https://github.com/psf/requests/graphs/contributors)
82
+
83
+ ## Installing Requests and Supported Versions
84
+
85
+ Requests is available on PyPI:
86
+
87
+ ```console
88
+ $ python -m pip install requests
89
+ ```
90
+
91
+ Requests officially supports Python 3.9+.
92
+
93
+ ## Supported Features & Best–Practices
94
+
95
+ Requests is ready for the demands of building robust and reliable HTTP–speaking applications, for the needs of today.
96
+
97
+ - Keep-Alive & Connection Pooling
98
+ - International Domains and URLs
99
+ - Sessions with Cookie Persistence
100
+ - Browser-style TLS/SSL Verification
101
+ - Basic & Digest Authentication
102
+ - Familiar `dict`–like Cookies
103
+ - Automatic Content Decompression and Decoding
104
+ - Multi-part File Uploads
105
+ - SOCKS Proxy Support
106
+ - Connection Timeouts
107
+ - Streaming Downloads
108
+ - Automatic honoring of `.netrc`
109
+ - Chunked HTTP Requests
110
+
111
+ ## API Reference and User Guide available on [Read the Docs](https://requests.readthedocs.io)
112
+
113
+ [![Read the Docs](https://raw.githubusercontent.com/psf/requests/main/ext/ss.png)](https://requests.readthedocs.io)
114
+
115
+ ## Cloning the repository
116
+
117
+ When cloning the Requests repository, you may need to add the `-c
118
+ fetch.fsck.badTimezone=ignore` flag to avoid an error about a bad commit timestamp (see
119
+ [this issue](https://github.com/psf/requests/issues/2690) for more background):
120
+
121
+ ```shell
122
+ git clone -c fetch.fsck.badTimezone=ignore https://github.com/psf/requests.git
123
+ ```
124
+
125
+ You can also apply this setting to your global Git config:
126
+
127
+ ```shell
128
+ git config --global fetch.fsck.badTimezone ignore
129
+ ```
130
+
131
+ ---
132
+
133
+ [![Kenneth Reitz](https://raw.githubusercontent.com/psf/requests/main/ext/kr.png)](https://kennethreitz.org) [![Python Software Foundation](https://raw.githubusercontent.com/psf/requests/main/ext/psf.png)](https://www.python.org/psf)
pythonProject/.venv/Lib/site-packages/requests-2.32.5.dist-info/RECORD ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ requests-2.32.5.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
2
+ requests-2.32.5.dist-info/METADATA,sha256=ZbWgjagfSRVRPnYJZf8Ut1GPZbe7Pv4NqzZLvMTUDLA,4945
3
+ requests-2.32.5.dist-info/RECORD,,
4
+ requests-2.32.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
+ requests-2.32.5.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
6
+ requests-2.32.5.dist-info/top_level.txt,sha256=fMSVmHfb5rbGOo6xv-O_tUX6j-WyixssE-SnwcDRxNQ,9
7
+ requests/__init__.py,sha256=4xaAERmPDIBPsa2PsjpU9r06yooK-2mZKHTZAhWRWts,5072
8
+ requests/__pycache__/__init__.cpython-310.pyc,,
9
+ requests/__pycache__/__version__.cpython-310.pyc,,
10
+ requests/__pycache__/_internal_utils.cpython-310.pyc,,
11
+ requests/__pycache__/adapters.cpython-310.pyc,,
12
+ requests/__pycache__/api.cpython-310.pyc,,
13
+ requests/__pycache__/auth.cpython-310.pyc,,
14
+ requests/__pycache__/certs.cpython-310.pyc,,
15
+ requests/__pycache__/compat.cpython-310.pyc,,
16
+ requests/__pycache__/cookies.cpython-310.pyc,,
17
+ requests/__pycache__/exceptions.cpython-310.pyc,,
18
+ requests/__pycache__/help.cpython-310.pyc,,
19
+ requests/__pycache__/hooks.cpython-310.pyc,,
20
+ requests/__pycache__/models.cpython-310.pyc,,
21
+ requests/__pycache__/packages.cpython-310.pyc,,
22
+ requests/__pycache__/sessions.cpython-310.pyc,,
23
+ requests/__pycache__/status_codes.cpython-310.pyc,,
24
+ requests/__pycache__/structures.cpython-310.pyc,,
25
+ requests/__pycache__/utils.cpython-310.pyc,,
26
+ requests/__version__.py,sha256=QKDceK8K_ujqwDDc3oYrR0odOBYgKVOQQ5vFap_G_cg,435
27
+ requests/_internal_utils.py,sha256=nMQymr4hs32TqVo5AbCrmcJEhvPUh7xXlluyqwslLiQ,1495
28
+ requests/adapters.py,sha256=8nX113gbb123aUtx2ETkAN_6IsYX-M2fRoLGluTEcRk,26285
29
+ requests/api.py,sha256=_Zb9Oa7tzVIizTKwFrPjDEY9ejtm_OnSRERnADxGsQs,6449
30
+ requests/auth.py,sha256=kF75tqnLctZ9Mf_hm9TZIj4cQWnN5uxRz8oWsx5wmR0,10186
31
+ requests/certs.py,sha256=Z9Sb410Anv6jUFTyss0jFFhU6xst8ctELqfy8Ev23gw,429
32
+ requests/compat.py,sha256=J7sIjR6XoDGp5JTVzOxkK5fSoUVUa_Pjc7iRZhAWGmI,2142
33
+ requests/cookies.py,sha256=bNi-iqEj4NPZ00-ob-rHvzkvObzN3lEpgw3g6paS3Xw,18590
34
+ requests/exceptions.py,sha256=jJPS1UWATs86ShVUaLorTiJb1SaGuoNEWgICJep-VkY,4260
35
+ requests/help.py,sha256=gPX5d_H7Xd88aDABejhqGgl9B1VFRTt5BmiYvL3PzIQ,3875
36
+ requests/hooks.py,sha256=CiuysiHA39V5UfcCBXFIx83IrDpuwfN9RcTUgv28ftQ,733
37
+ requests/models.py,sha256=MjZdZ4k7tnw-1nz5PKShjmPmqyk0L6DciwnFngb_Vk4,35510
38
+ requests/packages.py,sha256=_g0gZ681UyAlKHRjH6kanbaoxx2eAb6qzcXiODyTIoc,904
39
+ requests/sessions.py,sha256=Cl1dpEnOfwrzzPbku-emepNeN4Rt_0_58Iy2x-JGTm8,30503
40
+ requests/status_codes.py,sha256=iJUAeA25baTdw-6PfD0eF4qhpINDJRJI-yaMqxs4LEI,4322
41
+ requests/structures.py,sha256=-IbmhVz06S-5aPSZuUthZ6-6D9XOjRuTXHOabY041XM,2912
42
+ requests/utils.py,sha256=WqU86rZ3wvhC-tQjWcjtH_HEKZwWB3iWCZV6SW5DEdQ,33213
pythonProject/.venv/Lib/site-packages/requests-2.32.5.dist-info/WHEEL ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
pythonProject/.venv/Lib/site-packages/requests-2.32.5.dist-info/licenses/LICENSE ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
pythonProject/.venv/Lib/site-packages/requests-2.32.5.dist-info/top_level.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ requests
pythonProject/.venv/Lib/site-packages/requests/__init__.py ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # __
2
+ # /__) _ _ _ _ _/ _
3
+ # / ( (- (/ (/ (- _) / _)
4
+ # /
5
+
6
+ """
7
+ Requests HTTP Library
8
+ ~~~~~~~~~~~~~~~~~~~~~
9
+
10
+ Requests is an HTTP library, written in Python, for human beings.
11
+ Basic GET usage:
12
+
13
+ >>> import requests
14
+ >>> r = requests.get('https://www.python.org')
15
+ >>> r.status_code
16
+ 200
17
+ >>> b'Python is a programming language' in r.content
18
+ True
19
+
20
+ ... or POST:
21
+
22
+ >>> payload = dict(key1='value1', key2='value2')
23
+ >>> r = requests.post('https://httpbin.org/post', data=payload)
24
+ >>> print(r.text)
25
+ {
26
+ ...
27
+ "form": {
28
+ "key1": "value1",
29
+ "key2": "value2"
30
+ },
31
+ ...
32
+ }
33
+
34
+ The other HTTP methods are supported - see `requests.api`. Full documentation
35
+ is at <https://requests.readthedocs.io>.
36
+
37
+ :copyright: (c) 2017 by Kenneth Reitz.
38
+ :license: Apache 2.0, see LICENSE for more details.
39
+ """
40
+
41
+ import warnings
42
+
43
+ import urllib3
44
+
45
+ from .exceptions import RequestsDependencyWarning
46
+
47
+ try:
48
+ from charset_normalizer import __version__ as charset_normalizer_version
49
+ except ImportError:
50
+ charset_normalizer_version = None
51
+
52
+ try:
53
+ from chardet import __version__ as chardet_version
54
+ except ImportError:
55
+ chardet_version = None
56
+
57
+
58
+ def check_compatibility(urllib3_version, chardet_version, charset_normalizer_version):
59
+ urllib3_version = urllib3_version.split(".")
60
+ assert urllib3_version != ["dev"] # Verify urllib3 isn't installed from git.
61
+
62
+ # Sometimes, urllib3 only reports its version as 16.1.
63
+ if len(urllib3_version) == 2:
64
+ urllib3_version.append("0")
65
+
66
+ # Check urllib3 for compatibility.
67
+ major, minor, patch = urllib3_version # noqa: F811
68
+ major, minor, patch = int(major), int(minor), int(patch)
69
+ # urllib3 >= 1.21.1
70
+ assert major >= 1
71
+ if major == 1:
72
+ assert minor >= 21
73
+
74
+ # Check charset_normalizer for compatibility.
75
+ if chardet_version:
76
+ major, minor, patch = chardet_version.split(".")[:3]
77
+ major, minor, patch = int(major), int(minor), int(patch)
78
+ # chardet_version >= 3.0.2, < 6.0.0
79
+ assert (3, 0, 2) <= (major, minor, patch) < (6, 0, 0)
80
+ elif charset_normalizer_version:
81
+ major, minor, patch = charset_normalizer_version.split(".")[:3]
82
+ major, minor, patch = int(major), int(minor), int(patch)
83
+ # charset_normalizer >= 2.0.0 < 4.0.0
84
+ assert (2, 0, 0) <= (major, minor, patch) < (4, 0, 0)
85
+ else:
86
+ warnings.warn(
87
+ "Unable to find acceptable character detection dependency "
88
+ "(chardet or charset_normalizer).",
89
+ RequestsDependencyWarning,
90
+ )
91
+
92
+
93
+ def _check_cryptography(cryptography_version):
94
+ # cryptography < 1.3.4
95
+ try:
96
+ cryptography_version = list(map(int, cryptography_version.split(".")))
97
+ except ValueError:
98
+ return
99
+
100
+ if cryptography_version < [1, 3, 4]:
101
+ warning = "Old version of cryptography ({}) may cause slowdown.".format(
102
+ cryptography_version
103
+ )
104
+ warnings.warn(warning, RequestsDependencyWarning)
105
+
106
+
107
+ # Check imported dependencies for compatibility.
108
+ try:
109
+ check_compatibility(
110
+ urllib3.__version__, chardet_version, charset_normalizer_version
111
+ )
112
+ except (AssertionError, ValueError):
113
+ warnings.warn(
114
+ "urllib3 ({}) or chardet ({})/charset_normalizer ({}) doesn't match a supported "
115
+ "version!".format(
116
+ urllib3.__version__, chardet_version, charset_normalizer_version
117
+ ),
118
+ RequestsDependencyWarning,
119
+ )
120
+
121
+ # Attempt to enable urllib3's fallback for SNI support
122
+ # if the standard library doesn't support SNI or the
123
+ # 'ssl' library isn't available.
124
+ try:
125
+ try:
126
+ import ssl
127
+ except ImportError:
128
+ ssl = None
129
+
130
+ if not getattr(ssl, "HAS_SNI", False):
131
+ from urllib3.contrib import pyopenssl
132
+
133
+ pyopenssl.inject_into_urllib3()
134
+
135
+ # Check cryptography version
136
+ from cryptography import __version__ as cryptography_version
137
+
138
+ _check_cryptography(cryptography_version)
139
+ except ImportError:
140
+ pass
141
+
142
+ # urllib3's DependencyWarnings should be silenced.
143
+ from urllib3.exceptions import DependencyWarning
144
+
145
+ warnings.simplefilter("ignore", DependencyWarning)
146
+
147
+ # Set default logging handler to avoid "No handler found" warnings.
148
+ import logging
149
+ from logging import NullHandler
150
+
151
+ from . import packages, utils
152
+ from .__version__ import (
153
+ __author__,
154
+ __author_email__,
155
+ __build__,
156
+ __cake__,
157
+ __copyright__,
158
+ __description__,
159
+ __license__,
160
+ __title__,
161
+ __url__,
162
+ __version__,
163
+ )
164
+ from .api import delete, get, head, options, patch, post, put, request
165
+ from .exceptions import (
166
+ ConnectionError,
167
+ ConnectTimeout,
168
+ FileModeWarning,
169
+ HTTPError,
170
+ JSONDecodeError,
171
+ ReadTimeout,
172
+ RequestException,
173
+ Timeout,
174
+ TooManyRedirects,
175
+ URLRequired,
176
+ )
177
+ from .models import PreparedRequest, Request, Response
178
+ from .sessions import Session, session
179
+ from .status_codes import codes
180
+
181
+ logging.getLogger(__name__).addHandler(NullHandler())
182
+
183
+ # FileModeWarnings go off per the default.
184
+ warnings.simplefilter("default", FileModeWarning, append=True)
pythonProject/.venv/Lib/site-packages/requests/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (3.91 kB). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/__version__.cpython-310.pyc ADDED
Binary file (523 Bytes). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/_internal_utils.cpython-310.pyc ADDED
Binary file (1.6 kB). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/adapters.cpython-310.pyc ADDED
Binary file (21.7 kB). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/api.cpython-310.pyc ADDED
Binary file (6.7 kB). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/auth.cpython-310.pyc ADDED
Binary file (8.1 kB). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/certs.cpython-310.pyc ADDED
Binary file (600 Bytes). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/compat.cpython-310.pyc ADDED
Binary file (1.93 kB). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/cookies.cpython-310.pyc ADDED
Binary file (18.7 kB). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/exceptions.cpython-310.pyc ADDED
Binary file (6.2 kB). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/help.cpython-310.pyc ADDED
Binary file (2.82 kB). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/hooks.cpython-310.pyc ADDED
Binary file (967 Bytes). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/models.cpython-310.pyc ADDED
Binary file (24.3 kB). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/packages.cpython-310.pyc ADDED
Binary file (604 Bytes). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/sessions.cpython-310.pyc ADDED
Binary file (19.7 kB). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/status_codes.cpython-310.pyc ADDED
Binary file (4.72 kB). View file
 
pythonProject/.venv/Lib/site-packages/requests/__pycache__/structures.cpython-310.pyc ADDED
Binary file (4.41 kB). View file