cli-ih 0.6.3.1__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. cli_ih/__init__.py +1 -0
  2. cli_ih/asyncClient.py +73 -10
  3. cli_ih/client.py +63 -18
  4. cli_ih/utils.py +51 -0
  5. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/METADATA +1 -1
  6. cli_ih-0.7.0.dist-info/RECORD +9 -0
  7. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/top_level.txt +0 -1
  8. cli_ih-0.6.3.1.dist-info/RECORD +0 -425
  9. venv/Lib/site-packages/__editable___cli_ih_0_6_3_1_finder.py +0 -85
  10. venv/Lib/site-packages/pip/__init__.py +0 -13
  11. venv/Lib/site-packages/pip/__main__.py +0 -24
  12. venv/Lib/site-packages/pip/__pip-runner__.py +0 -50
  13. venv/Lib/site-packages/pip/_internal/__init__.py +0 -18
  14. venv/Lib/site-packages/pip/_internal/build_env.py +0 -349
  15. venv/Lib/site-packages/pip/_internal/cache.py +0 -291
  16. venv/Lib/site-packages/pip/_internal/cli/__init__.py +0 -3
  17. venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +0 -184
  18. venv/Lib/site-packages/pip/_internal/cli/base_command.py +0 -244
  19. venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +0 -1138
  20. venv/Lib/site-packages/pip/_internal/cli/command_context.py +0 -28
  21. venv/Lib/site-packages/pip/_internal/cli/index_command.py +0 -175
  22. venv/Lib/site-packages/pip/_internal/cli/main.py +0 -80
  23. venv/Lib/site-packages/pip/_internal/cli/main_parser.py +0 -134
  24. venv/Lib/site-packages/pip/_internal/cli/parser.py +0 -298
  25. venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +0 -151
  26. venv/Lib/site-packages/pip/_internal/cli/req_command.py +0 -351
  27. venv/Lib/site-packages/pip/_internal/cli/spinners.py +0 -235
  28. venv/Lib/site-packages/pip/_internal/cli/status_codes.py +0 -6
  29. venv/Lib/site-packages/pip/_internal/commands/__init__.py +0 -139
  30. venv/Lib/site-packages/pip/_internal/commands/cache.py +0 -231
  31. venv/Lib/site-packages/pip/_internal/commands/check.py +0 -66
  32. venv/Lib/site-packages/pip/_internal/commands/completion.py +0 -135
  33. venv/Lib/site-packages/pip/_internal/commands/configuration.py +0 -288
  34. venv/Lib/site-packages/pip/_internal/commands/debug.py +0 -203
  35. venv/Lib/site-packages/pip/_internal/commands/download.py +0 -145
  36. venv/Lib/site-packages/pip/_internal/commands/freeze.py +0 -107
  37. venv/Lib/site-packages/pip/_internal/commands/hash.py +0 -58
  38. venv/Lib/site-packages/pip/_internal/commands/help.py +0 -40
  39. venv/Lib/site-packages/pip/_internal/commands/index.py +0 -159
  40. venv/Lib/site-packages/pip/_internal/commands/inspect.py +0 -92
  41. venv/Lib/site-packages/pip/_internal/commands/install.py +0 -798
  42. venv/Lib/site-packages/pip/_internal/commands/list.py +0 -400
  43. venv/Lib/site-packages/pip/_internal/commands/lock.py +0 -170
  44. venv/Lib/site-packages/pip/_internal/commands/search.py +0 -178
  45. venv/Lib/site-packages/pip/_internal/commands/show.py +0 -231
  46. venv/Lib/site-packages/pip/_internal/commands/uninstall.py +0 -113
  47. venv/Lib/site-packages/pip/_internal/commands/wheel.py +0 -181
  48. venv/Lib/site-packages/pip/_internal/configuration.py +0 -397
  49. venv/Lib/site-packages/pip/_internal/distributions/__init__.py +0 -21
  50. venv/Lib/site-packages/pip/_internal/distributions/base.py +0 -55
  51. venv/Lib/site-packages/pip/_internal/distributions/installed.py +0 -33
  52. venv/Lib/site-packages/pip/_internal/distributions/sdist.py +0 -165
  53. venv/Lib/site-packages/pip/_internal/distributions/wheel.py +0 -44
  54. venv/Lib/site-packages/pip/_internal/exceptions.py +0 -881
  55. venv/Lib/site-packages/pip/_internal/index/__init__.py +0 -1
  56. venv/Lib/site-packages/pip/_internal/index/collector.py +0 -489
  57. venv/Lib/site-packages/pip/_internal/index/package_finder.py +0 -1059
  58. venv/Lib/site-packages/pip/_internal/index/sources.py +0 -287
  59. venv/Lib/site-packages/pip/_internal/locations/__init__.py +0 -441
  60. venv/Lib/site-packages/pip/_internal/locations/_distutils.py +0 -173
  61. venv/Lib/site-packages/pip/_internal/locations/_sysconfig.py +0 -215
  62. venv/Lib/site-packages/pip/_internal/locations/base.py +0 -82
  63. venv/Lib/site-packages/pip/_internal/main.py +0 -12
  64. venv/Lib/site-packages/pip/_internal/metadata/__init__.py +0 -164
  65. venv/Lib/site-packages/pip/_internal/metadata/_json.py +0 -87
  66. venv/Lib/site-packages/pip/_internal/metadata/base.py +0 -685
  67. venv/Lib/site-packages/pip/_internal/metadata/importlib/__init__.py +0 -6
  68. venv/Lib/site-packages/pip/_internal/metadata/importlib/_compat.py +0 -87
  69. venv/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +0 -223
  70. venv/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +0 -143
  71. venv/Lib/site-packages/pip/_internal/metadata/pkg_resources.py +0 -298
  72. venv/Lib/site-packages/pip/_internal/models/__init__.py +0 -1
  73. venv/Lib/site-packages/pip/_internal/models/candidate.py +0 -25
  74. venv/Lib/site-packages/pip/_internal/models/direct_url.py +0 -227
  75. venv/Lib/site-packages/pip/_internal/models/format_control.py +0 -78
  76. venv/Lib/site-packages/pip/_internal/models/index.py +0 -28
  77. venv/Lib/site-packages/pip/_internal/models/installation_report.py +0 -57
  78. venv/Lib/site-packages/pip/_internal/models/link.py +0 -613
  79. venv/Lib/site-packages/pip/_internal/models/pylock.py +0 -188
  80. venv/Lib/site-packages/pip/_internal/models/scheme.py +0 -25
  81. venv/Lib/site-packages/pip/_internal/models/search_scope.py +0 -126
  82. venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +0 -53
  83. venv/Lib/site-packages/pip/_internal/models/target_python.py +0 -122
  84. venv/Lib/site-packages/pip/_internal/models/wheel.py +0 -141
  85. venv/Lib/site-packages/pip/_internal/network/__init__.py +0 -1
  86. venv/Lib/site-packages/pip/_internal/network/auth.py +0 -564
  87. venv/Lib/site-packages/pip/_internal/network/cache.py +0 -133
  88. venv/Lib/site-packages/pip/_internal/network/download.py +0 -342
  89. venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +0 -213
  90. venv/Lib/site-packages/pip/_internal/network/session.py +0 -528
  91. venv/Lib/site-packages/pip/_internal/network/utils.py +0 -98
  92. venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +0 -61
  93. venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
  94. venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  95. venv/Lib/site-packages/pip/_internal/operations/build/build_tracker.py +0 -140
  96. venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +0 -38
  97. venv/Lib/site-packages/pip/_internal/operations/build/metadata_editable.py +0 -41
  98. venv/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py +0 -73
  99. venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +0 -38
  100. venv/Lib/site-packages/pip/_internal/operations/build/wheel_editable.py +0 -47
  101. venv/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py +0 -119
  102. venv/Lib/site-packages/pip/_internal/operations/check.py +0 -175
  103. venv/Lib/site-packages/pip/_internal/operations/freeze.py +0 -259
  104. venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +0 -1
  105. venv/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py +0 -48
  106. venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +0 -746
  107. venv/Lib/site-packages/pip/_internal/operations/prepare.py +0 -742
  108. venv/Lib/site-packages/pip/_internal/pyproject.py +0 -182
  109. venv/Lib/site-packages/pip/_internal/req/__init__.py +0 -105
  110. venv/Lib/site-packages/pip/_internal/req/constructors.py +0 -562
  111. venv/Lib/site-packages/pip/_internal/req/req_dependency_group.py +0 -75
  112. venv/Lib/site-packages/pip/_internal/req/req_file.py +0 -620
  113. venv/Lib/site-packages/pip/_internal/req/req_install.py +0 -937
  114. venv/Lib/site-packages/pip/_internal/req/req_set.py +0 -81
  115. venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +0 -639
  116. venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
  117. venv/Lib/site-packages/pip/_internal/resolution/base.py +0 -20
  118. venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  119. venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +0 -598
  120. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  121. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +0 -142
  122. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -582
  123. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +0 -814
  124. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +0 -166
  125. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +0 -276
  126. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +0 -85
  127. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +0 -247
  128. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +0 -336
  129. venv/Lib/site-packages/pip/_internal/self_outdated_check.py +0 -254
  130. venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
  131. venv/Lib/site-packages/pip/_internal/utils/_jaraco_text.py +0 -109
  132. venv/Lib/site-packages/pip/_internal/utils/_log.py +0 -38
  133. venv/Lib/site-packages/pip/_internal/utils/appdirs.py +0 -52
  134. venv/Lib/site-packages/pip/_internal/utils/compat.py +0 -85
  135. venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +0 -201
  136. venv/Lib/site-packages/pip/_internal/utils/datetime.py +0 -10
  137. venv/Lib/site-packages/pip/_internal/utils/deprecation.py +0 -126
  138. venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +0 -87
  139. venv/Lib/site-packages/pip/_internal/utils/egg_link.py +0 -81
  140. venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +0 -88
  141. venv/Lib/site-packages/pip/_internal/utils/filesystem.py +0 -152
  142. venv/Lib/site-packages/pip/_internal/utils/filetypes.py +0 -24
  143. venv/Lib/site-packages/pip/_internal/utils/glibc.py +0 -102
  144. venv/Lib/site-packages/pip/_internal/utils/hashes.py +0 -150
  145. venv/Lib/site-packages/pip/_internal/utils/logging.py +0 -364
  146. venv/Lib/site-packages/pip/_internal/utils/misc.py +0 -765
  147. venv/Lib/site-packages/pip/_internal/utils/packaging.py +0 -44
  148. venv/Lib/site-packages/pip/_internal/utils/retry.py +0 -45
  149. venv/Lib/site-packages/pip/_internal/utils/setuptools_build.py +0 -149
  150. venv/Lib/site-packages/pip/_internal/utils/subprocess.py +0 -248
  151. venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +0 -294
  152. venv/Lib/site-packages/pip/_internal/utils/unpacking.py +0 -337
  153. venv/Lib/site-packages/pip/_internal/utils/urls.py +0 -55
  154. venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +0 -105
  155. venv/Lib/site-packages/pip/_internal/utils/wheel.py +0 -132
  156. venv/Lib/site-packages/pip/_internal/vcs/__init__.py +0 -15
  157. venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +0 -130
  158. venv/Lib/site-packages/pip/_internal/vcs/git.py +0 -571
  159. venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +0 -186
  160. venv/Lib/site-packages/pip/_internal/vcs/subversion.py +0 -335
  161. venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +0 -693
  162. venv/Lib/site-packages/pip/_internal/wheel_builder.py +0 -334
  163. venv/Lib/site-packages/pip/_vendor/__init__.py +0 -117
  164. venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +0 -29
  165. venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +0 -70
  166. venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +0 -168
  167. venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +0 -75
  168. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +0 -8
  169. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +0 -145
  170. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +0 -48
  171. venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +0 -511
  172. venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +0 -119
  173. venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +0 -157
  174. venv/Lib/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
  175. venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +0 -146
  176. venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +0 -43
  177. venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +0 -4
  178. venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +0 -12
  179. venv/Lib/site-packages/pip/_vendor/certifi/core.py +0 -83
  180. venv/Lib/site-packages/pip/_vendor/certifi/py.typed +0 -0
  181. venv/Lib/site-packages/pip/_vendor/dependency_groups/__init__.py +0 -13
  182. venv/Lib/site-packages/pip/_vendor/dependency_groups/__main__.py +0 -65
  183. venv/Lib/site-packages/pip/_vendor/dependency_groups/_implementation.py +0 -209
  184. venv/Lib/site-packages/pip/_vendor/dependency_groups/_lint_dependency_groups.py +0 -59
  185. venv/Lib/site-packages/pip/_vendor/dependency_groups/_pip_wrapper.py +0 -62
  186. venv/Lib/site-packages/pip/_vendor/dependency_groups/_toml_compat.py +0 -9
  187. venv/Lib/site-packages/pip/_vendor/dependency_groups/py.typed +0 -0
  188. venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +0 -33
  189. venv/Lib/site-packages/pip/_vendor/distlib/compat.py +0 -1137
  190. venv/Lib/site-packages/pip/_vendor/distlib/resources.py +0 -358
  191. venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +0 -447
  192. venv/Lib/site-packages/pip/_vendor/distlib/util.py +0 -1984
  193. venv/Lib/site-packages/pip/_vendor/distro/__init__.py +0 -54
  194. venv/Lib/site-packages/pip/_vendor/distro/__main__.py +0 -4
  195. venv/Lib/site-packages/pip/_vendor/distro/distro.py +0 -1403
  196. venv/Lib/site-packages/pip/_vendor/distro/py.typed +0 -0
  197. venv/Lib/site-packages/pip/_vendor/idna/__init__.py +0 -45
  198. venv/Lib/site-packages/pip/_vendor/idna/codec.py +0 -122
  199. venv/Lib/site-packages/pip/_vendor/idna/compat.py +0 -15
  200. venv/Lib/site-packages/pip/_vendor/idna/core.py +0 -437
  201. venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +0 -4243
  202. venv/Lib/site-packages/pip/_vendor/idna/intranges.py +0 -57
  203. venv/Lib/site-packages/pip/_vendor/idna/package_data.py +0 -1
  204. venv/Lib/site-packages/pip/_vendor/idna/py.typed +0 -0
  205. venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +0 -8681
  206. venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +0 -55
  207. venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +0 -48
  208. venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +0 -170
  209. venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +0 -929
  210. venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +0 -15
  211. venv/Lib/site-packages/pip/_vendor/packaging/_elffile.py +0 -109
  212. venv/Lib/site-packages/pip/_vendor/packaging/_manylinux.py +0 -262
  213. venv/Lib/site-packages/pip/_vendor/packaging/_musllinux.py +0 -85
  214. venv/Lib/site-packages/pip/_vendor/packaging/_parser.py +0 -353
  215. venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +0 -61
  216. venv/Lib/site-packages/pip/_vendor/packaging/_tokenizer.py +0 -195
  217. venv/Lib/site-packages/pip/_vendor/packaging/licenses/__init__.py +0 -145
  218. venv/Lib/site-packages/pip/_vendor/packaging/licenses/_spdx.py +0 -759
  219. venv/Lib/site-packages/pip/_vendor/packaging/markers.py +0 -362
  220. venv/Lib/site-packages/pip/_vendor/packaging/metadata.py +0 -862
  221. venv/Lib/site-packages/pip/_vendor/packaging/py.typed +0 -0
  222. venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +0 -91
  223. venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +0 -1019
  224. venv/Lib/site-packages/pip/_vendor/packaging/tags.py +0 -656
  225. venv/Lib/site-packages/pip/_vendor/packaging/utils.py +0 -163
  226. venv/Lib/site-packages/pip/_vendor/packaging/version.py +0 -582
  227. venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +0 -3676
  228. venv/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +0 -631
  229. venv/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +0 -55
  230. venv/Lib/site-packages/pip/_vendor/platformdirs/android.py +0 -249
  231. venv/Lib/site-packages/pip/_vendor/platformdirs/api.py +0 -299
  232. venv/Lib/site-packages/pip/_vendor/platformdirs/macos.py +0 -144
  233. venv/Lib/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
  234. venv/Lib/site-packages/pip/_vendor/platformdirs/unix.py +0 -272
  235. venv/Lib/site-packages/pip/_vendor/platformdirs/version.py +0 -21
  236. venv/Lib/site-packages/pip/_vendor/platformdirs/windows.py +0 -272
  237. venv/Lib/site-packages/pip/_vendor/pygments/__init__.py +0 -82
  238. venv/Lib/site-packages/pip/_vendor/pygments/__main__.py +0 -17
  239. venv/Lib/site-packages/pip/_vendor/pygments/console.py +0 -70
  240. venv/Lib/site-packages/pip/_vendor/pygments/filter.py +0 -70
  241. venv/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +0 -940
  242. venv/Lib/site-packages/pip/_vendor/pygments/formatter.py +0 -129
  243. venv/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +0 -157
  244. venv/Lib/site-packages/pip/_vendor/pygments/formatters/_mapping.py +0 -23
  245. venv/Lib/site-packages/pip/_vendor/pygments/lexer.py +0 -963
  246. venv/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +0 -362
  247. venv/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +0 -602
  248. venv/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +0 -1201
  249. venv/Lib/site-packages/pip/_vendor/pygments/modeline.py +0 -43
  250. venv/Lib/site-packages/pip/_vendor/pygments/plugin.py +0 -72
  251. venv/Lib/site-packages/pip/_vendor/pygments/regexopt.py +0 -91
  252. venv/Lib/site-packages/pip/_vendor/pygments/scanner.py +0 -104
  253. venv/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +0 -247
  254. venv/Lib/site-packages/pip/_vendor/pygments/style.py +0 -203
  255. venv/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +0 -61
  256. venv/Lib/site-packages/pip/_vendor/pygments/styles/_mapping.py +0 -54
  257. venv/Lib/site-packages/pip/_vendor/pygments/token.py +0 -214
  258. venv/Lib/site-packages/pip/_vendor/pygments/unistring.py +0 -153
  259. venv/Lib/site-packages/pip/_vendor/pygments/util.py +0 -324
  260. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/__init__.py +0 -31
  261. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py +0 -410
  262. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +0 -21
  263. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +0 -389
  264. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/py.typed +0 -0
  265. venv/Lib/site-packages/pip/_vendor/requests/__init__.py +0 -179
  266. venv/Lib/site-packages/pip/_vendor/requests/__version__.py +0 -14
  267. venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +0 -50
  268. venv/Lib/site-packages/pip/_vendor/requests/adapters.py +0 -719
  269. venv/Lib/site-packages/pip/_vendor/requests/api.py +0 -157
  270. venv/Lib/site-packages/pip/_vendor/requests/auth.py +0 -314
  271. venv/Lib/site-packages/pip/_vendor/requests/certs.py +0 -17
  272. venv/Lib/site-packages/pip/_vendor/requests/compat.py +0 -90
  273. venv/Lib/site-packages/pip/_vendor/requests/cookies.py +0 -561
  274. venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +0 -151
  275. venv/Lib/site-packages/pip/_vendor/requests/help.py +0 -127
  276. venv/Lib/site-packages/pip/_vendor/requests/hooks.py +0 -33
  277. venv/Lib/site-packages/pip/_vendor/requests/models.py +0 -1039
  278. venv/Lib/site-packages/pip/_vendor/requests/packages.py +0 -25
  279. venv/Lib/site-packages/pip/_vendor/requests/sessions.py +0 -831
  280. venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +0 -128
  281. venv/Lib/site-packages/pip/_vendor/requests/structures.py +0 -99
  282. venv/Lib/site-packages/pip/_vendor/requests/utils.py +0 -1086
  283. venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +0 -27
  284. venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +0 -196
  285. venv/Lib/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
  286. venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +0 -55
  287. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/__init__.py +0 -27
  288. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/abstract.py +0 -47
  289. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/criterion.py +0 -48
  290. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/exceptions.py +0 -57
  291. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py +0 -622
  292. venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +0 -209
  293. venv/Lib/site-packages/pip/_vendor/rich/__init__.py +0 -177
  294. venv/Lib/site-packages/pip/_vendor/rich/__main__.py +0 -245
  295. venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py +0 -454
  296. venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py +0 -3610
  297. venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py +0 -32
  298. venv/Lib/site-packages/pip/_vendor/rich/_export_format.py +0 -76
  299. venv/Lib/site-packages/pip/_vendor/rich/_extension.py +0 -10
  300. venv/Lib/site-packages/pip/_vendor/rich/_fileno.py +0 -24
  301. venv/Lib/site-packages/pip/_vendor/rich/_inspect.py +0 -268
  302. venv/Lib/site-packages/pip/_vendor/rich/_log_render.py +0 -94
  303. venv/Lib/site-packages/pip/_vendor/rich/_loop.py +0 -43
  304. venv/Lib/site-packages/pip/_vendor/rich/_null_file.py +0 -69
  305. venv/Lib/site-packages/pip/_vendor/rich/_palettes.py +0 -309
  306. venv/Lib/site-packages/pip/_vendor/rich/_pick.py +0 -17
  307. venv/Lib/site-packages/pip/_vendor/rich/_ratio.py +0 -153
  308. venv/Lib/site-packages/pip/_vendor/rich/_spinners.py +0 -482
  309. venv/Lib/site-packages/pip/_vendor/rich/_stack.py +0 -16
  310. venv/Lib/site-packages/pip/_vendor/rich/_timer.py +0 -19
  311. venv/Lib/site-packages/pip/_vendor/rich/_win32_console.py +0 -661
  312. venv/Lib/site-packages/pip/_vendor/rich/_windows.py +0 -71
  313. venv/Lib/site-packages/pip/_vendor/rich/_windows_renderer.py +0 -56
  314. venv/Lib/site-packages/pip/_vendor/rich/_wrap.py +0 -93
  315. venv/Lib/site-packages/pip/_vendor/rich/abc.py +0 -33
  316. venv/Lib/site-packages/pip/_vendor/rich/align.py +0 -306
  317. venv/Lib/site-packages/pip/_vendor/rich/ansi.py +0 -241
  318. venv/Lib/site-packages/pip/_vendor/rich/bar.py +0 -93
  319. venv/Lib/site-packages/pip/_vendor/rich/box.py +0 -474
  320. venv/Lib/site-packages/pip/_vendor/rich/cells.py +0 -174
  321. venv/Lib/site-packages/pip/_vendor/rich/color.py +0 -621
  322. venv/Lib/site-packages/pip/_vendor/rich/color_triplet.py +0 -38
  323. venv/Lib/site-packages/pip/_vendor/rich/columns.py +0 -187
  324. venv/Lib/site-packages/pip/_vendor/rich/console.py +0 -2680
  325. venv/Lib/site-packages/pip/_vendor/rich/constrain.py +0 -37
  326. venv/Lib/site-packages/pip/_vendor/rich/containers.py +0 -167
  327. venv/Lib/site-packages/pip/_vendor/rich/control.py +0 -219
  328. venv/Lib/site-packages/pip/_vendor/rich/default_styles.py +0 -193
  329. venv/Lib/site-packages/pip/_vendor/rich/diagnose.py +0 -39
  330. venv/Lib/site-packages/pip/_vendor/rich/emoji.py +0 -91
  331. venv/Lib/site-packages/pip/_vendor/rich/errors.py +0 -34
  332. venv/Lib/site-packages/pip/_vendor/rich/file_proxy.py +0 -57
  333. venv/Lib/site-packages/pip/_vendor/rich/filesize.py +0 -88
  334. venv/Lib/site-packages/pip/_vendor/rich/highlighter.py +0 -232
  335. venv/Lib/site-packages/pip/_vendor/rich/json.py +0 -139
  336. venv/Lib/site-packages/pip/_vendor/rich/jupyter.py +0 -101
  337. venv/Lib/site-packages/pip/_vendor/rich/layout.py +0 -442
  338. venv/Lib/site-packages/pip/_vendor/rich/live.py +0 -400
  339. venv/Lib/site-packages/pip/_vendor/rich/live_render.py +0 -106
  340. venv/Lib/site-packages/pip/_vendor/rich/logging.py +0 -297
  341. venv/Lib/site-packages/pip/_vendor/rich/markup.py +0 -251
  342. venv/Lib/site-packages/pip/_vendor/rich/measure.py +0 -151
  343. venv/Lib/site-packages/pip/_vendor/rich/padding.py +0 -141
  344. venv/Lib/site-packages/pip/_vendor/rich/pager.py +0 -34
  345. venv/Lib/site-packages/pip/_vendor/rich/palette.py +0 -100
  346. venv/Lib/site-packages/pip/_vendor/rich/panel.py +0 -317
  347. venv/Lib/site-packages/pip/_vendor/rich/pretty.py +0 -1016
  348. venv/Lib/site-packages/pip/_vendor/rich/progress.py +0 -1715
  349. venv/Lib/site-packages/pip/_vendor/rich/progress_bar.py +0 -223
  350. venv/Lib/site-packages/pip/_vendor/rich/prompt.py +0 -400
  351. venv/Lib/site-packages/pip/_vendor/rich/protocol.py +0 -42
  352. venv/Lib/site-packages/pip/_vendor/rich/py.typed +0 -0
  353. venv/Lib/site-packages/pip/_vendor/rich/region.py +0 -10
  354. venv/Lib/site-packages/pip/_vendor/rich/repr.py +0 -149
  355. venv/Lib/site-packages/pip/_vendor/rich/rule.py +0 -130
  356. venv/Lib/site-packages/pip/_vendor/rich/scope.py +0 -86
  357. venv/Lib/site-packages/pip/_vendor/rich/screen.py +0 -54
  358. venv/Lib/site-packages/pip/_vendor/rich/segment.py +0 -752
  359. venv/Lib/site-packages/pip/_vendor/rich/spinner.py +0 -132
  360. venv/Lib/site-packages/pip/_vendor/rich/status.py +0 -131
  361. venv/Lib/site-packages/pip/_vendor/rich/style.py +0 -796
  362. venv/Lib/site-packages/pip/_vendor/rich/styled.py +0 -42
  363. venv/Lib/site-packages/pip/_vendor/rich/syntax.py +0 -985
  364. venv/Lib/site-packages/pip/_vendor/rich/table.py +0 -1006
  365. venv/Lib/site-packages/pip/_vendor/rich/terminal_theme.py +0 -153
  366. venv/Lib/site-packages/pip/_vendor/rich/text.py +0 -1361
  367. venv/Lib/site-packages/pip/_vendor/rich/theme.py +0 -115
  368. venv/Lib/site-packages/pip/_vendor/rich/themes.py +0 -5
  369. venv/Lib/site-packages/pip/_vendor/rich/traceback.py +0 -899
  370. venv/Lib/site-packages/pip/_vendor/rich/tree.py +0 -257
  371. venv/Lib/site-packages/pip/_vendor/tomli/__init__.py +0 -8
  372. venv/Lib/site-packages/pip/_vendor/tomli/_parser.py +0 -770
  373. venv/Lib/site-packages/pip/_vendor/tomli/_re.py +0 -112
  374. venv/Lib/site-packages/pip/_vendor/tomli/_types.py +0 -10
  375. venv/Lib/site-packages/pip/_vendor/tomli/py.typed +0 -1
  376. venv/Lib/site-packages/pip/_vendor/tomli_w/__init__.py +0 -4
  377. venv/Lib/site-packages/pip/_vendor/tomli_w/_writer.py +0 -229
  378. venv/Lib/site-packages/pip/_vendor/tomli_w/py.typed +0 -1
  379. venv/Lib/site-packages/pip/_vendor/truststore/__init__.py +0 -36
  380. venv/Lib/site-packages/pip/_vendor/truststore/_api.py +0 -333
  381. venv/Lib/site-packages/pip/_vendor/truststore/_macos.py +0 -571
  382. venv/Lib/site-packages/pip/_vendor/truststore/_openssl.py +0 -66
  383. venv/Lib/site-packages/pip/_vendor/truststore/_ssl_constants.py +0 -31
  384. venv/Lib/site-packages/pip/_vendor/truststore/_windows.py +0 -567
  385. venv/Lib/site-packages/pip/_vendor/truststore/py.typed +0 -0
  386. venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +0 -102
  387. venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +0 -355
  388. venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +0 -2
  389. venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +0 -572
  390. venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +0 -1140
  391. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  392. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +0 -36
  393. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  394. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +0 -519
  395. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +0 -397
  396. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +0 -314
  397. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +0 -130
  398. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +0 -518
  399. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +0 -920
  400. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +0 -216
  401. venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +0 -323
  402. venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +0 -274
  403. venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +0 -98
  404. venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
  405. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  406. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +0 -51
  407. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +0 -155
  408. venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +0 -1076
  409. venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +0 -540
  410. venv/Lib/site-packages/pip/_vendor/urllib3/request.py +0 -191
  411. venv/Lib/site-packages/pip/_vendor/urllib3/response.py +0 -879
  412. venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +0 -49
  413. venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +0 -149
  414. venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +0 -57
  415. venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +0 -22
  416. venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +0 -137
  417. venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +0 -107
  418. venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +0 -622
  419. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +0 -504
  420. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +0 -159
  421. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +0 -221
  422. venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +0 -271
  423. venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +0 -435
  424. venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +0 -152
  425. venv/Lib/site-packages/pip/py.typed +0 -4
  426. {cli_ih-0.6.3.1.dist-info → cli_ih-0.7.0.dist-info}/WHEEL +0 -0
@@ -1,91 +0,0 @@
1
- import sys
2
- from typing import TYPE_CHECKING, Optional, Union, Literal
3
-
4
- from .jupyter import JupyterMixin
5
- from .segment import Segment
6
- from .style import Style
7
- from ._emoji_codes import EMOJI
8
- from ._emoji_replace import _emoji_replace
9
-
10
-
11
- if TYPE_CHECKING:
12
- from .console import Console, ConsoleOptions, RenderResult
13
-
14
-
15
- EmojiVariant = Literal["emoji", "text"]
16
-
17
-
18
- class NoEmoji(Exception):
19
- """No emoji by that name."""
20
-
21
-
22
- class Emoji(JupyterMixin):
23
- __slots__ = ["name", "style", "_char", "variant"]
24
-
25
- VARIANTS = {"text": "\uFE0E", "emoji": "\uFE0F"}
26
-
27
- def __init__(
28
- self,
29
- name: str,
30
- style: Union[str, Style] = "none",
31
- variant: Optional[EmojiVariant] = None,
32
- ) -> None:
33
- """A single emoji character.
34
-
35
- Args:
36
- name (str): Name of emoji.
37
- style (Union[str, Style], optional): Optional style. Defaults to None.
38
-
39
- Raises:
40
- NoEmoji: If the emoji doesn't exist.
41
- """
42
- self.name = name
43
- self.style = style
44
- self.variant = variant
45
- try:
46
- self._char = EMOJI[name]
47
- except KeyError:
48
- raise NoEmoji(f"No emoji called {name!r}")
49
- if variant is not None:
50
- self._char += self.VARIANTS.get(variant, "")
51
-
52
- @classmethod
53
- def replace(cls, text: str) -> str:
54
- """Replace emoji markup with corresponding unicode characters.
55
-
56
- Args:
57
- text (str): A string with emojis codes, e.g. "Hello :smiley:!"
58
-
59
- Returns:
60
- str: A string with emoji codes replaces with actual emoji.
61
- """
62
- return _emoji_replace(text)
63
-
64
- def __repr__(self) -> str:
65
- return f"<emoji {self.name!r}>"
66
-
67
- def __str__(self) -> str:
68
- return self._char
69
-
70
- def __rich_console__(
71
- self, console: "Console", options: "ConsoleOptions"
72
- ) -> "RenderResult":
73
- yield Segment(self._char, console.get_style(self.style))
74
-
75
-
76
- if __name__ == "__main__": # pragma: no cover
77
- import sys
78
-
79
- from pip._vendor.rich.columns import Columns
80
- from pip._vendor.rich.console import Console
81
-
82
- console = Console(record=True)
83
-
84
- columns = Columns(
85
- (f":{name}: {name}" for name in sorted(EMOJI.keys()) if "\u200D" not in name),
86
- column_first=True,
87
- )
88
-
89
- console.print(columns)
90
- if len(sys.argv) > 1:
91
- console.save_html(sys.argv[1])
@@ -1,34 +0,0 @@
1
- class ConsoleError(Exception):
2
- """An error in console operation."""
3
-
4
-
5
- class StyleError(Exception):
6
- """An error in styles."""
7
-
8
-
9
- class StyleSyntaxError(ConsoleError):
10
- """Style was badly formatted."""
11
-
12
-
13
- class MissingStyle(StyleError):
14
- """No such style."""
15
-
16
-
17
- class StyleStackError(ConsoleError):
18
- """Style stack is invalid."""
19
-
20
-
21
- class NotRenderableError(ConsoleError):
22
- """Object is not renderable."""
23
-
24
-
25
- class MarkupError(ConsoleError):
26
- """Markup was badly formatted."""
27
-
28
-
29
- class LiveError(ConsoleError):
30
- """Error related to Live display."""
31
-
32
-
33
- class NoAltScreen(ConsoleError):
34
- """Alt screen mode was required."""
@@ -1,57 +0,0 @@
1
- import io
2
- from typing import IO, TYPE_CHECKING, Any, List
3
-
4
- from .ansi import AnsiDecoder
5
- from .text import Text
6
-
7
- if TYPE_CHECKING:
8
- from .console import Console
9
-
10
-
11
- class FileProxy(io.TextIOBase):
12
- """Wraps a file (e.g. sys.stdout) and redirects writes to a console."""
13
-
14
- def __init__(self, console: "Console", file: IO[str]) -> None:
15
- self.__console = console
16
- self.__file = file
17
- self.__buffer: List[str] = []
18
- self.__ansi_decoder = AnsiDecoder()
19
-
20
- @property
21
- def rich_proxied_file(self) -> IO[str]:
22
- """Get proxied file."""
23
- return self.__file
24
-
25
- def __getattr__(self, name: str) -> Any:
26
- return getattr(self.__file, name)
27
-
28
- def write(self, text: str) -> int:
29
- if not isinstance(text, str):
30
- raise TypeError(f"write() argument must be str, not {type(text).__name__}")
31
- buffer = self.__buffer
32
- lines: List[str] = []
33
- while text:
34
- line, new_line, text = text.partition("\n")
35
- if new_line:
36
- lines.append("".join(buffer) + line)
37
- buffer.clear()
38
- else:
39
- buffer.append(line)
40
- break
41
- if lines:
42
- console = self.__console
43
- with console:
44
- output = Text("\n").join(
45
- self.__ansi_decoder.decode_line(line) for line in lines
46
- )
47
- console.print(output)
48
- return len(text)
49
-
50
- def flush(self) -> None:
51
- output = "".join(self.__buffer)
52
- if output:
53
- self.__console.print(output)
54
- del self.__buffer[:]
55
-
56
- def fileno(self) -> int:
57
- return self.__file.fileno()
@@ -1,88 +0,0 @@
1
- """Functions for reporting filesizes. Borrowed from https://github.com/PyFilesystem/pyfilesystem2
2
-
3
- The functions declared in this module should cover the different
4
- use cases needed to generate a string representation of a file size
5
- using several different units. Since there are many standards regarding
6
- file size units, three different functions have been implemented.
7
-
8
- See Also:
9
- * `Wikipedia: Binary prefix <https://en.wikipedia.org/wiki/Binary_prefix>`_
10
-
11
- """
12
-
13
- __all__ = ["decimal"]
14
-
15
- from typing import Iterable, List, Optional, Tuple
16
-
17
-
18
- def _to_str(
19
- size: int,
20
- suffixes: Iterable[str],
21
- base: int,
22
- *,
23
- precision: Optional[int] = 1,
24
- separator: Optional[str] = " ",
25
- ) -> str:
26
- if size == 1:
27
- return "1 byte"
28
- elif size < base:
29
- return f"{size:,} bytes"
30
-
31
- for i, suffix in enumerate(suffixes, 2): # noqa: B007
32
- unit = base**i
33
- if size < unit:
34
- break
35
- return "{:,.{precision}f}{separator}{}".format(
36
- (base * size / unit),
37
- suffix,
38
- precision=precision,
39
- separator=separator,
40
- )
41
-
42
-
43
- def pick_unit_and_suffix(size: int, suffixes: List[str], base: int) -> Tuple[int, str]:
44
- """Pick a suffix and base for the given size."""
45
- for i, suffix in enumerate(suffixes):
46
- unit = base**i
47
- if size < unit * base:
48
- break
49
- return unit, suffix
50
-
51
-
52
- def decimal(
53
- size: int,
54
- *,
55
- precision: Optional[int] = 1,
56
- separator: Optional[str] = " ",
57
- ) -> str:
58
- """Convert a filesize in to a string (powers of 1000, SI prefixes).
59
-
60
- In this convention, ``1000 B = 1 kB``.
61
-
62
- This is typically the format used to advertise the storage
63
- capacity of USB flash drives and the like (*256 MB* meaning
64
- actually a storage capacity of more than *256 000 000 B*),
65
- or used by **Mac OS X** since v10.6 to report file sizes.
66
-
67
- Arguments:
68
- int (size): A file size.
69
- int (precision): The number of decimal places to include (default = 1).
70
- str (separator): The string to separate the value from the units (default = " ").
71
-
72
- Returns:
73
- `str`: A string containing a abbreviated file size and units.
74
-
75
- Example:
76
- >>> filesize.decimal(30000)
77
- '30.0 kB'
78
- >>> filesize.decimal(30000, precision=2, separator="")
79
- '30.00kB'
80
-
81
- """
82
- return _to_str(
83
- size,
84
- ("kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"),
85
- 1000,
86
- precision=precision,
87
- separator=separator,
88
- )
@@ -1,232 +0,0 @@
1
- import re
2
- from abc import ABC, abstractmethod
3
- from typing import List, Union
4
-
5
- from .text import Span, Text
6
-
7
-
8
- def _combine_regex(*regexes: str) -> str:
9
- """Combine a number of regexes in to a single regex.
10
-
11
- Returns:
12
- str: New regex with all regexes ORed together.
13
- """
14
- return "|".join(regexes)
15
-
16
-
17
- class Highlighter(ABC):
18
- """Abstract base class for highlighters."""
19
-
20
- def __call__(self, text: Union[str, Text]) -> Text:
21
- """Highlight a str or Text instance.
22
-
23
- Args:
24
- text (Union[str, ~Text]): Text to highlight.
25
-
26
- Raises:
27
- TypeError: If not called with text or str.
28
-
29
- Returns:
30
- Text: A test instance with highlighting applied.
31
- """
32
- if isinstance(text, str):
33
- highlight_text = Text(text)
34
- elif isinstance(text, Text):
35
- highlight_text = text.copy()
36
- else:
37
- raise TypeError(f"str or Text instance required, not {text!r}")
38
- self.highlight(highlight_text)
39
- return highlight_text
40
-
41
- @abstractmethod
42
- def highlight(self, text: Text) -> None:
43
- """Apply highlighting in place to text.
44
-
45
- Args:
46
- text (~Text): A text object highlight.
47
- """
48
-
49
-
50
- class NullHighlighter(Highlighter):
51
- """A highlighter object that doesn't highlight.
52
-
53
- May be used to disable highlighting entirely.
54
-
55
- """
56
-
57
- def highlight(self, text: Text) -> None:
58
- """Nothing to do"""
59
-
60
-
61
- class RegexHighlighter(Highlighter):
62
- """Applies highlighting from a list of regular expressions."""
63
-
64
- highlights: List[str] = []
65
- base_style: str = ""
66
-
67
- def highlight(self, text: Text) -> None:
68
- """Highlight :class:`rich.text.Text` using regular expressions.
69
-
70
- Args:
71
- text (~Text): Text to highlighted.
72
-
73
- """
74
-
75
- highlight_regex = text.highlight_regex
76
- for re_highlight in self.highlights:
77
- highlight_regex(re_highlight, style_prefix=self.base_style)
78
-
79
-
80
- class ReprHighlighter(RegexHighlighter):
81
- """Highlights the text typically produced from ``__repr__`` methods."""
82
-
83
- base_style = "repr."
84
- highlights = [
85
- r"(?P<tag_start><)(?P<tag_name>[-\w.:|]*)(?P<tag_contents>[\w\W]*)(?P<tag_end>>)",
86
- r'(?P<attrib_name>[\w_]{1,50})=(?P<attrib_value>"?[\w_]+"?)?',
87
- r"(?P<brace>[][{}()])",
88
- _combine_regex(
89
- r"(?P<ipv4>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})",
90
- r"(?P<ipv6>([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})",
91
- r"(?P<eui64>(?:[0-9A-Fa-f]{1,2}-){7}[0-9A-Fa-f]{1,2}|(?:[0-9A-Fa-f]{1,2}:){7}[0-9A-Fa-f]{1,2}|(?:[0-9A-Fa-f]{4}\.){3}[0-9A-Fa-f]{4})",
92
- r"(?P<eui48>(?:[0-9A-Fa-f]{1,2}-){5}[0-9A-Fa-f]{1,2}|(?:[0-9A-Fa-f]{1,2}:){5}[0-9A-Fa-f]{1,2}|(?:[0-9A-Fa-f]{4}\.){2}[0-9A-Fa-f]{4})",
93
- r"(?P<uuid>[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})",
94
- r"(?P<call>[\w.]*?)\(",
95
- r"\b(?P<bool_true>True)\b|\b(?P<bool_false>False)\b|\b(?P<none>None)\b",
96
- r"(?P<ellipsis>\.\.\.)",
97
- r"(?P<number_complex>(?<!\w)(?:\-?[0-9]+\.?[0-9]*(?:e[-+]?\d+?)?)(?:[-+](?:[0-9]+\.?[0-9]*(?:e[-+]?\d+)?))?j)",
98
- r"(?P<number>(?<!\w)\-?[0-9]+\.?[0-9]*(e[-+]?\d+?)?\b|0x[0-9a-fA-F]*)",
99
- r"(?P<path>\B(/[-\w._+]+)*\/)(?P<filename>[-\w._+]*)?",
100
- r"(?<![\\\w])(?P<str>b?'''.*?(?<!\\)'''|b?'.*?(?<!\\)'|b?\"\"\".*?(?<!\\)\"\"\"|b?\".*?(?<!\\)\")",
101
- r"(?P<url>(file|https|http|ws|wss)://[-0-9a-zA-Z$_+!`(),.?/;:&=%#~@]*)",
102
- ),
103
- ]
104
-
105
-
106
- class JSONHighlighter(RegexHighlighter):
107
- """Highlights JSON"""
108
-
109
- # Captures the start and end of JSON strings, handling escaped quotes
110
- JSON_STR = r"(?<![\\\w])(?P<str>b?\".*?(?<!\\)\")"
111
- JSON_WHITESPACE = {" ", "\n", "\r", "\t"}
112
-
113
- base_style = "json."
114
- highlights = [
115
- _combine_regex(
116
- r"(?P<brace>[\{\[\(\)\]\}])",
117
- r"\b(?P<bool_true>true)\b|\b(?P<bool_false>false)\b|\b(?P<null>null)\b",
118
- r"(?P<number>(?<!\w)\-?[0-9]+\.?[0-9]*(e[\-\+]?\d+?)?\b|0x[0-9a-fA-F]*)",
119
- JSON_STR,
120
- ),
121
- ]
122
-
123
- def highlight(self, text: Text) -> None:
124
- super().highlight(text)
125
-
126
- # Additional work to handle highlighting JSON keys
127
- plain = text.plain
128
- append = text.spans.append
129
- whitespace = self.JSON_WHITESPACE
130
- for match in re.finditer(self.JSON_STR, plain):
131
- start, end = match.span()
132
- cursor = end
133
- while cursor < len(plain):
134
- char = plain[cursor]
135
- cursor += 1
136
- if char == ":":
137
- append(Span(start, end, "json.key"))
138
- elif char in whitespace:
139
- continue
140
- break
141
-
142
-
143
- class ISO8601Highlighter(RegexHighlighter):
144
- """Highlights the ISO8601 date time strings.
145
- Regex reference: https://www.oreilly.com/library/view/regular-expressions-cookbook/9781449327453/ch04s07.html
146
- """
147
-
148
- base_style = "iso8601."
149
- highlights = [
150
- #
151
- # Dates
152
- #
153
- # Calendar month (e.g. 2008-08). The hyphen is required
154
- r"^(?P<year>[0-9]{4})-(?P<month>1[0-2]|0[1-9])$",
155
- # Calendar date w/o hyphens (e.g. 20080830)
156
- r"^(?P<date>(?P<year>[0-9]{4})(?P<month>1[0-2]|0[1-9])(?P<day>3[01]|0[1-9]|[12][0-9]))$",
157
- # Ordinal date (e.g. 2008-243). The hyphen is optional
158
- r"^(?P<date>(?P<year>[0-9]{4})-?(?P<day>36[0-6]|3[0-5][0-9]|[12][0-9]{2}|0[1-9][0-9]|00[1-9]))$",
159
- #
160
- # Weeks
161
- #
162
- # Week of the year (e.g., 2008-W35). The hyphen is optional
163
- r"^(?P<date>(?P<year>[0-9]{4})-?W(?P<week>5[0-3]|[1-4][0-9]|0[1-9]))$",
164
- # Week date (e.g., 2008-W35-6). The hyphens are optional
165
- r"^(?P<date>(?P<year>[0-9]{4})-?W(?P<week>5[0-3]|[1-4][0-9]|0[1-9])-?(?P<day>[1-7]))$",
166
- #
167
- # Times
168
- #
169
- # Hours and minutes (e.g., 17:21). The colon is optional
170
- r"^(?P<time>(?P<hour>2[0-3]|[01][0-9]):?(?P<minute>[0-5][0-9]))$",
171
- # Hours, minutes, and seconds w/o colons (e.g., 172159)
172
- r"^(?P<time>(?P<hour>2[0-3]|[01][0-9])(?P<minute>[0-5][0-9])(?P<second>[0-5][0-9]))$",
173
- # Time zone designator (e.g., Z, +07 or +07:00). The colons and the minutes are optional
174
- r"^(?P<timezone>(Z|[+-](?:2[0-3]|[01][0-9])(?::?(?:[0-5][0-9]))?))$",
175
- # Hours, minutes, and seconds with time zone designator (e.g., 17:21:59+07:00).
176
- # All the colons are optional. The minutes in the time zone designator are also optional
177
- r"^(?P<time>(?P<hour>2[0-3]|[01][0-9])(?P<minute>[0-5][0-9])(?P<second>[0-5][0-9]))(?P<timezone>Z|[+-](?:2[0-3]|[01][0-9])(?::?(?:[0-5][0-9]))?)$",
178
- #
179
- # Date and Time
180
- #
181
- # Calendar date with hours, minutes, and seconds (e.g., 2008-08-30 17:21:59 or 20080830 172159).
182
- # A space is required between the date and the time. The hyphens and colons are optional.
183
- # This regex matches dates and times that specify some hyphens or colons but omit others.
184
- # This does not follow ISO 8601
185
- r"^(?P<date>(?P<year>[0-9]{4})(?P<hyphen>-)?(?P<month>1[0-2]|0[1-9])(?(hyphen)-)(?P<day>3[01]|0[1-9]|[12][0-9])) (?P<time>(?P<hour>2[0-3]|[01][0-9])(?(hyphen):)(?P<minute>[0-5][0-9])(?(hyphen):)(?P<second>[0-5][0-9]))$",
186
- #
187
- # XML Schema dates and times
188
- #
189
- # Date, with optional time zone (e.g., 2008-08-30 or 2008-08-30+07:00).
190
- # Hyphens are required. This is the XML Schema 'date' type
191
- r"^(?P<date>(?P<year>-?(?:[1-9][0-9]*)?[0-9]{4})-(?P<month>1[0-2]|0[1-9])-(?P<day>3[01]|0[1-9]|[12][0-9]))(?P<timezone>Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9])?$",
192
- # Time, with optional fractional seconds and time zone (e.g., 01:45:36 or 01:45:36.123+07:00).
193
- # There is no limit on the number of digits for the fractional seconds. This is the XML Schema 'time' type
194
- r"^(?P<time>(?P<hour>2[0-3]|[01][0-9]):(?P<minute>[0-5][0-9]):(?P<second>[0-5][0-9])(?P<frac>\.[0-9]+)?)(?P<timezone>Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9])?$",
195
- # Date and time, with optional fractional seconds and time zone (e.g., 2008-08-30T01:45:36 or 2008-08-30T01:45:36.123Z).
196
- # This is the XML Schema 'dateTime' type
197
- r"^(?P<date>(?P<year>-?(?:[1-9][0-9]*)?[0-9]{4})-(?P<month>1[0-2]|0[1-9])-(?P<day>3[01]|0[1-9]|[12][0-9]))T(?P<time>(?P<hour>2[0-3]|[01][0-9]):(?P<minute>[0-5][0-9]):(?P<second>[0-5][0-9])(?P<ms>\.[0-9]+)?)(?P<timezone>Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9])?$",
198
- ]
199
-
200
-
201
- if __name__ == "__main__": # pragma: no cover
202
- from .console import Console
203
-
204
- console = Console()
205
- console.print("[bold green]hello world![/bold green]")
206
- console.print("'[bold green]hello world![/bold green]'")
207
-
208
- console.print(" /foo")
209
- console.print("/foo/")
210
- console.print("/foo/bar")
211
- console.print("foo/bar/baz")
212
-
213
- console.print("/foo/bar/baz?foo=bar+egg&egg=baz")
214
- console.print("/foo/bar/baz/")
215
- console.print("/foo/bar/baz/egg")
216
- console.print("/foo/bar/baz/egg.py")
217
- console.print("/foo/bar/baz/egg.py word")
218
- console.print(" /foo/bar/baz/egg.py word")
219
- console.print("foo /foo/bar/baz/egg.py word")
220
- console.print("foo /foo/bar/ba._++z/egg+.py word")
221
- console.print("https://example.org?foo=bar#header")
222
-
223
- console.print(1234567.34)
224
- console.print(1 / 2)
225
- console.print(-1 / 123123123123)
226
-
227
- console.print(
228
- "127.0.1.1 bar 192.168.1.4 2001:0db8:85a3:0000:0000:8a2e:0370:7334 foo"
229
- )
230
- import json
231
-
232
- console.print_json(json.dumps(obj={"name": "apple", "count": 1}), indent=None)
@@ -1,139 +0,0 @@
1
- from pathlib import Path
2
- from json import loads, dumps
3
- from typing import Any, Callable, Optional, Union
4
-
5
- from .text import Text
6
- from .highlighter import JSONHighlighter, NullHighlighter
7
-
8
-
9
- class JSON:
10
- """A renderable which pretty prints JSON.
11
-
12
- Args:
13
- json (str): JSON encoded data.
14
- indent (Union[None, int, str], optional): Number of characters to indent by. Defaults to 2.
15
- highlight (bool, optional): Enable highlighting. Defaults to True.
16
- skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False.
17
- ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False.
18
- check_circular (bool, optional): Check for circular references. Defaults to True.
19
- allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True.
20
- default (Callable, optional): A callable that converts values that can not be encoded
21
- in to something that can be JSON encoded. Defaults to None.
22
- sort_keys (bool, optional): Sort dictionary keys. Defaults to False.
23
- """
24
-
25
- def __init__(
26
- self,
27
- json: str,
28
- indent: Union[None, int, str] = 2,
29
- highlight: bool = True,
30
- skip_keys: bool = False,
31
- ensure_ascii: bool = False,
32
- check_circular: bool = True,
33
- allow_nan: bool = True,
34
- default: Optional[Callable[[Any], Any]] = None,
35
- sort_keys: bool = False,
36
- ) -> None:
37
- data = loads(json)
38
- json = dumps(
39
- data,
40
- indent=indent,
41
- skipkeys=skip_keys,
42
- ensure_ascii=ensure_ascii,
43
- check_circular=check_circular,
44
- allow_nan=allow_nan,
45
- default=default,
46
- sort_keys=sort_keys,
47
- )
48
- highlighter = JSONHighlighter() if highlight else NullHighlighter()
49
- self.text = highlighter(json)
50
- self.text.no_wrap = True
51
- self.text.overflow = None
52
-
53
- @classmethod
54
- def from_data(
55
- cls,
56
- data: Any,
57
- indent: Union[None, int, str] = 2,
58
- highlight: bool = True,
59
- skip_keys: bool = False,
60
- ensure_ascii: bool = False,
61
- check_circular: bool = True,
62
- allow_nan: bool = True,
63
- default: Optional[Callable[[Any], Any]] = None,
64
- sort_keys: bool = False,
65
- ) -> "JSON":
66
- """Encodes a JSON object from arbitrary data.
67
-
68
- Args:
69
- data (Any): An object that may be encoded in to JSON
70
- indent (Union[None, int, str], optional): Number of characters to indent by. Defaults to 2.
71
- highlight (bool, optional): Enable highlighting. Defaults to True.
72
- default (Callable, optional): Optional callable which will be called for objects that cannot be serialized. Defaults to None.
73
- skip_keys (bool, optional): Skip keys not of a basic type. Defaults to False.
74
- ensure_ascii (bool, optional): Escape all non-ascii characters. Defaults to False.
75
- check_circular (bool, optional): Check for circular references. Defaults to True.
76
- allow_nan (bool, optional): Allow NaN and Infinity values. Defaults to True.
77
- default (Callable, optional): A callable that converts values that can not be encoded
78
- in to something that can be JSON encoded. Defaults to None.
79
- sort_keys (bool, optional): Sort dictionary keys. Defaults to False.
80
-
81
- Returns:
82
- JSON: New JSON object from the given data.
83
- """
84
- json_instance: "JSON" = cls.__new__(cls)
85
- json = dumps(
86
- data,
87
- indent=indent,
88
- skipkeys=skip_keys,
89
- ensure_ascii=ensure_ascii,
90
- check_circular=check_circular,
91
- allow_nan=allow_nan,
92
- default=default,
93
- sort_keys=sort_keys,
94
- )
95
- highlighter = JSONHighlighter() if highlight else NullHighlighter()
96
- json_instance.text = highlighter(json)
97
- json_instance.text.no_wrap = True
98
- json_instance.text.overflow = None
99
- return json_instance
100
-
101
- def __rich__(self) -> Text:
102
- return self.text
103
-
104
-
105
- if __name__ == "__main__":
106
- import argparse
107
- import sys
108
-
109
- parser = argparse.ArgumentParser(description="Pretty print json")
110
- parser.add_argument(
111
- "path",
112
- metavar="PATH",
113
- help="path to file, or - for stdin",
114
- )
115
- parser.add_argument(
116
- "-i",
117
- "--indent",
118
- metavar="SPACES",
119
- type=int,
120
- help="Number of spaces in an indent",
121
- default=2,
122
- )
123
- args = parser.parse_args()
124
-
125
- from pip._vendor.rich.console import Console
126
-
127
- console = Console()
128
- error_console = Console(stderr=True)
129
-
130
- try:
131
- if args.path == "-":
132
- json_data = sys.stdin.read()
133
- else:
134
- json_data = Path(args.path).read_text()
135
- except Exception as error:
136
- error_console.print(f"Unable to read {args.path!r}; {error}")
137
- sys.exit(-1)
138
-
139
- console.print(JSON(json_data, indent=args.indent), soft_wrap=True)