primary-api-models 0.1.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 (1580) hide show
  1. primary_api_models/__init__.py +53 -0
  2. primary_api_models/account_data.py +62 -0
  3. primary_api_models/commons.py +49 -0
  4. primary_api_models/detailed_instruments.py +11 -0
  5. primary_api_models/detailed_position.py +53 -0
  6. primary_api_models/enhanced_models.py +27 -0
  7. primary_api_models/enums.py +184 -0
  8. primary_api_models/instrument_details.py +48 -0
  9. primary_api_models/listed_instruments.py +14 -0
  10. primary_api_models/market_data.py +25 -0
  11. primary_api_models/order_report.py +34 -0
  12. primary_api_models/order_status.py +11 -0
  13. primary_api_models/positions.py +27 -0
  14. primary_api_models-0.1.0.dist-info/METADATA +7 -0
  15. primary_api_models-0.1.0.dist-info/RECORD +1580 -0
  16. primary_api_models-0.1.0.dist-info/WHEEL +5 -0
  17. primary_api_models-0.1.0.dist-info/top_level.txt +3 -0
  18. tests/conftest.py +6 -0
  19. tests/test_models.py +61 -0
  20. venv/Lib/site-packages/_pytest/__init__.py +13 -0
  21. venv/Lib/site-packages/_pytest/_argcomplete.py +117 -0
  22. venv/Lib/site-packages/_pytest/_code/__init__.py +26 -0
  23. venv/Lib/site-packages/_pytest/_code/code.py +1571 -0
  24. venv/Lib/site-packages/_pytest/_code/source.py +225 -0
  25. venv/Lib/site-packages/_pytest/_io/__init__.py +10 -0
  26. venv/Lib/site-packages/_pytest/_io/pprint.py +673 -0
  27. venv/Lib/site-packages/_pytest/_io/saferepr.py +130 -0
  28. venv/Lib/site-packages/_pytest/_io/terminalwriter.py +258 -0
  29. venv/Lib/site-packages/_pytest/_io/wcwidth.py +57 -0
  30. venv/Lib/site-packages/_pytest/_py/__init__.py +0 -0
  31. venv/Lib/site-packages/_pytest/_py/error.py +119 -0
  32. venv/Lib/site-packages/_pytest/_py/path.py +1475 -0
  33. venv/Lib/site-packages/_pytest/_version.py +24 -0
  34. venv/Lib/site-packages/_pytest/assertion/__init__.py +208 -0
  35. venv/Lib/site-packages/_pytest/assertion/rewrite.py +1202 -0
  36. venv/Lib/site-packages/_pytest/assertion/truncate.py +137 -0
  37. venv/Lib/site-packages/_pytest/assertion/util.py +615 -0
  38. venv/Lib/site-packages/_pytest/cacheprovider.py +646 -0
  39. venv/Lib/site-packages/_pytest/capture.py +1144 -0
  40. venv/Lib/site-packages/_pytest/compat.py +314 -0
  41. venv/Lib/site-packages/_pytest/config/__init__.py +2203 -0
  42. venv/Lib/site-packages/_pytest/config/argparsing.py +578 -0
  43. venv/Lib/site-packages/_pytest/config/compat.py +85 -0
  44. venv/Lib/site-packages/_pytest/config/exceptions.py +15 -0
  45. venv/Lib/site-packages/_pytest/config/findpaths.py +350 -0
  46. venv/Lib/site-packages/_pytest/debugging.py +407 -0
  47. venv/Lib/site-packages/_pytest/deprecated.py +99 -0
  48. venv/Lib/site-packages/_pytest/doctest.py +736 -0
  49. venv/Lib/site-packages/_pytest/faulthandler.py +119 -0
  50. venv/Lib/site-packages/_pytest/fixtures.py +2047 -0
  51. venv/Lib/site-packages/_pytest/freeze_support.py +45 -0
  52. venv/Lib/site-packages/_pytest/helpconfig.py +293 -0
  53. venv/Lib/site-packages/_pytest/hookspec.py +1342 -0
  54. venv/Lib/site-packages/_pytest/junitxml.py +695 -0
  55. venv/Lib/site-packages/_pytest/legacypath.py +468 -0
  56. venv/Lib/site-packages/_pytest/logging.py +960 -0
  57. venv/Lib/site-packages/_pytest/main.py +1203 -0
  58. venv/Lib/site-packages/_pytest/mark/__init__.py +301 -0
  59. venv/Lib/site-packages/_pytest/mark/expression.py +353 -0
  60. venv/Lib/site-packages/_pytest/mark/structures.py +664 -0
  61. venv/Lib/site-packages/_pytest/monkeypatch.py +435 -0
  62. venv/Lib/site-packages/_pytest/nodes.py +772 -0
  63. venv/Lib/site-packages/_pytest/outcomes.py +308 -0
  64. venv/Lib/site-packages/_pytest/pastebin.py +117 -0
  65. venv/Lib/site-packages/_pytest/pathlib.py +1063 -0
  66. venv/Lib/site-packages/_pytest/py.typed +0 -0
  67. venv/Lib/site-packages/_pytest/pytester.py +1791 -0
  68. venv/Lib/site-packages/_pytest/pytester_assertions.py +74 -0
  69. venv/Lib/site-packages/_pytest/python.py +1772 -0
  70. venv/Lib/site-packages/_pytest/python_api.py +819 -0
  71. venv/Lib/site-packages/_pytest/raises.py +1517 -0
  72. venv/Lib/site-packages/_pytest/recwarn.py +367 -0
  73. venv/Lib/site-packages/_pytest/reports.py +694 -0
  74. venv/Lib/site-packages/_pytest/runner.py +580 -0
  75. venv/Lib/site-packages/_pytest/scope.py +91 -0
  76. venv/Lib/site-packages/_pytest/setuponly.py +98 -0
  77. venv/Lib/site-packages/_pytest/setupplan.py +39 -0
  78. venv/Lib/site-packages/_pytest/skipping.py +321 -0
  79. venv/Lib/site-packages/_pytest/stash.py +116 -0
  80. venv/Lib/site-packages/_pytest/stepwise.py +209 -0
  81. venv/Lib/site-packages/_pytest/subtests.py +411 -0
  82. venv/Lib/site-packages/_pytest/terminal.py +1763 -0
  83. venv/Lib/site-packages/_pytest/terminalprogress.py +30 -0
  84. venv/Lib/site-packages/_pytest/threadexception.py +152 -0
  85. venv/Lib/site-packages/_pytest/timing.py +95 -0
  86. venv/Lib/site-packages/_pytest/tmpdir.py +337 -0
  87. venv/Lib/site-packages/_pytest/tracemalloc.py +24 -0
  88. venv/Lib/site-packages/_pytest/unittest.py +632 -0
  89. venv/Lib/site-packages/_pytest/unraisableexception.py +163 -0
  90. venv/Lib/site-packages/_pytest/warning_types.py +172 -0
  91. venv/Lib/site-packages/_pytest/warnings.py +151 -0
  92. venv/Lib/site-packages/annotated_types/__init__.py +432 -0
  93. venv/Lib/site-packages/annotated_types/py.typed +0 -0
  94. venv/Lib/site-packages/annotated_types/test_cases.py +151 -0
  95. venv/Lib/site-packages/build/__init__.py +47 -0
  96. venv/Lib/site-packages/build/__main__.py +654 -0
  97. venv/Lib/site-packages/build/_builder.py +393 -0
  98. venv/Lib/site-packages/build/_compat/__init__.py +0 -0
  99. venv/Lib/site-packages/build/_compat/importlib.py +22 -0
  100. venv/Lib/site-packages/build/_compat/tarfile.py +31 -0
  101. venv/Lib/site-packages/build/_compat/tomllib.py +19 -0
  102. venv/Lib/site-packages/build/_ctx.py +105 -0
  103. venv/Lib/site-packages/build/_exceptions.py +69 -0
  104. venv/Lib/site-packages/build/_types.py +22 -0
  105. venv/Lib/site-packages/build/_util.py +68 -0
  106. venv/Lib/site-packages/build/env.py +507 -0
  107. venv/Lib/site-packages/build/py.typed +0 -0
  108. venv/Lib/site-packages/build/util.py +70 -0
  109. venv/Lib/site-packages/certifi/__init__.py +4 -0
  110. venv/Lib/site-packages/certifi/__main__.py +12 -0
  111. venv/Lib/site-packages/certifi/core.py +83 -0
  112. venv/Lib/site-packages/certifi/py.typed +0 -0
  113. venv/Lib/site-packages/charset_normalizer/__init__.py +48 -0
  114. venv/Lib/site-packages/charset_normalizer/__main__.py +6 -0
  115. venv/Lib/site-packages/charset_normalizer/api.py +988 -0
  116. venv/Lib/site-packages/charset_normalizer/cd.py +454 -0
  117. venv/Lib/site-packages/charset_normalizer/cli/__init__.py +8 -0
  118. venv/Lib/site-packages/charset_normalizer/cli/__main__.py +362 -0
  119. venv/Lib/site-packages/charset_normalizer/constant.py +2050 -0
  120. venv/Lib/site-packages/charset_normalizer/legacy.py +79 -0
  121. venv/Lib/site-packages/charset_normalizer/md.py +936 -0
  122. venv/Lib/site-packages/charset_normalizer/models.py +369 -0
  123. venv/Lib/site-packages/charset_normalizer/py.typed +0 -0
  124. venv/Lib/site-packages/charset_normalizer/utils.py +422 -0
  125. venv/Lib/site-packages/charset_normalizer/version.py +8 -0
  126. venv/Lib/site-packages/colorama/__init__.py +7 -0
  127. venv/Lib/site-packages/colorama/ansi.py +102 -0
  128. venv/Lib/site-packages/colorama/ansitowin32.py +277 -0
  129. venv/Lib/site-packages/colorama/initialise.py +121 -0
  130. venv/Lib/site-packages/colorama/tests/__init__.py +1 -0
  131. venv/Lib/site-packages/colorama/tests/ansi_test.py +76 -0
  132. venv/Lib/site-packages/colorama/tests/ansitowin32_test.py +294 -0
  133. venv/Lib/site-packages/colorama/tests/initialise_test.py +189 -0
  134. venv/Lib/site-packages/colorama/tests/isatty_test.py +57 -0
  135. venv/Lib/site-packages/colorama/tests/utils.py +49 -0
  136. venv/Lib/site-packages/colorama/tests/winterm_test.py +131 -0
  137. venv/Lib/site-packages/colorama/win32.py +180 -0
  138. venv/Lib/site-packages/colorama/winterm.py +195 -0
  139. venv/Lib/site-packages/docutils/__init__.py +341 -0
  140. venv/Lib/site-packages/docutils/__main__.py +103 -0
  141. venv/Lib/site-packages/docutils/core.py +855 -0
  142. venv/Lib/site-packages/docutils/examples.py +123 -0
  143. venv/Lib/site-packages/docutils/frontend.py +1178 -0
  144. venv/Lib/site-packages/docutils/io.py +716 -0
  145. venv/Lib/site-packages/docutils/languages/__init__.py +117 -0
  146. venv/Lib/site-packages/docutils/languages/af.py +58 -0
  147. venv/Lib/site-packages/docutils/languages/ar.py +60 -0
  148. venv/Lib/site-packages/docutils/languages/ca.py +65 -0
  149. venv/Lib/site-packages/docutils/languages/cs.py +60 -0
  150. venv/Lib/site-packages/docutils/languages/da.py +61 -0
  151. venv/Lib/site-packages/docutils/languages/de.py +58 -0
  152. venv/Lib/site-packages/docutils/languages/en.py +60 -0
  153. venv/Lib/site-packages/docutils/languages/eo.py +61 -0
  154. venv/Lib/site-packages/docutils/languages/es.py +58 -0
  155. venv/Lib/site-packages/docutils/languages/fa.py +60 -0
  156. venv/Lib/site-packages/docutils/languages/fi.py +60 -0
  157. venv/Lib/site-packages/docutils/languages/fr.py +58 -0
  158. venv/Lib/site-packages/docutils/languages/gl.py +62 -0
  159. venv/Lib/site-packages/docutils/languages/he.py +62 -0
  160. venv/Lib/site-packages/docutils/languages/it.py +58 -0
  161. venv/Lib/site-packages/docutils/languages/ja.py +60 -0
  162. venv/Lib/site-packages/docutils/languages/ka.py +58 -0
  163. venv/Lib/site-packages/docutils/languages/ko.py +60 -0
  164. venv/Lib/site-packages/docutils/languages/lt.py +60 -0
  165. venv/Lib/site-packages/docutils/languages/lv.py +59 -0
  166. venv/Lib/site-packages/docutils/languages/nl.py +60 -0
  167. venv/Lib/site-packages/docutils/languages/pl.py +60 -0
  168. venv/Lib/site-packages/docutils/languages/pt_br.py +60 -0
  169. venv/Lib/site-packages/docutils/languages/ru.py +58 -0
  170. venv/Lib/site-packages/docutils/languages/sk.py +58 -0
  171. venv/Lib/site-packages/docutils/languages/sv.py +59 -0
  172. venv/Lib/site-packages/docutils/languages/uk.py +58 -0
  173. venv/Lib/site-packages/docutils/languages/zh_cn.py +62 -0
  174. venv/Lib/site-packages/docutils/languages/zh_tw.py +61 -0
  175. venv/Lib/site-packages/docutils/nodes.py +3341 -0
  176. venv/Lib/site-packages/docutils/parsers/__init__.py +115 -0
  177. venv/Lib/site-packages/docutils/parsers/commonmark_wrapper.py +56 -0
  178. venv/Lib/site-packages/docutils/parsers/docutils_xml.py +194 -0
  179. venv/Lib/site-packages/docutils/parsers/null.py +24 -0
  180. venv/Lib/site-packages/docutils/parsers/recommonmark_wrapper.py +174 -0
  181. venv/Lib/site-packages/docutils/parsers/rst/__init__.py +414 -0
  182. venv/Lib/site-packages/docutils/parsers/rst/directives/__init__.py +480 -0
  183. venv/Lib/site-packages/docutils/parsers/rst/directives/admonitions.py +101 -0
  184. venv/Lib/site-packages/docutils/parsers/rst/directives/body.py +329 -0
  185. venv/Lib/site-packages/docutils/parsers/rst/directives/html.py +21 -0
  186. venv/Lib/site-packages/docutils/parsers/rst/directives/images.py +186 -0
  187. venv/Lib/site-packages/docutils/parsers/rst/directives/misc.py +690 -0
  188. venv/Lib/site-packages/docutils/parsers/rst/directives/parts.py +129 -0
  189. venv/Lib/site-packages/docutils/parsers/rst/directives/references.py +28 -0
  190. venv/Lib/site-packages/docutils/parsers/rst/directives/tables.py +523 -0
  191. venv/Lib/site-packages/docutils/parsers/rst/languages/__init__.py +63 -0
  192. venv/Lib/site-packages/docutils/parsers/rst/languages/af.py +107 -0
  193. venv/Lib/site-packages/docutils/parsers/rst/languages/ar.py +99 -0
  194. venv/Lib/site-packages/docutils/parsers/rst/languages/ca.py +130 -0
  195. venv/Lib/site-packages/docutils/parsers/rst/languages/cs.py +110 -0
  196. venv/Lib/site-packages/docutils/parsers/rst/languages/da.py +113 -0
  197. venv/Lib/site-packages/docutils/parsers/rst/languages/de.py +106 -0
  198. venv/Lib/site-packages/docutils/parsers/rst/languages/en.py +115 -0
  199. venv/Lib/site-packages/docutils/parsers/rst/languages/eo.py +118 -0
  200. venv/Lib/site-packages/docutils/parsers/rst/languages/es.py +121 -0
  201. venv/Lib/site-packages/docutils/parsers/rst/languages/fa.py +102 -0
  202. venv/Lib/site-packages/docutils/parsers/rst/languages/fi.py +98 -0
  203. venv/Lib/site-packages/docutils/parsers/rst/languages/fr.py +107 -0
  204. venv/Lib/site-packages/docutils/parsers/rst/languages/gl.py +106 -0
  205. venv/Lib/site-packages/docutils/parsers/rst/languages/he.py +110 -0
  206. venv/Lib/site-packages/docutils/parsers/rst/languages/it.py +98 -0
  207. venv/Lib/site-packages/docutils/parsers/rst/languages/ja.py +119 -0
  208. venv/Lib/site-packages/docutils/parsers/rst/languages/ka.py +89 -0
  209. venv/Lib/site-packages/docutils/parsers/rst/languages/ko.py +111 -0
  210. venv/Lib/site-packages/docutils/parsers/rst/languages/lt.py +109 -0
  211. venv/Lib/site-packages/docutils/parsers/rst/languages/lv.py +108 -0
  212. venv/Lib/site-packages/docutils/parsers/rst/languages/nl.py +113 -0
  213. venv/Lib/site-packages/docutils/parsers/rst/languages/pl.py +100 -0
  214. venv/Lib/site-packages/docutils/parsers/rst/languages/pt_br.py +109 -0
  215. venv/Lib/site-packages/docutils/parsers/rst/languages/ru.py +90 -0
  216. venv/Lib/site-packages/docutils/parsers/rst/languages/sk.py +96 -0
  217. venv/Lib/site-packages/docutils/parsers/rst/languages/sv.py +96 -0
  218. venv/Lib/site-packages/docutils/parsers/rst/languages/uk.py +91 -0
  219. venv/Lib/site-packages/docutils/parsers/rst/languages/zh_cn.py +104 -0
  220. venv/Lib/site-packages/docutils/parsers/rst/languages/zh_tw.py +109 -0
  221. venv/Lib/site-packages/docutils/parsers/rst/roles.py +450 -0
  222. venv/Lib/site-packages/docutils/parsers/rst/states.py +3266 -0
  223. venv/Lib/site-packages/docutils/parsers/rst/tableparser.py +543 -0
  224. venv/Lib/site-packages/docutils/readers/__init__.py +135 -0
  225. venv/Lib/site-packages/docutils/readers/doctree.py +50 -0
  226. venv/Lib/site-packages/docutils/readers/pep.py +55 -0
  227. venv/Lib/site-packages/docutils/readers/standalone.py +65 -0
  228. venv/Lib/site-packages/docutils/statemachine.py +1534 -0
  229. venv/Lib/site-packages/docutils/transforms/__init__.py +196 -0
  230. venv/Lib/site-packages/docutils/transforms/components.py +56 -0
  231. venv/Lib/site-packages/docutils/transforms/frontmatter.py +548 -0
  232. venv/Lib/site-packages/docutils/transforms/misc.py +143 -0
  233. venv/Lib/site-packages/docutils/transforms/parts.py +175 -0
  234. venv/Lib/site-packages/docutils/transforms/peps.py +315 -0
  235. venv/Lib/site-packages/docutils/transforms/references.py +990 -0
  236. venv/Lib/site-packages/docutils/transforms/universal.py +364 -0
  237. venv/Lib/site-packages/docutils/transforms/writer_aux.py +57 -0
  238. venv/Lib/site-packages/docutils/utils/__init__.py +850 -0
  239. venv/Lib/site-packages/docutils/utils/_roman_numerals.py +264 -0
  240. venv/Lib/site-packages/docutils/utils/_typing.py +39 -0
  241. venv/Lib/site-packages/docutils/utils/code_analyzer.py +140 -0
  242. venv/Lib/site-packages/docutils/utils/math/__init__.py +77 -0
  243. venv/Lib/site-packages/docutils/utils/math/latex2mathml.py +1252 -0
  244. venv/Lib/site-packages/docutils/utils/math/math2html.py +3166 -0
  245. venv/Lib/site-packages/docutils/utils/math/mathalphabet2unichar.py +892 -0
  246. venv/Lib/site-packages/docutils/utils/math/mathml_elements.py +482 -0
  247. venv/Lib/site-packages/docutils/utils/math/tex2mathml_extern.py +263 -0
  248. venv/Lib/site-packages/docutils/utils/math/tex2unichar.py +730 -0
  249. venv/Lib/site-packages/docutils/utils/math/unichar2tex.py +808 -0
  250. venv/Lib/site-packages/docutils/utils/punctuation_chars.py +123 -0
  251. venv/Lib/site-packages/docutils/utils/smartquotes.py +1006 -0
  252. venv/Lib/site-packages/docutils/utils/urischemes.py +138 -0
  253. venv/Lib/site-packages/docutils/writers/__init__.py +277 -0
  254. venv/Lib/site-packages/docutils/writers/_html_base.py +1895 -0
  255. venv/Lib/site-packages/docutils/writers/docutils_xml.py +191 -0
  256. venv/Lib/site-packages/docutils/writers/html4css1/__init__.py +964 -0
  257. venv/Lib/site-packages/docutils/writers/html5_polyglot/__init__.py +398 -0
  258. venv/Lib/site-packages/docutils/writers/latex2e/__init__.py +3417 -0
  259. venv/Lib/site-packages/docutils/writers/manpage.py +1353 -0
  260. venv/Lib/site-packages/docutils/writers/null.py +28 -0
  261. venv/Lib/site-packages/docutils/writers/odf_odt/__init__.py +3461 -0
  262. venv/Lib/site-packages/docutils/writers/odf_odt/prepstyles.py +80 -0
  263. venv/Lib/site-packages/docutils/writers/odf_odt/pygmentsformatter.py +106 -0
  264. venv/Lib/site-packages/docutils/writers/pep_html/__init__.py +102 -0
  265. venv/Lib/site-packages/docutils/writers/pseudoxml.py +41 -0
  266. venv/Lib/site-packages/docutils/writers/s5_html/__init__.py +354 -0
  267. venv/Lib/site-packages/docutils/writers/xetex/__init__.py +168 -0
  268. venv/Lib/site-packages/id/__init__.py +114 -0
  269. venv/Lib/site-packages/id/__main__.py +88 -0
  270. venv/Lib/site-packages/id/_internal/oidc/__init__.py +13 -0
  271. venv/Lib/site-packages/id/_internal/oidc/ambient.py +363 -0
  272. venv/Lib/site-packages/id/py.typed +4 -0
  273. venv/Lib/site-packages/idna/__init__.py +45 -0
  274. venv/Lib/site-packages/idna/codec.py +122 -0
  275. venv/Lib/site-packages/idna/compat.py +15 -0
  276. venv/Lib/site-packages/idna/core.py +440 -0
  277. venv/Lib/site-packages/idna/idnadata.py +4367 -0
  278. venv/Lib/site-packages/idna/intranges.py +57 -0
  279. venv/Lib/site-packages/idna/package_data.py +1 -0
  280. venv/Lib/site-packages/idna/py.typed +0 -0
  281. venv/Lib/site-packages/idna/uts46data.py +8384 -0
  282. venv/Lib/site-packages/iniconfig/__init__.py +249 -0
  283. venv/Lib/site-packages/iniconfig/_parse.py +163 -0
  284. venv/Lib/site-packages/iniconfig/_version.py +34 -0
  285. venv/Lib/site-packages/iniconfig/exceptions.py +16 -0
  286. venv/Lib/site-packages/iniconfig/py.typed +0 -0
  287. venv/Lib/site-packages/jaraco/classes/__init__.py +0 -0
  288. venv/Lib/site-packages/jaraco/classes/ancestry.py +76 -0
  289. venv/Lib/site-packages/jaraco/classes/meta.py +85 -0
  290. venv/Lib/site-packages/jaraco/classes/properties.py +241 -0
  291. venv/Lib/site-packages/jaraco/classes/py.typed +0 -0
  292. venv/Lib/site-packages/jaraco/context/__init__.py +422 -0
  293. venv/Lib/site-packages/jaraco/context/py.typed +0 -0
  294. venv/Lib/site-packages/jaraco/functools/__init__.py +722 -0
  295. venv/Lib/site-packages/jaraco/functools/__init__.pyi +123 -0
  296. venv/Lib/site-packages/jaraco/functools/py.typed +0 -0
  297. venv/Lib/site-packages/keyring/__init__.py +17 -0
  298. venv/Lib/site-packages/keyring/__main__.py +4 -0
  299. venv/Lib/site-packages/keyring/backend.py +300 -0
  300. venv/Lib/site-packages/keyring/backends/SecretService.py +120 -0
  301. venv/Lib/site-packages/keyring/backends/Windows.py +168 -0
  302. venv/Lib/site-packages/keyring/backends/__init__.py +0 -0
  303. venv/Lib/site-packages/keyring/backends/chainer.py +71 -0
  304. venv/Lib/site-packages/keyring/backends/fail.py +30 -0
  305. venv/Lib/site-packages/keyring/backends/kwallet.py +164 -0
  306. venv/Lib/site-packages/keyring/backends/libsecret.py +155 -0
  307. venv/Lib/site-packages/keyring/backends/macOS/__init__.py +85 -0
  308. venv/Lib/site-packages/keyring/backends/macOS/api.py +184 -0
  309. venv/Lib/site-packages/keyring/backends/null.py +20 -0
  310. venv/Lib/site-packages/keyring/cli.py +220 -0
  311. venv/Lib/site-packages/keyring/compat/__init__.py +7 -0
  312. venv/Lib/site-packages/keyring/compat/properties.py +169 -0
  313. venv/Lib/site-packages/keyring/compat/py312.py +9 -0
  314. venv/Lib/site-packages/keyring/completion.py +55 -0
  315. venv/Lib/site-packages/keyring/core.py +202 -0
  316. venv/Lib/site-packages/keyring/credentials.py +85 -0
  317. venv/Lib/site-packages/keyring/devpi_client.py +29 -0
  318. venv/Lib/site-packages/keyring/errors.py +67 -0
  319. venv/Lib/site-packages/keyring/http.py +39 -0
  320. venv/Lib/site-packages/keyring/py.typed +0 -0
  321. venv/Lib/site-packages/keyring/testing/__init__.py +0 -0
  322. venv/Lib/site-packages/keyring/testing/backend.py +200 -0
  323. venv/Lib/site-packages/keyring/testing/util.py +68 -0
  324. venv/Lib/site-packages/keyring/util/__init__.py +11 -0
  325. venv/Lib/site-packages/keyring/util/platform_.py +40 -0
  326. venv/Lib/site-packages/markdown_it/__init__.py +6 -0
  327. venv/Lib/site-packages/markdown_it/_compat.py +1 -0
  328. venv/Lib/site-packages/markdown_it/_punycode.py +67 -0
  329. venv/Lib/site-packages/markdown_it/cli/__init__.py +0 -0
  330. venv/Lib/site-packages/markdown_it/cli/parse.py +127 -0
  331. venv/Lib/site-packages/markdown_it/common/__init__.py +0 -0
  332. venv/Lib/site-packages/markdown_it/common/entities.py +5 -0
  333. venv/Lib/site-packages/markdown_it/common/html_blocks.py +69 -0
  334. venv/Lib/site-packages/markdown_it/common/html_re.py +39 -0
  335. venv/Lib/site-packages/markdown_it/common/normalize_url.py +81 -0
  336. venv/Lib/site-packages/markdown_it/common/utils.py +313 -0
  337. venv/Lib/site-packages/markdown_it/helpers/__init__.py +6 -0
  338. venv/Lib/site-packages/markdown_it/helpers/parse_link_destination.py +83 -0
  339. venv/Lib/site-packages/markdown_it/helpers/parse_link_label.py +44 -0
  340. venv/Lib/site-packages/markdown_it/helpers/parse_link_title.py +75 -0
  341. venv/Lib/site-packages/markdown_it/main.py +351 -0
  342. venv/Lib/site-packages/markdown_it/parser_block.py +113 -0
  343. venv/Lib/site-packages/markdown_it/parser_core.py +46 -0
  344. venv/Lib/site-packages/markdown_it/parser_inline.py +215 -0
  345. venv/Lib/site-packages/markdown_it/presets/__init__.py +48 -0
  346. venv/Lib/site-packages/markdown_it/presets/commonmark.py +75 -0
  347. venv/Lib/site-packages/markdown_it/presets/default.py +36 -0
  348. venv/Lib/site-packages/markdown_it/presets/zero.py +44 -0
  349. venv/Lib/site-packages/markdown_it/py.typed +1 -0
  350. venv/Lib/site-packages/markdown_it/renderer.py +356 -0
  351. venv/Lib/site-packages/markdown_it/ruler.py +275 -0
  352. venv/Lib/site-packages/markdown_it/rules_block/__init__.py +28 -0
  353. venv/Lib/site-packages/markdown_it/rules_block/blockquote.py +368 -0
  354. venv/Lib/site-packages/markdown_it/rules_block/code.py +36 -0
  355. venv/Lib/site-packages/markdown_it/rules_block/fence.py +146 -0
  356. venv/Lib/site-packages/markdown_it/rules_block/heading.py +69 -0
  357. venv/Lib/site-packages/markdown_it/rules_block/hr.py +56 -0
  358. venv/Lib/site-packages/markdown_it/rules_block/html_block.py +90 -0
  359. venv/Lib/site-packages/markdown_it/rules_block/lheading.py +86 -0
  360. venv/Lib/site-packages/markdown_it/rules_block/list.py +408 -0
  361. venv/Lib/site-packages/markdown_it/rules_block/paragraph.py +66 -0
  362. venv/Lib/site-packages/markdown_it/rules_block/reference.py +235 -0
  363. venv/Lib/site-packages/markdown_it/rules_block/state_block.py +261 -0
  364. venv/Lib/site-packages/markdown_it/rules_block/table.py +250 -0
  365. venv/Lib/site-packages/markdown_it/rules_core/__init__.py +19 -0
  366. venv/Lib/site-packages/markdown_it/rules_core/block.py +13 -0
  367. venv/Lib/site-packages/markdown_it/rules_core/inline.py +10 -0
  368. venv/Lib/site-packages/markdown_it/rules_core/linkify.py +149 -0
  369. venv/Lib/site-packages/markdown_it/rules_core/normalize.py +19 -0
  370. venv/Lib/site-packages/markdown_it/rules_core/replacements.py +127 -0
  371. venv/Lib/site-packages/markdown_it/rules_core/smartquotes.py +202 -0
  372. venv/Lib/site-packages/markdown_it/rules_core/state_core.py +25 -0
  373. venv/Lib/site-packages/markdown_it/rules_core/text_join.py +53 -0
  374. venv/Lib/site-packages/markdown_it/rules_inline/__init__.py +31 -0
  375. venv/Lib/site-packages/markdown_it/rules_inline/autolink.py +77 -0
  376. venv/Lib/site-packages/markdown_it/rules_inline/backticks.py +72 -0
  377. venv/Lib/site-packages/markdown_it/rules_inline/balance_pairs.py +138 -0
  378. venv/Lib/site-packages/markdown_it/rules_inline/emphasis.py +102 -0
  379. venv/Lib/site-packages/markdown_it/rules_inline/entity.py +53 -0
  380. venv/Lib/site-packages/markdown_it/rules_inline/escape.py +93 -0
  381. venv/Lib/site-packages/markdown_it/rules_inline/fragments_join.py +54 -0
  382. venv/Lib/site-packages/markdown_it/rules_inline/html_inline.py +43 -0
  383. venv/Lib/site-packages/markdown_it/rules_inline/image.py +148 -0
  384. venv/Lib/site-packages/markdown_it/rules_inline/link.py +149 -0
  385. venv/Lib/site-packages/markdown_it/rules_inline/linkify.py +62 -0
  386. venv/Lib/site-packages/markdown_it/rules_inline/newline.py +44 -0
  387. venv/Lib/site-packages/markdown_it/rules_inline/state_inline.py +167 -0
  388. venv/Lib/site-packages/markdown_it/rules_inline/strikethrough.py +173 -0
  389. venv/Lib/site-packages/markdown_it/rules_inline/text.py +23 -0
  390. venv/Lib/site-packages/markdown_it/token.py +178 -0
  391. venv/Lib/site-packages/markdown_it/tree.py +333 -0
  392. venv/Lib/site-packages/markdown_it/utils.py +194 -0
  393. venv/Lib/site-packages/mdurl/__init__.py +18 -0
  394. venv/Lib/site-packages/mdurl/_decode.py +104 -0
  395. venv/Lib/site-packages/mdurl/_encode.py +85 -0
  396. venv/Lib/site-packages/mdurl/_format.py +27 -0
  397. venv/Lib/site-packages/mdurl/_parse.py +304 -0
  398. venv/Lib/site-packages/mdurl/_url.py +14 -0
  399. venv/Lib/site-packages/mdurl/py.typed +1 -0
  400. venv/Lib/site-packages/more_itertools/__init__.py +6 -0
  401. venv/Lib/site-packages/more_itertools/__init__.pyi +2 -0
  402. venv/Lib/site-packages/more_itertools/more.py +5457 -0
  403. venv/Lib/site-packages/more_itertools/more.pyi +963 -0
  404. venv/Lib/site-packages/more_itertools/py.typed +0 -0
  405. venv/Lib/site-packages/more_itertools/recipes.py +1599 -0
  406. venv/Lib/site-packages/more_itertools/recipes.pyi +234 -0
  407. venv/Lib/site-packages/nh3/__init__.py +5 -0
  408. venv/Lib/site-packages/nh3/__init__.pyi +42 -0
  409. venv/Lib/site-packages/nh3/py.typed +0 -0
  410. venv/Lib/site-packages/packaging/__init__.py +15 -0
  411. venv/Lib/site-packages/packaging/_elffile.py +108 -0
  412. venv/Lib/site-packages/packaging/_manylinux.py +262 -0
  413. venv/Lib/site-packages/packaging/_musllinux.py +85 -0
  414. venv/Lib/site-packages/packaging/_parser.py +393 -0
  415. venv/Lib/site-packages/packaging/_structures.py +33 -0
  416. venv/Lib/site-packages/packaging/_tokenizer.py +193 -0
  417. venv/Lib/site-packages/packaging/dependency_groups.py +302 -0
  418. venv/Lib/site-packages/packaging/direct_url.py +325 -0
  419. venv/Lib/site-packages/packaging/errors.py +94 -0
  420. venv/Lib/site-packages/packaging/licenses/__init__.py +186 -0
  421. venv/Lib/site-packages/packaging/licenses/_spdx.py +799 -0
  422. venv/Lib/site-packages/packaging/markers.py +492 -0
  423. venv/Lib/site-packages/packaging/metadata.py +964 -0
  424. venv/Lib/site-packages/packaging/py.typed +0 -0
  425. venv/Lib/site-packages/packaging/pylock.py +905 -0
  426. venv/Lib/site-packages/packaging/requirements.py +129 -0
  427. venv/Lib/site-packages/packaging/specifiers.py +1943 -0
  428. venv/Lib/site-packages/packaging/tags.py +932 -0
  429. venv/Lib/site-packages/packaging/utils.py +296 -0
  430. venv/Lib/site-packages/packaging/version.py +1231 -0
  431. venv/Lib/site-packages/pip/__init__.py +13 -0
  432. venv/Lib/site-packages/pip/__main__.py +24 -0
  433. venv/Lib/site-packages/pip/__pip-runner__.py +50 -0
  434. venv/Lib/site-packages/pip/_internal/__init__.py +18 -0
  435. venv/Lib/site-packages/pip/_internal/build_env.py +606 -0
  436. venv/Lib/site-packages/pip/_internal/cache.py +291 -0
  437. venv/Lib/site-packages/pip/_internal/cli/__init__.py +3 -0
  438. venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +184 -0
  439. venv/Lib/site-packages/pip/_internal/cli/base_command.py +255 -0
  440. venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +1267 -0
  441. venv/Lib/site-packages/pip/_internal/cli/command_context.py +28 -0
  442. venv/Lib/site-packages/pip/_internal/cli/index_command.py +195 -0
  443. venv/Lib/site-packages/pip/_internal/cli/main.py +85 -0
  444. venv/Lib/site-packages/pip/_internal/cli/main_parser.py +136 -0
  445. venv/Lib/site-packages/pip/_internal/cli/parser.py +358 -0
  446. venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +153 -0
  447. venv/Lib/site-packages/pip/_internal/cli/req_command.py +447 -0
  448. venv/Lib/site-packages/pip/_internal/cli/spinners.py +235 -0
  449. venv/Lib/site-packages/pip/_internal/cli/status_codes.py +6 -0
  450. venv/Lib/site-packages/pip/_internal/commands/__init__.py +139 -0
  451. venv/Lib/site-packages/pip/_internal/commands/cache.py +255 -0
  452. venv/Lib/site-packages/pip/_internal/commands/check.py +66 -0
  453. venv/Lib/site-packages/pip/_internal/commands/completion.py +136 -0
  454. venv/Lib/site-packages/pip/_internal/commands/configuration.py +288 -0
  455. venv/Lib/site-packages/pip/_internal/commands/debug.py +203 -0
  456. venv/Lib/site-packages/pip/_internal/commands/download.py +146 -0
  457. venv/Lib/site-packages/pip/_internal/commands/freeze.py +107 -0
  458. venv/Lib/site-packages/pip/_internal/commands/hash.py +58 -0
  459. venv/Lib/site-packages/pip/_internal/commands/help.py +40 -0
  460. venv/Lib/site-packages/pip/_internal/commands/index.py +166 -0
  461. venv/Lib/site-packages/pip/_internal/commands/inspect.py +92 -0
  462. venv/Lib/site-packages/pip/_internal/commands/install.py +810 -0
  463. venv/Lib/site-packages/pip/_internal/commands/list.py +398 -0
  464. venv/Lib/site-packages/pip/_internal/commands/lock.py +175 -0
  465. venv/Lib/site-packages/pip/_internal/commands/search.py +178 -0
  466. venv/Lib/site-packages/pip/_internal/commands/show.py +231 -0
  467. venv/Lib/site-packages/pip/_internal/commands/uninstall.py +113 -0
  468. venv/Lib/site-packages/pip/_internal/commands/wheel.py +171 -0
  469. venv/Lib/site-packages/pip/_internal/configuration.py +396 -0
  470. venv/Lib/site-packages/pip/_internal/distributions/__init__.py +21 -0
  471. venv/Lib/site-packages/pip/_internal/distributions/base.py +55 -0
  472. venv/Lib/site-packages/pip/_internal/distributions/installed.py +33 -0
  473. venv/Lib/site-packages/pip/_internal/distributions/sdist.py +164 -0
  474. venv/Lib/site-packages/pip/_internal/distributions/wheel.py +44 -0
  475. venv/Lib/site-packages/pip/_internal/exceptions.py +971 -0
  476. venv/Lib/site-packages/pip/_internal/index/__init__.py +1 -0
  477. venv/Lib/site-packages/pip/_internal/index/collector.py +488 -0
  478. venv/Lib/site-packages/pip/_internal/index/package_finder.py +1125 -0
  479. venv/Lib/site-packages/pip/_internal/index/sources.py +287 -0
  480. venv/Lib/site-packages/pip/_internal/locations/__init__.py +440 -0
  481. venv/Lib/site-packages/pip/_internal/locations/_distutils.py +173 -0
  482. venv/Lib/site-packages/pip/_internal/locations/_sysconfig.py +218 -0
  483. venv/Lib/site-packages/pip/_internal/locations/base.py +82 -0
  484. venv/Lib/site-packages/pip/_internal/main.py +12 -0
  485. venv/Lib/site-packages/pip/_internal/metadata/__init__.py +169 -0
  486. venv/Lib/site-packages/pip/_internal/metadata/_json.py +87 -0
  487. venv/Lib/site-packages/pip/_internal/metadata/base.py +685 -0
  488. venv/Lib/site-packages/pip/_internal/metadata/importlib/__init__.py +6 -0
  489. venv/Lib/site-packages/pip/_internal/metadata/importlib/_compat.py +87 -0
  490. venv/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +229 -0
  491. venv/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +143 -0
  492. venv/Lib/site-packages/pip/_internal/metadata/pkg_resources.py +298 -0
  493. venv/Lib/site-packages/pip/_internal/models/__init__.py +1 -0
  494. venv/Lib/site-packages/pip/_internal/models/candidate.py +25 -0
  495. venv/Lib/site-packages/pip/_internal/models/direct_url.py +227 -0
  496. venv/Lib/site-packages/pip/_internal/models/format_control.py +78 -0
  497. venv/Lib/site-packages/pip/_internal/models/index.py +28 -0
  498. venv/Lib/site-packages/pip/_internal/models/installation_report.py +57 -0
  499. venv/Lib/site-packages/pip/_internal/models/link.py +617 -0
  500. venv/Lib/site-packages/pip/_internal/models/release_control.py +92 -0
  501. venv/Lib/site-packages/pip/_internal/models/scheme.py +25 -0
  502. venv/Lib/site-packages/pip/_internal/models/search_scope.py +126 -0
  503. venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +56 -0
  504. venv/Lib/site-packages/pip/_internal/models/target_python.py +122 -0
  505. venv/Lib/site-packages/pip/_internal/models/wheel.py +80 -0
  506. venv/Lib/site-packages/pip/_internal/network/__init__.py +1 -0
  507. venv/Lib/site-packages/pip/_internal/network/auth.py +568 -0
  508. venv/Lib/site-packages/pip/_internal/network/cache.py +128 -0
  509. venv/Lib/site-packages/pip/_internal/network/download.py +341 -0
  510. venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +215 -0
  511. venv/Lib/site-packages/pip/_internal/network/session.py +532 -0
  512. venv/Lib/site-packages/pip/_internal/network/utils.py +98 -0
  513. venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +61 -0
  514. venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
  515. venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  516. venv/Lib/site-packages/pip/_internal/operations/build/build_tracker.py +140 -0
  517. venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +38 -0
  518. venv/Lib/site-packages/pip/_internal/operations/build/metadata_editable.py +41 -0
  519. venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +38 -0
  520. venv/Lib/site-packages/pip/_internal/operations/build/wheel_editable.py +47 -0
  521. venv/Lib/site-packages/pip/_internal/operations/check.py +175 -0
  522. venv/Lib/site-packages/pip/_internal/operations/freeze.py +259 -0
  523. venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +1 -0
  524. venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +745 -0
  525. venv/Lib/site-packages/pip/_internal/operations/prepare.py +747 -0
  526. venv/Lib/site-packages/pip/_internal/pyproject.py +123 -0
  527. venv/Lib/site-packages/pip/_internal/req/__init__.py +103 -0
  528. venv/Lib/site-packages/pip/_internal/req/constructors.py +568 -0
  529. venv/Lib/site-packages/pip/_internal/req/pep723.py +41 -0
  530. venv/Lib/site-packages/pip/_internal/req/req_dependency_group.py +75 -0
  531. venv/Lib/site-packages/pip/_internal/req/req_file.py +631 -0
  532. venv/Lib/site-packages/pip/_internal/req/req_install.py +828 -0
  533. venv/Lib/site-packages/pip/_internal/req/req_set.py +81 -0
  534. venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +639 -0
  535. venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
  536. venv/Lib/site-packages/pip/_internal/resolution/base.py +20 -0
  537. venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  538. venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +598 -0
  539. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  540. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +142 -0
  541. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +591 -0
  542. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +856 -0
  543. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +166 -0
  544. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +285 -0
  545. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +98 -0
  546. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +251 -0
  547. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +332 -0
  548. venv/Lib/site-packages/pip/_internal/self_outdated_check.py +255 -0
  549. venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
  550. venv/Lib/site-packages/pip/_internal/utils/_jaraco_text.py +109 -0
  551. venv/Lib/site-packages/pip/_internal/utils/_log.py +38 -0
  552. venv/Lib/site-packages/pip/_internal/utils/appdirs.py +52 -0
  553. venv/Lib/site-packages/pip/_internal/utils/compat.py +85 -0
  554. venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +201 -0
  555. venv/Lib/site-packages/pip/_internal/utils/datetime.py +28 -0
  556. venv/Lib/site-packages/pip/_internal/utils/deprecation.py +126 -0
  557. venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +87 -0
  558. venv/Lib/site-packages/pip/_internal/utils/egg_link.py +81 -0
  559. venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +88 -0
  560. venv/Lib/site-packages/pip/_internal/utils/filesystem.py +203 -0
  561. venv/Lib/site-packages/pip/_internal/utils/filetypes.py +24 -0
  562. venv/Lib/site-packages/pip/_internal/utils/glibc.py +102 -0
  563. venv/Lib/site-packages/pip/_internal/utils/hashes.py +150 -0
  564. venv/Lib/site-packages/pip/_internal/utils/logging.py +396 -0
  565. venv/Lib/site-packages/pip/_internal/utils/misc.py +771 -0
  566. venv/Lib/site-packages/pip/_internal/utils/packaging.py +44 -0
  567. venv/Lib/site-packages/pip/_internal/utils/pylock.py +116 -0
  568. venv/Lib/site-packages/pip/_internal/utils/retry.py +45 -0
  569. venv/Lib/site-packages/pip/_internal/utils/subprocess.py +248 -0
  570. venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +294 -0
  571. venv/Lib/site-packages/pip/_internal/utils/unpacking.py +362 -0
  572. venv/Lib/site-packages/pip/_internal/utils/urls.py +55 -0
  573. venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +105 -0
  574. venv/Lib/site-packages/pip/_internal/utils/wheel.py +132 -0
  575. venv/Lib/site-packages/pip/_internal/vcs/__init__.py +15 -0
  576. venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +130 -0
  577. venv/Lib/site-packages/pip/_internal/vcs/git.py +571 -0
  578. venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +186 -0
  579. venv/Lib/site-packages/pip/_internal/vcs/subversion.py +335 -0
  580. venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +695 -0
  581. venv/Lib/site-packages/pip/_internal/wheel_builder.py +261 -0
  582. venv/Lib/site-packages/pip/_vendor/__init__.py +117 -0
  583. venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +32 -0
  584. venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +70 -0
  585. venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +167 -0
  586. venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +75 -0
  587. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +8 -0
  588. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +145 -0
  589. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +48 -0
  590. venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +511 -0
  591. venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +121 -0
  592. venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +157 -0
  593. venv/Lib/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
  594. venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +146 -0
  595. venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +43 -0
  596. venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +4 -0
  597. venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +12 -0
  598. venv/Lib/site-packages/pip/_vendor/certifi/core.py +83 -0
  599. venv/Lib/site-packages/pip/_vendor/certifi/py.typed +0 -0
  600. venv/Lib/site-packages/pip/_vendor/dependency_groups/__init__.py +13 -0
  601. venv/Lib/site-packages/pip/_vendor/dependency_groups/__main__.py +65 -0
  602. venv/Lib/site-packages/pip/_vendor/dependency_groups/_implementation.py +209 -0
  603. venv/Lib/site-packages/pip/_vendor/dependency_groups/_lint_dependency_groups.py +59 -0
  604. venv/Lib/site-packages/pip/_vendor/dependency_groups/_pip_wrapper.py +62 -0
  605. venv/Lib/site-packages/pip/_vendor/dependency_groups/_toml_compat.py +9 -0
  606. venv/Lib/site-packages/pip/_vendor/dependency_groups/py.typed +0 -0
  607. venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +33 -0
  608. venv/Lib/site-packages/pip/_vendor/distlib/compat.py +1137 -0
  609. venv/Lib/site-packages/pip/_vendor/distlib/resources.py +358 -0
  610. venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +447 -0
  611. venv/Lib/site-packages/pip/_vendor/distlib/util.py +1984 -0
  612. venv/Lib/site-packages/pip/_vendor/distro/__init__.py +54 -0
  613. venv/Lib/site-packages/pip/_vendor/distro/__main__.py +4 -0
  614. venv/Lib/site-packages/pip/_vendor/distro/distro.py +1403 -0
  615. venv/Lib/site-packages/pip/_vendor/distro/py.typed +0 -0
  616. venv/Lib/site-packages/pip/_vendor/idna/__init__.py +45 -0
  617. venv/Lib/site-packages/pip/_vendor/idna/codec.py +122 -0
  618. venv/Lib/site-packages/pip/_vendor/idna/compat.py +15 -0
  619. venv/Lib/site-packages/pip/_vendor/idna/core.py +437 -0
  620. venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +4309 -0
  621. venv/Lib/site-packages/pip/_vendor/idna/intranges.py +57 -0
  622. venv/Lib/site-packages/pip/_vendor/idna/package_data.py +1 -0
  623. venv/Lib/site-packages/pip/_vendor/idna/py.typed +0 -0
  624. venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +8841 -0
  625. venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +55 -0
  626. venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +48 -0
  627. venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +170 -0
  628. venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +929 -0
  629. venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +15 -0
  630. venv/Lib/site-packages/pip/_vendor/packaging/_elffile.py +108 -0
  631. venv/Lib/site-packages/pip/_vendor/packaging/_manylinux.py +262 -0
  632. venv/Lib/site-packages/pip/_vendor/packaging/_musllinux.py +85 -0
  633. venv/Lib/site-packages/pip/_vendor/packaging/_parser.py +365 -0
  634. venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +69 -0
  635. venv/Lib/site-packages/pip/_vendor/packaging/_tokenizer.py +193 -0
  636. venv/Lib/site-packages/pip/_vendor/packaging/licenses/__init__.py +147 -0
  637. venv/Lib/site-packages/pip/_vendor/packaging/licenses/_spdx.py +799 -0
  638. venv/Lib/site-packages/pip/_vendor/packaging/markers.py +388 -0
  639. venv/Lib/site-packages/pip/_vendor/packaging/metadata.py +978 -0
  640. venv/Lib/site-packages/pip/_vendor/packaging/py.typed +0 -0
  641. venv/Lib/site-packages/pip/_vendor/packaging/pylock.py +635 -0
  642. venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +86 -0
  643. venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +1068 -0
  644. venv/Lib/site-packages/pip/_vendor/packaging/tags.py +651 -0
  645. venv/Lib/site-packages/pip/_vendor/packaging/utils.py +158 -0
  646. venv/Lib/site-packages/pip/_vendor/packaging/version.py +792 -0
  647. venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +3676 -0
  648. venv/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +631 -0
  649. venv/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +55 -0
  650. venv/Lib/site-packages/pip/_vendor/platformdirs/android.py +249 -0
  651. venv/Lib/site-packages/pip/_vendor/platformdirs/api.py +299 -0
  652. venv/Lib/site-packages/pip/_vendor/platformdirs/macos.py +146 -0
  653. venv/Lib/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
  654. venv/Lib/site-packages/pip/_vendor/platformdirs/unix.py +272 -0
  655. venv/Lib/site-packages/pip/_vendor/platformdirs/version.py +34 -0
  656. venv/Lib/site-packages/pip/_vendor/platformdirs/windows.py +278 -0
  657. venv/Lib/site-packages/pip/_vendor/pygments/__init__.py +82 -0
  658. venv/Lib/site-packages/pip/_vendor/pygments/__main__.py +17 -0
  659. venv/Lib/site-packages/pip/_vendor/pygments/console.py +70 -0
  660. venv/Lib/site-packages/pip/_vendor/pygments/filter.py +70 -0
  661. venv/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +940 -0
  662. venv/Lib/site-packages/pip/_vendor/pygments/formatter.py +129 -0
  663. venv/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +157 -0
  664. venv/Lib/site-packages/pip/_vendor/pygments/formatters/_mapping.py +23 -0
  665. venv/Lib/site-packages/pip/_vendor/pygments/lexer.py +963 -0
  666. venv/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +362 -0
  667. venv/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +602 -0
  668. venv/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +1201 -0
  669. venv/Lib/site-packages/pip/_vendor/pygments/modeline.py +43 -0
  670. venv/Lib/site-packages/pip/_vendor/pygments/plugin.py +72 -0
  671. venv/Lib/site-packages/pip/_vendor/pygments/regexopt.py +91 -0
  672. venv/Lib/site-packages/pip/_vendor/pygments/scanner.py +104 -0
  673. venv/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +247 -0
  674. venv/Lib/site-packages/pip/_vendor/pygments/style.py +203 -0
  675. venv/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +61 -0
  676. venv/Lib/site-packages/pip/_vendor/pygments/styles/_mapping.py +54 -0
  677. venv/Lib/site-packages/pip/_vendor/pygments/token.py +214 -0
  678. venv/Lib/site-packages/pip/_vendor/pygments/unistring.py +153 -0
  679. venv/Lib/site-packages/pip/_vendor/pygments/util.py +324 -0
  680. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/__init__.py +31 -0
  681. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py +410 -0
  682. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +21 -0
  683. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +389 -0
  684. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/py.typed +0 -0
  685. venv/Lib/site-packages/pip/_vendor/requests/__init__.py +179 -0
  686. venv/Lib/site-packages/pip/_vendor/requests/__version__.py +14 -0
  687. venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +50 -0
  688. venv/Lib/site-packages/pip/_vendor/requests/adapters.py +696 -0
  689. venv/Lib/site-packages/pip/_vendor/requests/api.py +157 -0
  690. venv/Lib/site-packages/pip/_vendor/requests/auth.py +314 -0
  691. venv/Lib/site-packages/pip/_vendor/requests/certs.py +17 -0
  692. venv/Lib/site-packages/pip/_vendor/requests/compat.py +90 -0
  693. venv/Lib/site-packages/pip/_vendor/requests/cookies.py +561 -0
  694. venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +151 -0
  695. venv/Lib/site-packages/pip/_vendor/requests/help.py +127 -0
  696. venv/Lib/site-packages/pip/_vendor/requests/hooks.py +33 -0
  697. venv/Lib/site-packages/pip/_vendor/requests/models.py +1039 -0
  698. venv/Lib/site-packages/pip/_vendor/requests/packages.py +25 -0
  699. venv/Lib/site-packages/pip/_vendor/requests/sessions.py +831 -0
  700. venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +128 -0
  701. venv/Lib/site-packages/pip/_vendor/requests/structures.py +99 -0
  702. venv/Lib/site-packages/pip/_vendor/requests/utils.py +1086 -0
  703. venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +27 -0
  704. venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +196 -0
  705. venv/Lib/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
  706. venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +55 -0
  707. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/__init__.py +27 -0
  708. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/abstract.py +47 -0
  709. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/criterion.py +48 -0
  710. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/exceptions.py +57 -0
  711. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py +627 -0
  712. venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +209 -0
  713. venv/Lib/site-packages/pip/_vendor/rich/__init__.py +177 -0
  714. venv/Lib/site-packages/pip/_vendor/rich/__main__.py +245 -0
  715. venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py +454 -0
  716. venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py +3610 -0
  717. venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py +32 -0
  718. venv/Lib/site-packages/pip/_vendor/rich/_export_format.py +76 -0
  719. venv/Lib/site-packages/pip/_vendor/rich/_extension.py +10 -0
  720. venv/Lib/site-packages/pip/_vendor/rich/_fileno.py +24 -0
  721. venv/Lib/site-packages/pip/_vendor/rich/_inspect.py +268 -0
  722. venv/Lib/site-packages/pip/_vendor/rich/_log_render.py +94 -0
  723. venv/Lib/site-packages/pip/_vendor/rich/_loop.py +43 -0
  724. venv/Lib/site-packages/pip/_vendor/rich/_null_file.py +69 -0
  725. venv/Lib/site-packages/pip/_vendor/rich/_palettes.py +309 -0
  726. venv/Lib/site-packages/pip/_vendor/rich/_pick.py +17 -0
  727. venv/Lib/site-packages/pip/_vendor/rich/_ratio.py +153 -0
  728. venv/Lib/site-packages/pip/_vendor/rich/_spinners.py +482 -0
  729. venv/Lib/site-packages/pip/_vendor/rich/_stack.py +16 -0
  730. venv/Lib/site-packages/pip/_vendor/rich/_timer.py +19 -0
  731. venv/Lib/site-packages/pip/_vendor/rich/_win32_console.py +661 -0
  732. venv/Lib/site-packages/pip/_vendor/rich/_windows.py +71 -0
  733. venv/Lib/site-packages/pip/_vendor/rich/_windows_renderer.py +56 -0
  734. venv/Lib/site-packages/pip/_vendor/rich/_wrap.py +93 -0
  735. venv/Lib/site-packages/pip/_vendor/rich/abc.py +33 -0
  736. venv/Lib/site-packages/pip/_vendor/rich/align.py +306 -0
  737. venv/Lib/site-packages/pip/_vendor/rich/ansi.py +241 -0
  738. venv/Lib/site-packages/pip/_vendor/rich/bar.py +93 -0
  739. venv/Lib/site-packages/pip/_vendor/rich/box.py +474 -0
  740. venv/Lib/site-packages/pip/_vendor/rich/cells.py +174 -0
  741. venv/Lib/site-packages/pip/_vendor/rich/color.py +621 -0
  742. venv/Lib/site-packages/pip/_vendor/rich/color_triplet.py +38 -0
  743. venv/Lib/site-packages/pip/_vendor/rich/columns.py +187 -0
  744. venv/Lib/site-packages/pip/_vendor/rich/console.py +2680 -0
  745. venv/Lib/site-packages/pip/_vendor/rich/constrain.py +37 -0
  746. venv/Lib/site-packages/pip/_vendor/rich/containers.py +167 -0
  747. venv/Lib/site-packages/pip/_vendor/rich/control.py +219 -0
  748. venv/Lib/site-packages/pip/_vendor/rich/default_styles.py +193 -0
  749. venv/Lib/site-packages/pip/_vendor/rich/diagnose.py +39 -0
  750. venv/Lib/site-packages/pip/_vendor/rich/emoji.py +91 -0
  751. venv/Lib/site-packages/pip/_vendor/rich/errors.py +34 -0
  752. venv/Lib/site-packages/pip/_vendor/rich/file_proxy.py +57 -0
  753. venv/Lib/site-packages/pip/_vendor/rich/filesize.py +88 -0
  754. venv/Lib/site-packages/pip/_vendor/rich/highlighter.py +232 -0
  755. venv/Lib/site-packages/pip/_vendor/rich/json.py +139 -0
  756. venv/Lib/site-packages/pip/_vendor/rich/jupyter.py +101 -0
  757. venv/Lib/site-packages/pip/_vendor/rich/layout.py +442 -0
  758. venv/Lib/site-packages/pip/_vendor/rich/live.py +400 -0
  759. venv/Lib/site-packages/pip/_vendor/rich/live_render.py +106 -0
  760. venv/Lib/site-packages/pip/_vendor/rich/logging.py +297 -0
  761. venv/Lib/site-packages/pip/_vendor/rich/markup.py +251 -0
  762. venv/Lib/site-packages/pip/_vendor/rich/measure.py +151 -0
  763. venv/Lib/site-packages/pip/_vendor/rich/padding.py +141 -0
  764. venv/Lib/site-packages/pip/_vendor/rich/pager.py +34 -0
  765. venv/Lib/site-packages/pip/_vendor/rich/palette.py +100 -0
  766. venv/Lib/site-packages/pip/_vendor/rich/panel.py +317 -0
  767. venv/Lib/site-packages/pip/_vendor/rich/pretty.py +1016 -0
  768. venv/Lib/site-packages/pip/_vendor/rich/progress.py +1715 -0
  769. venv/Lib/site-packages/pip/_vendor/rich/progress_bar.py +223 -0
  770. venv/Lib/site-packages/pip/_vendor/rich/prompt.py +400 -0
  771. venv/Lib/site-packages/pip/_vendor/rich/protocol.py +42 -0
  772. venv/Lib/site-packages/pip/_vendor/rich/py.typed +0 -0
  773. venv/Lib/site-packages/pip/_vendor/rich/region.py +10 -0
  774. venv/Lib/site-packages/pip/_vendor/rich/repr.py +149 -0
  775. venv/Lib/site-packages/pip/_vendor/rich/rule.py +130 -0
  776. venv/Lib/site-packages/pip/_vendor/rich/scope.py +86 -0
  777. venv/Lib/site-packages/pip/_vendor/rich/screen.py +54 -0
  778. venv/Lib/site-packages/pip/_vendor/rich/segment.py +752 -0
  779. venv/Lib/site-packages/pip/_vendor/rich/spinner.py +132 -0
  780. venv/Lib/site-packages/pip/_vendor/rich/status.py +131 -0
  781. venv/Lib/site-packages/pip/_vendor/rich/style.py +792 -0
  782. venv/Lib/site-packages/pip/_vendor/rich/styled.py +42 -0
  783. venv/Lib/site-packages/pip/_vendor/rich/syntax.py +985 -0
  784. venv/Lib/site-packages/pip/_vendor/rich/table.py +1006 -0
  785. venv/Lib/site-packages/pip/_vendor/rich/terminal_theme.py +153 -0
  786. venv/Lib/site-packages/pip/_vendor/rich/text.py +1361 -0
  787. venv/Lib/site-packages/pip/_vendor/rich/theme.py +115 -0
  788. venv/Lib/site-packages/pip/_vendor/rich/themes.py +5 -0
  789. venv/Lib/site-packages/pip/_vendor/rich/traceback.py +899 -0
  790. venv/Lib/site-packages/pip/_vendor/rich/tree.py +257 -0
  791. venv/Lib/site-packages/pip/_vendor/tomli/__init__.py +8 -0
  792. venv/Lib/site-packages/pip/_vendor/tomli/_parser.py +777 -0
  793. venv/Lib/site-packages/pip/_vendor/tomli/_re.py +115 -0
  794. venv/Lib/site-packages/pip/_vendor/tomli/_types.py +10 -0
  795. venv/Lib/site-packages/pip/_vendor/tomli/py.typed +1 -0
  796. venv/Lib/site-packages/pip/_vendor/tomli_w/__init__.py +4 -0
  797. venv/Lib/site-packages/pip/_vendor/tomli_w/_writer.py +229 -0
  798. venv/Lib/site-packages/pip/_vendor/tomli_w/py.typed +1 -0
  799. venv/Lib/site-packages/pip/_vendor/truststore/__init__.py +36 -0
  800. venv/Lib/site-packages/pip/_vendor/truststore/_api.py +341 -0
  801. venv/Lib/site-packages/pip/_vendor/truststore/_macos.py +571 -0
  802. venv/Lib/site-packages/pip/_vendor/truststore/_openssl.py +68 -0
  803. venv/Lib/site-packages/pip/_vendor/truststore/_ssl_constants.py +31 -0
  804. venv/Lib/site-packages/pip/_vendor/truststore/_windows.py +567 -0
  805. venv/Lib/site-packages/pip/_vendor/truststore/py.typed +0 -0
  806. venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +102 -0
  807. venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +355 -0
  808. venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +2 -0
  809. venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +572 -0
  810. venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +1140 -0
  811. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  812. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +36 -0
  813. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  814. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +519 -0
  815. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +397 -0
  816. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +314 -0
  817. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +130 -0
  818. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +518 -0
  819. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +920 -0
  820. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +216 -0
  821. venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +323 -0
  822. venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +274 -0
  823. venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +98 -0
  824. venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
  825. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  826. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +51 -0
  827. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +155 -0
  828. venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +1076 -0
  829. venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +540 -0
  830. venv/Lib/site-packages/pip/_vendor/urllib3/request.py +191 -0
  831. venv/Lib/site-packages/pip/_vendor/urllib3/response.py +879 -0
  832. venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +49 -0
  833. venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +149 -0
  834. venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +57 -0
  835. venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +22 -0
  836. venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +137 -0
  837. venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +107 -0
  838. venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +622 -0
  839. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +504 -0
  840. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +159 -0
  841. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +221 -0
  842. venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +271 -0
  843. venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +435 -0
  844. venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +152 -0
  845. venv/Lib/site-packages/pip/py.typed +4 -0
  846. venv/Lib/site-packages/pluggy/__init__.py +30 -0
  847. venv/Lib/site-packages/pluggy/_callers.py +169 -0
  848. venv/Lib/site-packages/pluggy/_hooks.py +714 -0
  849. venv/Lib/site-packages/pluggy/_manager.py +523 -0
  850. venv/Lib/site-packages/pluggy/_result.py +107 -0
  851. venv/Lib/site-packages/pluggy/_tracing.py +72 -0
  852. venv/Lib/site-packages/pluggy/_version.py +21 -0
  853. venv/Lib/site-packages/pluggy/_warnings.py +27 -0
  854. venv/Lib/site-packages/pluggy/py.typed +0 -0
  855. venv/Lib/site-packages/py.py +15 -0
  856. venv/Lib/site-packages/pydantic/__init__.py +456 -0
  857. venv/Lib/site-packages/pydantic/_internal/__init__.py +0 -0
  858. venv/Lib/site-packages/pydantic/_internal/_config.py +386 -0
  859. venv/Lib/site-packages/pydantic/_internal/_core_metadata.py +97 -0
  860. venv/Lib/site-packages/pydantic/_internal/_core_utils.py +174 -0
  861. venv/Lib/site-packages/pydantic/_internal/_dataclasses.py +315 -0
  862. venv/Lib/site-packages/pydantic/_internal/_decorators.py +873 -0
  863. venv/Lib/site-packages/pydantic/_internal/_decorators_v1.py +174 -0
  864. venv/Lib/site-packages/pydantic/_internal/_discriminated_union.py +494 -0
  865. venv/Lib/site-packages/pydantic/_internal/_docs_extraction.py +113 -0
  866. venv/Lib/site-packages/pydantic/_internal/_fields.py +729 -0
  867. venv/Lib/site-packages/pydantic/_internal/_forward_ref.py +23 -0
  868. venv/Lib/site-packages/pydantic/_internal/_generate_schema.py +2934 -0
  869. venv/Lib/site-packages/pydantic/_internal/_generics.py +530 -0
  870. venv/Lib/site-packages/pydantic/_internal/_git.py +27 -0
  871. venv/Lib/site-packages/pydantic/_internal/_import_utils.py +20 -0
  872. venv/Lib/site-packages/pydantic/_internal/_internal_dataclass.py +7 -0
  873. venv/Lib/site-packages/pydantic/_internal/_known_annotated_metadata.py +403 -0
  874. venv/Lib/site-packages/pydantic/_internal/_mock_val_ser.py +228 -0
  875. venv/Lib/site-packages/pydantic/_internal/_model_construction.py +868 -0
  876. venv/Lib/site-packages/pydantic/_internal/_namespace_utils.py +293 -0
  877. venv/Lib/site-packages/pydantic/_internal/_repr.py +124 -0
  878. venv/Lib/site-packages/pydantic/_internal/_schema_gather.py +212 -0
  879. venv/Lib/site-packages/pydantic/_internal/_schema_generation_shared.py +125 -0
  880. venv/Lib/site-packages/pydantic/_internal/_serializers.py +53 -0
  881. venv/Lib/site-packages/pydantic/_internal/_signature.py +189 -0
  882. venv/Lib/site-packages/pydantic/_internal/_typing_extra.py +785 -0
  883. venv/Lib/site-packages/pydantic/_internal/_utils.py +446 -0
  884. venv/Lib/site-packages/pydantic/_internal/_validate_call.py +141 -0
  885. venv/Lib/site-packages/pydantic/_internal/_validators.py +534 -0
  886. venv/Lib/site-packages/pydantic/_migration.py +316 -0
  887. venv/Lib/site-packages/pydantic/alias_generators.py +62 -0
  888. venv/Lib/site-packages/pydantic/aliases.py +135 -0
  889. venv/Lib/site-packages/pydantic/annotated_handlers.py +122 -0
  890. venv/Lib/site-packages/pydantic/class_validators.py +5 -0
  891. venv/Lib/site-packages/pydantic/color.py +604 -0
  892. venv/Lib/site-packages/pydantic/config.py +1296 -0
  893. venv/Lib/site-packages/pydantic/dataclasses.py +413 -0
  894. venv/Lib/site-packages/pydantic/datetime_parse.py +5 -0
  895. venv/Lib/site-packages/pydantic/decorator.py +5 -0
  896. venv/Lib/site-packages/pydantic/deprecated/__init__.py +0 -0
  897. venv/Lib/site-packages/pydantic/deprecated/class_validators.py +256 -0
  898. venv/Lib/site-packages/pydantic/deprecated/config.py +72 -0
  899. venv/Lib/site-packages/pydantic/deprecated/copy_internals.py +224 -0
  900. venv/Lib/site-packages/pydantic/deprecated/decorator.py +284 -0
  901. venv/Lib/site-packages/pydantic/deprecated/json.py +141 -0
  902. venv/Lib/site-packages/pydantic/deprecated/parse.py +80 -0
  903. venv/Lib/site-packages/pydantic/deprecated/tools.py +103 -0
  904. venv/Lib/site-packages/pydantic/env_settings.py +5 -0
  905. venv/Lib/site-packages/pydantic/error_wrappers.py +5 -0
  906. venv/Lib/site-packages/pydantic/errors.py +189 -0
  907. venv/Lib/site-packages/pydantic/experimental/__init__.py +1 -0
  908. venv/Lib/site-packages/pydantic/experimental/arguments_schema.py +44 -0
  909. venv/Lib/site-packages/pydantic/experimental/missing_sentinel.py +5 -0
  910. venv/Lib/site-packages/pydantic/experimental/pipeline.py +663 -0
  911. venv/Lib/site-packages/pydantic/fields.py +1892 -0
  912. venv/Lib/site-packages/pydantic/functional_serializers.py +470 -0
  913. venv/Lib/site-packages/pydantic/functional_validators.py +889 -0
  914. venv/Lib/site-packages/pydantic/generics.py +5 -0
  915. venv/Lib/site-packages/pydantic/json.py +5 -0
  916. venv/Lib/site-packages/pydantic/json_schema.py +2911 -0
  917. venv/Lib/site-packages/pydantic/main.py +1838 -0
  918. venv/Lib/site-packages/pydantic/mypy.py +1412 -0
  919. venv/Lib/site-packages/pydantic/networks.py +1332 -0
  920. venv/Lib/site-packages/pydantic/parse.py +5 -0
  921. venv/Lib/site-packages/pydantic/plugin/__init__.py +193 -0
  922. venv/Lib/site-packages/pydantic/plugin/_loader.py +58 -0
  923. venv/Lib/site-packages/pydantic/plugin/_schema_validator.py +143 -0
  924. venv/Lib/site-packages/pydantic/py.typed +0 -0
  925. venv/Lib/site-packages/pydantic/root_model.py +157 -0
  926. venv/Lib/site-packages/pydantic/schema.py +5 -0
  927. venv/Lib/site-packages/pydantic/tools.py +5 -0
  928. venv/Lib/site-packages/pydantic/type_adapter.py +801 -0
  929. venv/Lib/site-packages/pydantic/types.py +3310 -0
  930. venv/Lib/site-packages/pydantic/typing.py +5 -0
  931. venv/Lib/site-packages/pydantic/utils.py +5 -0
  932. venv/Lib/site-packages/pydantic/v1/__init__.py +131 -0
  933. venv/Lib/site-packages/pydantic/v1/_hypothesis_plugin.py +391 -0
  934. venv/Lib/site-packages/pydantic/v1/annotated_types.py +72 -0
  935. venv/Lib/site-packages/pydantic/v1/class_validators.py +361 -0
  936. venv/Lib/site-packages/pydantic/v1/color.py +494 -0
  937. venv/Lib/site-packages/pydantic/v1/config.py +191 -0
  938. venv/Lib/site-packages/pydantic/v1/dataclasses.py +500 -0
  939. venv/Lib/site-packages/pydantic/v1/datetime_parse.py +248 -0
  940. venv/Lib/site-packages/pydantic/v1/decorator.py +264 -0
  941. venv/Lib/site-packages/pydantic/v1/env_settings.py +350 -0
  942. venv/Lib/site-packages/pydantic/v1/error_wrappers.py +161 -0
  943. venv/Lib/site-packages/pydantic/v1/errors.py +646 -0
  944. venv/Lib/site-packages/pydantic/v1/fields.py +1253 -0
  945. venv/Lib/site-packages/pydantic/v1/generics.py +400 -0
  946. venv/Lib/site-packages/pydantic/v1/json.py +112 -0
  947. venv/Lib/site-packages/pydantic/v1/main.py +1130 -0
  948. venv/Lib/site-packages/pydantic/v1/mypy.py +949 -0
  949. venv/Lib/site-packages/pydantic/v1/networks.py +747 -0
  950. venv/Lib/site-packages/pydantic/v1/parse.py +66 -0
  951. venv/Lib/site-packages/pydantic/v1/py.typed +0 -0
  952. venv/Lib/site-packages/pydantic/v1/schema.py +1163 -0
  953. venv/Lib/site-packages/pydantic/v1/tools.py +92 -0
  954. venv/Lib/site-packages/pydantic/v1/types.py +1205 -0
  955. venv/Lib/site-packages/pydantic/v1/typing.py +627 -0
  956. venv/Lib/site-packages/pydantic/v1/utils.py +807 -0
  957. venv/Lib/site-packages/pydantic/v1/validators.py +768 -0
  958. venv/Lib/site-packages/pydantic/v1/version.py +38 -0
  959. venv/Lib/site-packages/pydantic/validate_call_decorator.py +116 -0
  960. venv/Lib/site-packages/pydantic/validators.py +5 -0
  961. venv/Lib/site-packages/pydantic/version.py +113 -0
  962. venv/Lib/site-packages/pydantic/warnings.py +122 -0
  963. venv/Lib/site-packages/pydantic_core/__init__.py +171 -0
  964. venv/Lib/site-packages/pydantic_core/_pydantic_core.pyi +1056 -0
  965. venv/Lib/site-packages/pydantic_core/core_schema.py +4461 -0
  966. venv/Lib/site-packages/pydantic_core/py.typed +0 -0
  967. venv/Lib/site-packages/pygments/__init__.py +82 -0
  968. venv/Lib/site-packages/pygments/__main__.py +17 -0
  969. venv/Lib/site-packages/pygments/cmdline.py +668 -0
  970. venv/Lib/site-packages/pygments/console.py +70 -0
  971. venv/Lib/site-packages/pygments/filter.py +70 -0
  972. venv/Lib/site-packages/pygments/filters/__init__.py +942 -0
  973. venv/Lib/site-packages/pygments/formatter.py +129 -0
  974. venv/Lib/site-packages/pygments/formatters/__init__.py +157 -0
  975. venv/Lib/site-packages/pygments/formatters/_mapping.py +23 -0
  976. venv/Lib/site-packages/pygments/formatters/bbcode.py +108 -0
  977. venv/Lib/site-packages/pygments/formatters/groff.py +170 -0
  978. venv/Lib/site-packages/pygments/formatters/html.py +997 -0
  979. venv/Lib/site-packages/pygments/formatters/img.py +686 -0
  980. venv/Lib/site-packages/pygments/formatters/irc.py +153 -0
  981. venv/Lib/site-packages/pygments/formatters/latex.py +518 -0
  982. venv/Lib/site-packages/pygments/formatters/other.py +160 -0
  983. venv/Lib/site-packages/pygments/formatters/pangomarkup.py +83 -0
  984. venv/Lib/site-packages/pygments/formatters/rtf.py +349 -0
  985. venv/Lib/site-packages/pygments/formatters/svg.py +185 -0
  986. venv/Lib/site-packages/pygments/formatters/terminal.py +127 -0
  987. venv/Lib/site-packages/pygments/formatters/terminal256.py +338 -0
  988. venv/Lib/site-packages/pygments/lexer.py +963 -0
  989. venv/Lib/site-packages/pygments/lexers/__init__.py +362 -0
  990. venv/Lib/site-packages/pygments/lexers/_ada_builtins.py +103 -0
  991. venv/Lib/site-packages/pygments/lexers/_asy_builtins.py +1644 -0
  992. venv/Lib/site-packages/pygments/lexers/_cl_builtins.py +231 -0
  993. venv/Lib/site-packages/pygments/lexers/_cocoa_builtins.py +75 -0
  994. venv/Lib/site-packages/pygments/lexers/_csound_builtins.py +1780 -0
  995. venv/Lib/site-packages/pygments/lexers/_css_builtins.py +558 -0
  996. venv/Lib/site-packages/pygments/lexers/_googlesql_builtins.py +918 -0
  997. venv/Lib/site-packages/pygments/lexers/_julia_builtins.py +411 -0
  998. venv/Lib/site-packages/pygments/lexers/_lasso_builtins.py +5326 -0
  999. venv/Lib/site-packages/pygments/lexers/_lilypond_builtins.py +5184 -0
  1000. venv/Lib/site-packages/pygments/lexers/_lua_builtins.py +285 -0
  1001. venv/Lib/site-packages/pygments/lexers/_luau_builtins.py +62 -0
  1002. venv/Lib/site-packages/pygments/lexers/_mapping.py +603 -0
  1003. venv/Lib/site-packages/pygments/lexers/_mql_builtins.py +1171 -0
  1004. venv/Lib/site-packages/pygments/lexers/_mysql_builtins.py +1384 -0
  1005. venv/Lib/site-packages/pygments/lexers/_openedge_builtins.py +2600 -0
  1006. venv/Lib/site-packages/pygments/lexers/_php_builtins.py +3328 -0
  1007. venv/Lib/site-packages/pygments/lexers/_postgres_builtins.py +739 -0
  1008. venv/Lib/site-packages/pygments/lexers/_qlik_builtins.py +666 -0
  1009. venv/Lib/site-packages/pygments/lexers/_scheme_builtins.py +1609 -0
  1010. venv/Lib/site-packages/pygments/lexers/_scilab_builtins.py +3093 -0
  1011. venv/Lib/site-packages/pygments/lexers/_sourcemod_builtins.py +1151 -0
  1012. venv/Lib/site-packages/pygments/lexers/_sql_builtins.py +106 -0
  1013. venv/Lib/site-packages/pygments/lexers/_stan_builtins.py +761 -0
  1014. venv/Lib/site-packages/pygments/lexers/_stata_builtins.py +457 -0
  1015. venv/Lib/site-packages/pygments/lexers/_tsql_builtins.py +1003 -0
  1016. venv/Lib/site-packages/pygments/lexers/_usd_builtins.py +112 -0
  1017. venv/Lib/site-packages/pygments/lexers/_vbscript_builtins.py +279 -0
  1018. venv/Lib/site-packages/pygments/lexers/_vim_builtins.py +1938 -0
  1019. venv/Lib/site-packages/pygments/lexers/actionscript.py +243 -0
  1020. venv/Lib/site-packages/pygments/lexers/ada.py +144 -0
  1021. venv/Lib/site-packages/pygments/lexers/agile.py +25 -0
  1022. venv/Lib/site-packages/pygments/lexers/algebra.py +300 -0
  1023. venv/Lib/site-packages/pygments/lexers/ambient.py +75 -0
  1024. venv/Lib/site-packages/pygments/lexers/amdgpu.py +54 -0
  1025. venv/Lib/site-packages/pygments/lexers/ampl.py +87 -0
  1026. venv/Lib/site-packages/pygments/lexers/apdlexer.py +593 -0
  1027. venv/Lib/site-packages/pygments/lexers/apl.py +103 -0
  1028. venv/Lib/site-packages/pygments/lexers/archetype.py +315 -0
  1029. venv/Lib/site-packages/pygments/lexers/arrow.py +116 -0
  1030. venv/Lib/site-packages/pygments/lexers/arturo.py +249 -0
  1031. venv/Lib/site-packages/pygments/lexers/asc.py +55 -0
  1032. venv/Lib/site-packages/pygments/lexers/asm.py +1058 -0
  1033. venv/Lib/site-packages/pygments/lexers/asn1.py +178 -0
  1034. venv/Lib/site-packages/pygments/lexers/automation.py +379 -0
  1035. venv/Lib/site-packages/pygments/lexers/bare.py +101 -0
  1036. venv/Lib/site-packages/pygments/lexers/basic.py +656 -0
  1037. venv/Lib/site-packages/pygments/lexers/bdd.py +57 -0
  1038. venv/Lib/site-packages/pygments/lexers/berry.py +99 -0
  1039. venv/Lib/site-packages/pygments/lexers/bibtex.py +159 -0
  1040. venv/Lib/site-packages/pygments/lexers/blueprint.py +173 -0
  1041. venv/Lib/site-packages/pygments/lexers/boa.py +97 -0
  1042. venv/Lib/site-packages/pygments/lexers/bqn.py +112 -0
  1043. venv/Lib/site-packages/pygments/lexers/business.py +625 -0
  1044. venv/Lib/site-packages/pygments/lexers/c_cpp.py +415 -0
  1045. venv/Lib/site-packages/pygments/lexers/c_like.py +738 -0
  1046. venv/Lib/site-packages/pygments/lexers/capnproto.py +74 -0
  1047. venv/Lib/site-packages/pygments/lexers/carbon.py +95 -0
  1048. venv/Lib/site-packages/pygments/lexers/cddl.py +172 -0
  1049. venv/Lib/site-packages/pygments/lexers/chapel.py +139 -0
  1050. venv/Lib/site-packages/pygments/lexers/clean.py +180 -0
  1051. venv/Lib/site-packages/pygments/lexers/codeql.py +80 -0
  1052. venv/Lib/site-packages/pygments/lexers/comal.py +81 -0
  1053. venv/Lib/site-packages/pygments/lexers/compiled.py +35 -0
  1054. venv/Lib/site-packages/pygments/lexers/configs.py +1433 -0
  1055. venv/Lib/site-packages/pygments/lexers/console.py +114 -0
  1056. venv/Lib/site-packages/pygments/lexers/cplint.py +43 -0
  1057. venv/Lib/site-packages/pygments/lexers/crystal.py +364 -0
  1058. venv/Lib/site-packages/pygments/lexers/csound.py +466 -0
  1059. venv/Lib/site-packages/pygments/lexers/css.py +632 -0
  1060. venv/Lib/site-packages/pygments/lexers/d.py +259 -0
  1061. venv/Lib/site-packages/pygments/lexers/dalvik.py +126 -0
  1062. venv/Lib/site-packages/pygments/lexers/data.py +763 -0
  1063. venv/Lib/site-packages/pygments/lexers/dax.py +135 -0
  1064. venv/Lib/site-packages/pygments/lexers/devicetree.py +120 -0
  1065. venv/Lib/site-packages/pygments/lexers/diff.py +169 -0
  1066. venv/Lib/site-packages/pygments/lexers/dns.py +109 -0
  1067. venv/Lib/site-packages/pygments/lexers/dotnet.py +873 -0
  1068. venv/Lib/site-packages/pygments/lexers/dsls.py +970 -0
  1069. venv/Lib/site-packages/pygments/lexers/dylan.py +279 -0
  1070. venv/Lib/site-packages/pygments/lexers/ecl.py +144 -0
  1071. venv/Lib/site-packages/pygments/lexers/eiffel.py +68 -0
  1072. venv/Lib/site-packages/pygments/lexers/elm.py +123 -0
  1073. venv/Lib/site-packages/pygments/lexers/elpi.py +201 -0
  1074. venv/Lib/site-packages/pygments/lexers/email.py +132 -0
  1075. venv/Lib/site-packages/pygments/lexers/erlang.py +526 -0
  1076. venv/Lib/site-packages/pygments/lexers/esoteric.py +300 -0
  1077. venv/Lib/site-packages/pygments/lexers/ezhil.py +76 -0
  1078. venv/Lib/site-packages/pygments/lexers/factor.py +363 -0
  1079. venv/Lib/site-packages/pygments/lexers/fantom.py +251 -0
  1080. venv/Lib/site-packages/pygments/lexers/felix.py +275 -0
  1081. venv/Lib/site-packages/pygments/lexers/fift.py +68 -0
  1082. venv/Lib/site-packages/pygments/lexers/floscript.py +81 -0
  1083. venv/Lib/site-packages/pygments/lexers/forth.py +178 -0
  1084. venv/Lib/site-packages/pygments/lexers/fortran.py +212 -0
  1085. venv/Lib/site-packages/pygments/lexers/foxpro.py +427 -0
  1086. venv/Lib/site-packages/pygments/lexers/freefem.py +893 -0
  1087. venv/Lib/site-packages/pygments/lexers/func.py +110 -0
  1088. venv/Lib/site-packages/pygments/lexers/functional.py +21 -0
  1089. venv/Lib/site-packages/pygments/lexers/futhark.py +105 -0
  1090. venv/Lib/site-packages/pygments/lexers/gcodelexer.py +35 -0
  1091. venv/Lib/site-packages/pygments/lexers/gdscript.py +189 -0
  1092. venv/Lib/site-packages/pygments/lexers/gleam.py +74 -0
  1093. venv/Lib/site-packages/pygments/lexers/go.py +97 -0
  1094. venv/Lib/site-packages/pygments/lexers/grammar_notation.py +262 -0
  1095. venv/Lib/site-packages/pygments/lexers/graph.py +108 -0
  1096. venv/Lib/site-packages/pygments/lexers/graphics.py +794 -0
  1097. venv/Lib/site-packages/pygments/lexers/graphql.py +176 -0
  1098. venv/Lib/site-packages/pygments/lexers/graphviz.py +58 -0
  1099. venv/Lib/site-packages/pygments/lexers/gsql.py +103 -0
  1100. venv/Lib/site-packages/pygments/lexers/hare.py +73 -0
  1101. venv/Lib/site-packages/pygments/lexers/haskell.py +867 -0
  1102. venv/Lib/site-packages/pygments/lexers/haxe.py +941 -0
  1103. venv/Lib/site-packages/pygments/lexers/hdl.py +466 -0
  1104. venv/Lib/site-packages/pygments/lexers/hexdump.py +102 -0
  1105. venv/Lib/site-packages/pygments/lexers/html.py +670 -0
  1106. venv/Lib/site-packages/pygments/lexers/idl.py +284 -0
  1107. venv/Lib/site-packages/pygments/lexers/igor.py +435 -0
  1108. venv/Lib/site-packages/pygments/lexers/inferno.py +95 -0
  1109. venv/Lib/site-packages/pygments/lexers/installers.py +352 -0
  1110. venv/Lib/site-packages/pygments/lexers/int_fiction.py +1370 -0
  1111. venv/Lib/site-packages/pygments/lexers/iolang.py +61 -0
  1112. venv/Lib/site-packages/pygments/lexers/j.py +151 -0
  1113. venv/Lib/site-packages/pygments/lexers/javascript.py +1591 -0
  1114. venv/Lib/site-packages/pygments/lexers/jmespath.py +69 -0
  1115. venv/Lib/site-packages/pygments/lexers/jslt.py +94 -0
  1116. venv/Lib/site-packages/pygments/lexers/json5.py +83 -0
  1117. venv/Lib/site-packages/pygments/lexers/jsonnet.py +169 -0
  1118. venv/Lib/site-packages/pygments/lexers/jsx.py +100 -0
  1119. venv/Lib/site-packages/pygments/lexers/julia.py +294 -0
  1120. venv/Lib/site-packages/pygments/lexers/jvm.py +1807 -0
  1121. venv/Lib/site-packages/pygments/lexers/kuin.py +332 -0
  1122. venv/Lib/site-packages/pygments/lexers/kusto.py +93 -0
  1123. venv/Lib/site-packages/pygments/lexers/ldap.py +155 -0
  1124. venv/Lib/site-packages/pygments/lexers/lean.py +241 -0
  1125. venv/Lib/site-packages/pygments/lexers/lilypond.py +225 -0
  1126. venv/Lib/site-packages/pygments/lexers/lisp.py +3152 -0
  1127. venv/Lib/site-packages/pygments/lexers/macaulay2.py +1847 -0
  1128. venv/Lib/site-packages/pygments/lexers/make.py +212 -0
  1129. venv/Lib/site-packages/pygments/lexers/maple.py +291 -0
  1130. venv/Lib/site-packages/pygments/lexers/markup.py +1659 -0
  1131. venv/Lib/site-packages/pygments/lexers/math.py +21 -0
  1132. venv/Lib/site-packages/pygments/lexers/matlab.py +3307 -0
  1133. venv/Lib/site-packages/pygments/lexers/maxima.py +84 -0
  1134. venv/Lib/site-packages/pygments/lexers/meson.py +139 -0
  1135. venv/Lib/site-packages/pygments/lexers/mime.py +210 -0
  1136. venv/Lib/site-packages/pygments/lexers/minecraft.py +392 -0
  1137. venv/Lib/site-packages/pygments/lexers/mips.py +130 -0
  1138. venv/Lib/site-packages/pygments/lexers/ml.py +958 -0
  1139. venv/Lib/site-packages/pygments/lexers/modeling.py +368 -0
  1140. venv/Lib/site-packages/pygments/lexers/modula2.py +1579 -0
  1141. venv/Lib/site-packages/pygments/lexers/mojo.py +707 -0
  1142. venv/Lib/site-packages/pygments/lexers/monte.py +203 -0
  1143. venv/Lib/site-packages/pygments/lexers/mosel.py +447 -0
  1144. venv/Lib/site-packages/pygments/lexers/ncl.py +894 -0
  1145. venv/Lib/site-packages/pygments/lexers/nimrod.py +199 -0
  1146. venv/Lib/site-packages/pygments/lexers/nit.py +63 -0
  1147. venv/Lib/site-packages/pygments/lexers/nix.py +144 -0
  1148. venv/Lib/site-packages/pygments/lexers/numbair.py +63 -0
  1149. venv/Lib/site-packages/pygments/lexers/oberon.py +120 -0
  1150. venv/Lib/site-packages/pygments/lexers/objective.py +513 -0
  1151. venv/Lib/site-packages/pygments/lexers/ooc.py +84 -0
  1152. venv/Lib/site-packages/pygments/lexers/openscad.py +96 -0
  1153. venv/Lib/site-packages/pygments/lexers/other.py +41 -0
  1154. venv/Lib/site-packages/pygments/lexers/parasail.py +78 -0
  1155. venv/Lib/site-packages/pygments/lexers/parsers.py +798 -0
  1156. venv/Lib/site-packages/pygments/lexers/pascal.py +644 -0
  1157. venv/Lib/site-packages/pygments/lexers/pawn.py +202 -0
  1158. venv/Lib/site-packages/pygments/lexers/pddl.py +82 -0
  1159. venv/Lib/site-packages/pygments/lexers/perl.py +733 -0
  1160. venv/Lib/site-packages/pygments/lexers/phix.py +363 -0
  1161. venv/Lib/site-packages/pygments/lexers/php.py +335 -0
  1162. venv/Lib/site-packages/pygments/lexers/pointless.py +70 -0
  1163. venv/Lib/site-packages/pygments/lexers/pony.py +93 -0
  1164. venv/Lib/site-packages/pygments/lexers/praat.py +303 -0
  1165. venv/Lib/site-packages/pygments/lexers/procfile.py +41 -0
  1166. venv/Lib/site-packages/pygments/lexers/prolog.py +318 -0
  1167. venv/Lib/site-packages/pygments/lexers/promql.py +176 -0
  1168. venv/Lib/site-packages/pygments/lexers/prql.py +251 -0
  1169. venv/Lib/site-packages/pygments/lexers/ptx.py +119 -0
  1170. venv/Lib/site-packages/pygments/lexers/python.py +1204 -0
  1171. venv/Lib/site-packages/pygments/lexers/q.py +187 -0
  1172. venv/Lib/site-packages/pygments/lexers/qlik.py +117 -0
  1173. venv/Lib/site-packages/pygments/lexers/qvt.py +153 -0
  1174. venv/Lib/site-packages/pygments/lexers/r.py +196 -0
  1175. venv/Lib/site-packages/pygments/lexers/rdf.py +468 -0
  1176. venv/Lib/site-packages/pygments/lexers/rebol.py +419 -0
  1177. venv/Lib/site-packages/pygments/lexers/rego.py +57 -0
  1178. venv/Lib/site-packages/pygments/lexers/rell.py +68 -0
  1179. venv/Lib/site-packages/pygments/lexers/resource.py +83 -0
  1180. venv/Lib/site-packages/pygments/lexers/ride.py +138 -0
  1181. venv/Lib/site-packages/pygments/lexers/rita.py +42 -0
  1182. venv/Lib/site-packages/pygments/lexers/rnc.py +66 -0
  1183. venv/Lib/site-packages/pygments/lexers/roboconf.py +81 -0
  1184. venv/Lib/site-packages/pygments/lexers/robotframework.py +551 -0
  1185. venv/Lib/site-packages/pygments/lexers/ruby.py +518 -0
  1186. venv/Lib/site-packages/pygments/lexers/rust.py +222 -0
  1187. venv/Lib/site-packages/pygments/lexers/sas.py +227 -0
  1188. venv/Lib/site-packages/pygments/lexers/savi.py +171 -0
  1189. venv/Lib/site-packages/pygments/lexers/scdoc.py +85 -0
  1190. venv/Lib/site-packages/pygments/lexers/scripting.py +1638 -0
  1191. venv/Lib/site-packages/pygments/lexers/sgf.py +59 -0
  1192. venv/Lib/site-packages/pygments/lexers/shell.py +902 -0
  1193. venv/Lib/site-packages/pygments/lexers/sieve.py +78 -0
  1194. venv/Lib/site-packages/pygments/lexers/slash.py +183 -0
  1195. venv/Lib/site-packages/pygments/lexers/smalltalk.py +194 -0
  1196. venv/Lib/site-packages/pygments/lexers/smithy.py +77 -0
  1197. venv/Lib/site-packages/pygments/lexers/smv.py +78 -0
  1198. venv/Lib/site-packages/pygments/lexers/snobol.py +82 -0
  1199. venv/Lib/site-packages/pygments/lexers/solidity.py +87 -0
  1200. venv/Lib/site-packages/pygments/lexers/soong.py +78 -0
  1201. venv/Lib/site-packages/pygments/lexers/sophia.py +102 -0
  1202. venv/Lib/site-packages/pygments/lexers/special.py +122 -0
  1203. venv/Lib/site-packages/pygments/lexers/spice.py +70 -0
  1204. venv/Lib/site-packages/pygments/lexers/sql.py +1111 -0
  1205. venv/Lib/site-packages/pygments/lexers/srcinfo.py +62 -0
  1206. venv/Lib/site-packages/pygments/lexers/stata.py +170 -0
  1207. venv/Lib/site-packages/pygments/lexers/supercollider.py +94 -0
  1208. venv/Lib/site-packages/pygments/lexers/tablegen.py +177 -0
  1209. venv/Lib/site-packages/pygments/lexers/tact.py +303 -0
  1210. venv/Lib/site-packages/pygments/lexers/tal.py +77 -0
  1211. venv/Lib/site-packages/pygments/lexers/tcl.py +148 -0
  1212. venv/Lib/site-packages/pygments/lexers/teal.py +88 -0
  1213. venv/Lib/site-packages/pygments/lexers/templates.py +2355 -0
  1214. venv/Lib/site-packages/pygments/lexers/teraterm.py +335 -0
  1215. venv/Lib/site-packages/pygments/lexers/testing.py +209 -0
  1216. venv/Lib/site-packages/pygments/lexers/text.py +27 -0
  1217. venv/Lib/site-packages/pygments/lexers/textedit.py +205 -0
  1218. venv/Lib/site-packages/pygments/lexers/textfmts.py +436 -0
  1219. venv/Lib/site-packages/pygments/lexers/theorem.py +410 -0
  1220. venv/Lib/site-packages/pygments/lexers/thingsdb.py +143 -0
  1221. venv/Lib/site-packages/pygments/lexers/tlb.py +59 -0
  1222. venv/Lib/site-packages/pygments/lexers/tls.py +54 -0
  1223. venv/Lib/site-packages/pygments/lexers/tnt.py +270 -0
  1224. venv/Lib/site-packages/pygments/lexers/trafficscript.py +51 -0
  1225. venv/Lib/site-packages/pygments/lexers/typoscript.py +216 -0
  1226. venv/Lib/site-packages/pygments/lexers/typst.py +160 -0
  1227. venv/Lib/site-packages/pygments/lexers/ul4.py +309 -0
  1228. venv/Lib/site-packages/pygments/lexers/unicon.py +413 -0
  1229. venv/Lib/site-packages/pygments/lexers/urbi.py +145 -0
  1230. venv/Lib/site-packages/pygments/lexers/usd.py +85 -0
  1231. venv/Lib/site-packages/pygments/lexers/varnish.py +189 -0
  1232. venv/Lib/site-packages/pygments/lexers/verification.py +113 -0
  1233. venv/Lib/site-packages/pygments/lexers/verifpal.py +65 -0
  1234. venv/Lib/site-packages/pygments/lexers/vip.py +150 -0
  1235. venv/Lib/site-packages/pygments/lexers/vyper.py +140 -0
  1236. venv/Lib/site-packages/pygments/lexers/web.py +24 -0
  1237. venv/Lib/site-packages/pygments/lexers/webassembly.py +119 -0
  1238. venv/Lib/site-packages/pygments/lexers/webidl.py +298 -0
  1239. venv/Lib/site-packages/pygments/lexers/webmisc.py +1006 -0
  1240. venv/Lib/site-packages/pygments/lexers/wgsl.py +406 -0
  1241. venv/Lib/site-packages/pygments/lexers/whiley.py +115 -0
  1242. venv/Lib/site-packages/pygments/lexers/wowtoc.py +120 -0
  1243. venv/Lib/site-packages/pygments/lexers/wren.py +98 -0
  1244. venv/Lib/site-packages/pygments/lexers/x10.py +66 -0
  1245. venv/Lib/site-packages/pygments/lexers/xorg.py +38 -0
  1246. venv/Lib/site-packages/pygments/lexers/yang.py +103 -0
  1247. venv/Lib/site-packages/pygments/lexers/yara.py +69 -0
  1248. venv/Lib/site-packages/pygments/lexers/zig.py +125 -0
  1249. venv/Lib/site-packages/pygments/modeline.py +43 -0
  1250. venv/Lib/site-packages/pygments/plugin.py +74 -0
  1251. venv/Lib/site-packages/pygments/regexopt.py +102 -0
  1252. venv/Lib/site-packages/pygments/scanner.py +104 -0
  1253. venv/Lib/site-packages/pygments/sphinxext.py +247 -0
  1254. venv/Lib/site-packages/pygments/style.py +203 -0
  1255. venv/Lib/site-packages/pygments/styles/__init__.py +61 -0
  1256. venv/Lib/site-packages/pygments/styles/_mapping.py +54 -0
  1257. venv/Lib/site-packages/pygments/styles/abap.py +32 -0
  1258. venv/Lib/site-packages/pygments/styles/algol.py +65 -0
  1259. venv/Lib/site-packages/pygments/styles/algol_nu.py +65 -0
  1260. venv/Lib/site-packages/pygments/styles/arduino.py +100 -0
  1261. venv/Lib/site-packages/pygments/styles/autumn.py +67 -0
  1262. venv/Lib/site-packages/pygments/styles/borland.py +53 -0
  1263. venv/Lib/site-packages/pygments/styles/bw.py +52 -0
  1264. venv/Lib/site-packages/pygments/styles/coffee.py +80 -0
  1265. venv/Lib/site-packages/pygments/styles/colorful.py +83 -0
  1266. venv/Lib/site-packages/pygments/styles/default.py +76 -0
  1267. venv/Lib/site-packages/pygments/styles/dracula.py +90 -0
  1268. venv/Lib/site-packages/pygments/styles/emacs.py +75 -0
  1269. venv/Lib/site-packages/pygments/styles/friendly.py +76 -0
  1270. venv/Lib/site-packages/pygments/styles/friendly_grayscale.py +80 -0
  1271. venv/Lib/site-packages/pygments/styles/fruity.py +47 -0
  1272. venv/Lib/site-packages/pygments/styles/gh_dark.py +113 -0
  1273. venv/Lib/site-packages/pygments/styles/gruvbox.py +118 -0
  1274. venv/Lib/site-packages/pygments/styles/igor.py +32 -0
  1275. venv/Lib/site-packages/pygments/styles/inkpot.py +72 -0
  1276. venv/Lib/site-packages/pygments/styles/lightbulb.py +110 -0
  1277. venv/Lib/site-packages/pygments/styles/lilypond.py +62 -0
  1278. venv/Lib/site-packages/pygments/styles/lovelace.py +100 -0
  1279. venv/Lib/site-packages/pygments/styles/manni.py +79 -0
  1280. venv/Lib/site-packages/pygments/styles/material.py +124 -0
  1281. venv/Lib/site-packages/pygments/styles/monokai.py +112 -0
  1282. venv/Lib/site-packages/pygments/styles/murphy.py +82 -0
  1283. venv/Lib/site-packages/pygments/styles/native.py +70 -0
  1284. venv/Lib/site-packages/pygments/styles/nord.py +156 -0
  1285. venv/Lib/site-packages/pygments/styles/onedark.py +73 -0
  1286. venv/Lib/site-packages/pygments/styles/paraiso_dark.py +124 -0
  1287. venv/Lib/site-packages/pygments/styles/paraiso_light.py +124 -0
  1288. venv/Lib/site-packages/pygments/styles/pastie.py +78 -0
  1289. venv/Lib/site-packages/pygments/styles/perldoc.py +73 -0
  1290. venv/Lib/site-packages/pygments/styles/rainbow_dash.py +95 -0
  1291. venv/Lib/site-packages/pygments/styles/rrt.py +54 -0
  1292. venv/Lib/site-packages/pygments/styles/sas.py +46 -0
  1293. venv/Lib/site-packages/pygments/styles/solarized.py +144 -0
  1294. venv/Lib/site-packages/pygments/styles/staroffice.py +31 -0
  1295. venv/Lib/site-packages/pygments/styles/stata_dark.py +42 -0
  1296. venv/Lib/site-packages/pygments/styles/stata_light.py +42 -0
  1297. venv/Lib/site-packages/pygments/styles/tango.py +143 -0
  1298. venv/Lib/site-packages/pygments/styles/trac.py +66 -0
  1299. venv/Lib/site-packages/pygments/styles/vim.py +67 -0
  1300. venv/Lib/site-packages/pygments/styles/vs.py +41 -0
  1301. venv/Lib/site-packages/pygments/styles/xcode.py +53 -0
  1302. venv/Lib/site-packages/pygments/styles/zenburn.py +83 -0
  1303. venv/Lib/site-packages/pygments/token.py +214 -0
  1304. venv/Lib/site-packages/pygments/unistring.py +153 -0
  1305. venv/Lib/site-packages/pygments/util.py +324 -0
  1306. venv/Lib/site-packages/pyproject_hooks/__init__.py +31 -0
  1307. venv/Lib/site-packages/pyproject_hooks/_impl.py +410 -0
  1308. venv/Lib/site-packages/pyproject_hooks/_in_process/__init__.py +21 -0
  1309. venv/Lib/site-packages/pyproject_hooks/_in_process/_in_process.py +389 -0
  1310. venv/Lib/site-packages/pyproject_hooks/py.typed +0 -0
  1311. venv/Lib/site-packages/pytest/__init__.py +186 -0
  1312. venv/Lib/site-packages/pytest/__main__.py +9 -0
  1313. venv/Lib/site-packages/pytest/py.typed +0 -0
  1314. venv/Lib/site-packages/readme_renderer/__init__.py +13 -0
  1315. venv/Lib/site-packages/readme_renderer/__main__.py +66 -0
  1316. venv/Lib/site-packages/readme_renderer/clean.py +89 -0
  1317. venv/Lib/site-packages/readme_renderer/markdown.py +123 -0
  1318. venv/Lib/site-packages/readme_renderer/py.typed +0 -0
  1319. venv/Lib/site-packages/readme_renderer/rst.py +135 -0
  1320. venv/Lib/site-packages/readme_renderer/txt.py +24 -0
  1321. venv/Lib/site-packages/requests/__init__.py +183 -0
  1322. venv/Lib/site-packages/requests/__version__.py +14 -0
  1323. venv/Lib/site-packages/requests/_internal_utils.py +51 -0
  1324. venv/Lib/site-packages/requests/adapters.py +697 -0
  1325. venv/Lib/site-packages/requests/api.py +157 -0
  1326. venv/Lib/site-packages/requests/auth.py +314 -0
  1327. venv/Lib/site-packages/requests/certs.py +18 -0
  1328. venv/Lib/site-packages/requests/compat.py +106 -0
  1329. venv/Lib/site-packages/requests/cookies.py +561 -0
  1330. venv/Lib/site-packages/requests/exceptions.py +152 -0
  1331. venv/Lib/site-packages/requests/help.py +131 -0
  1332. venv/Lib/site-packages/requests/hooks.py +34 -0
  1333. venv/Lib/site-packages/requests/models.py +1041 -0
  1334. venv/Lib/site-packages/requests/packages.py +23 -0
  1335. venv/Lib/site-packages/requests/sessions.py +834 -0
  1336. venv/Lib/site-packages/requests/status_codes.py +128 -0
  1337. venv/Lib/site-packages/requests/structures.py +99 -0
  1338. venv/Lib/site-packages/requests/utils.py +1083 -0
  1339. venv/Lib/site-packages/requests_toolbelt/__init__.py +34 -0
  1340. venv/Lib/site-packages/requests_toolbelt/_compat.py +302 -0
  1341. venv/Lib/site-packages/requests_toolbelt/adapters/__init__.py +15 -0
  1342. venv/Lib/site-packages/requests_toolbelt/adapters/appengine.py +206 -0
  1343. venv/Lib/site-packages/requests_toolbelt/adapters/fingerprint.py +48 -0
  1344. venv/Lib/site-packages/requests_toolbelt/adapters/host_header_ssl.py +43 -0
  1345. venv/Lib/site-packages/requests_toolbelt/adapters/socket_options.py +129 -0
  1346. venv/Lib/site-packages/requests_toolbelt/adapters/source.py +67 -0
  1347. venv/Lib/site-packages/requests_toolbelt/adapters/ssl.py +66 -0
  1348. venv/Lib/site-packages/requests_toolbelt/adapters/x509.py +196 -0
  1349. venv/Lib/site-packages/requests_toolbelt/auth/__init__.py +0 -0
  1350. venv/Lib/site-packages/requests_toolbelt/auth/_digest_auth_compat.py +29 -0
  1351. venv/Lib/site-packages/requests_toolbelt/auth/guess.py +146 -0
  1352. venv/Lib/site-packages/requests_toolbelt/auth/handler.py +142 -0
  1353. venv/Lib/site-packages/requests_toolbelt/auth/http_proxy_digest.py +103 -0
  1354. venv/Lib/site-packages/requests_toolbelt/cookies/__init__.py +0 -0
  1355. venv/Lib/site-packages/requests_toolbelt/cookies/forgetful.py +7 -0
  1356. venv/Lib/site-packages/requests_toolbelt/downloadutils/__init__.py +0 -0
  1357. venv/Lib/site-packages/requests_toolbelt/downloadutils/stream.py +176 -0
  1358. venv/Lib/site-packages/requests_toolbelt/downloadutils/tee.py +123 -0
  1359. venv/Lib/site-packages/requests_toolbelt/exceptions.py +25 -0
  1360. venv/Lib/site-packages/requests_toolbelt/multipart/__init__.py +31 -0
  1361. venv/Lib/site-packages/requests_toolbelt/multipart/decoder.py +156 -0
  1362. venv/Lib/site-packages/requests_toolbelt/multipart/encoder.py +655 -0
  1363. venv/Lib/site-packages/requests_toolbelt/sessions.py +89 -0
  1364. venv/Lib/site-packages/requests_toolbelt/streaming_iterator.py +116 -0
  1365. venv/Lib/site-packages/requests_toolbelt/threaded/__init__.py +97 -0
  1366. venv/Lib/site-packages/requests_toolbelt/threaded/pool.py +211 -0
  1367. venv/Lib/site-packages/requests_toolbelt/threaded/thread.py +53 -0
  1368. venv/Lib/site-packages/requests_toolbelt/utils/__init__.py +0 -0
  1369. venv/Lib/site-packages/requests_toolbelt/utils/deprecated.py +91 -0
  1370. venv/Lib/site-packages/requests_toolbelt/utils/dump.py +198 -0
  1371. venv/Lib/site-packages/requests_toolbelt/utils/formdata.py +108 -0
  1372. venv/Lib/site-packages/requests_toolbelt/utils/user_agent.py +143 -0
  1373. venv/Lib/site-packages/rfc3986/__init__.py +53 -0
  1374. venv/Lib/site-packages/rfc3986/_mixin.py +373 -0
  1375. venv/Lib/site-packages/rfc3986/abnf_regexp.py +275 -0
  1376. venv/Lib/site-packages/rfc3986/api.py +104 -0
  1377. venv/Lib/site-packages/rfc3986/builder.py +388 -0
  1378. venv/Lib/site-packages/rfc3986/compat.py +59 -0
  1379. venv/Lib/site-packages/rfc3986/exceptions.py +120 -0
  1380. venv/Lib/site-packages/rfc3986/iri.py +161 -0
  1381. venv/Lib/site-packages/rfc3986/misc.py +131 -0
  1382. venv/Lib/site-packages/rfc3986/normalizers.py +171 -0
  1383. venv/Lib/site-packages/rfc3986/parseresult.py +474 -0
  1384. venv/Lib/site-packages/rfc3986/uri.py +160 -0
  1385. venv/Lib/site-packages/rfc3986/validators.py +440 -0
  1386. venv/Lib/site-packages/rich/__init__.py +177 -0
  1387. venv/Lib/site-packages/rich/__main__.py +245 -0
  1388. venv/Lib/site-packages/rich/_emoji_codes.py +3610 -0
  1389. venv/Lib/site-packages/rich/_emoji_replace.py +31 -0
  1390. venv/Lib/site-packages/rich/_export_format.py +76 -0
  1391. venv/Lib/site-packages/rich/_extension.py +10 -0
  1392. venv/Lib/site-packages/rich/_fileno.py +24 -0
  1393. venv/Lib/site-packages/rich/_inspect.py +272 -0
  1394. venv/Lib/site-packages/rich/_log_render.py +94 -0
  1395. venv/Lib/site-packages/rich/_loop.py +43 -0
  1396. venv/Lib/site-packages/rich/_null_file.py +69 -0
  1397. venv/Lib/site-packages/rich/_palettes.py +309 -0
  1398. venv/Lib/site-packages/rich/_pick.py +17 -0
  1399. venv/Lib/site-packages/rich/_ratio.py +153 -0
  1400. venv/Lib/site-packages/rich/_spinners.py +482 -0
  1401. venv/Lib/site-packages/rich/_stack.py +16 -0
  1402. venv/Lib/site-packages/rich/_timer.py +19 -0
  1403. venv/Lib/site-packages/rich/_unicode_data/__init__.py +93 -0
  1404. venv/Lib/site-packages/rich/_unicode_data/_versions.py +23 -0
  1405. venv/Lib/site-packages/rich/_unicode_data/unicode10-0-0.py +611 -0
  1406. venv/Lib/site-packages/rich/_unicode_data/unicode11-0-0.py +625 -0
  1407. venv/Lib/site-packages/rich/_unicode_data/unicode12-0-0.py +637 -0
  1408. venv/Lib/site-packages/rich/_unicode_data/unicode12-1-0.py +636 -0
  1409. venv/Lib/site-packages/rich/_unicode_data/unicode13-0-0.py +648 -0
  1410. venv/Lib/site-packages/rich/_unicode_data/unicode14-0-0.py +661 -0
  1411. venv/Lib/site-packages/rich/_unicode_data/unicode15-0-0.py +671 -0
  1412. venv/Lib/site-packages/rich/_unicode_data/unicode15-1-0.py +670 -0
  1413. venv/Lib/site-packages/rich/_unicode_data/unicode16-0-0.py +683 -0
  1414. venv/Lib/site-packages/rich/_unicode_data/unicode17-0-0.py +691 -0
  1415. venv/Lib/site-packages/rich/_unicode_data/unicode4-1-0.py +425 -0
  1416. venv/Lib/site-packages/rich/_unicode_data/unicode5-0-0.py +430 -0
  1417. venv/Lib/site-packages/rich/_unicode_data/unicode5-1-0.py +433 -0
  1418. venv/Lib/site-packages/rich/_unicode_data/unicode5-2-0.py +461 -0
  1419. venv/Lib/site-packages/rich/_unicode_data/unicode6-0-0.py +469 -0
  1420. venv/Lib/site-packages/rich/_unicode_data/unicode6-1-0.py +480 -0
  1421. venv/Lib/site-packages/rich/_unicode_data/unicode6-2-0.py +480 -0
  1422. venv/Lib/site-packages/rich/_unicode_data/unicode6-3-0.py +481 -0
  1423. venv/Lib/site-packages/rich/_unicode_data/unicode7-0-0.py +507 -0
  1424. venv/Lib/site-packages/rich/_unicode_data/unicode8-0-0.py +515 -0
  1425. venv/Lib/site-packages/rich/_unicode_data/unicode9-0-0.py +598 -0
  1426. venv/Lib/site-packages/rich/_win32_console.py +661 -0
  1427. venv/Lib/site-packages/rich/_windows.py +71 -0
  1428. venv/Lib/site-packages/rich/_windows_renderer.py +56 -0
  1429. venv/Lib/site-packages/rich/_wrap.py +93 -0
  1430. venv/Lib/site-packages/rich/abc.py +33 -0
  1431. venv/Lib/site-packages/rich/align.py +320 -0
  1432. venv/Lib/site-packages/rich/ansi.py +241 -0
  1433. venv/Lib/site-packages/rich/bar.py +93 -0
  1434. venv/Lib/site-packages/rich/box.py +474 -0
  1435. venv/Lib/site-packages/rich/cells.py +352 -0
  1436. venv/Lib/site-packages/rich/color.py +621 -0
  1437. venv/Lib/site-packages/rich/color_triplet.py +38 -0
  1438. venv/Lib/site-packages/rich/columns.py +187 -0
  1439. venv/Lib/site-packages/rich/console.py +2698 -0
  1440. venv/Lib/site-packages/rich/constrain.py +37 -0
  1441. venv/Lib/site-packages/rich/containers.py +167 -0
  1442. venv/Lib/site-packages/rich/control.py +219 -0
  1443. venv/Lib/site-packages/rich/default_styles.py +196 -0
  1444. venv/Lib/site-packages/rich/diagnose.py +39 -0
  1445. venv/Lib/site-packages/rich/emoji.py +93 -0
  1446. venv/Lib/site-packages/rich/errors.py +34 -0
  1447. venv/Lib/site-packages/rich/file_proxy.py +60 -0
  1448. venv/Lib/site-packages/rich/filesize.py +88 -0
  1449. venv/Lib/site-packages/rich/highlighter.py +232 -0
  1450. venv/Lib/site-packages/rich/json.py +139 -0
  1451. venv/Lib/site-packages/rich/jupyter.py +101 -0
  1452. venv/Lib/site-packages/rich/layout.py +442 -0
  1453. venv/Lib/site-packages/rich/live.py +404 -0
  1454. venv/Lib/site-packages/rich/live_render.py +116 -0
  1455. venv/Lib/site-packages/rich/logging.py +305 -0
  1456. venv/Lib/site-packages/rich/markdown.py +802 -0
  1457. venv/Lib/site-packages/rich/markup.py +251 -0
  1458. venv/Lib/site-packages/rich/measure.py +151 -0
  1459. venv/Lib/site-packages/rich/padding.py +141 -0
  1460. venv/Lib/site-packages/rich/pager.py +34 -0
  1461. venv/Lib/site-packages/rich/palette.py +100 -0
  1462. venv/Lib/site-packages/rich/panel.py +317 -0
  1463. venv/Lib/site-packages/rich/pretty.py +1016 -0
  1464. venv/Lib/site-packages/rich/progress.py +1716 -0
  1465. venv/Lib/site-packages/rich/progress_bar.py +223 -0
  1466. venv/Lib/site-packages/rich/prompt.py +400 -0
  1467. venv/Lib/site-packages/rich/protocol.py +41 -0
  1468. venv/Lib/site-packages/rich/py.typed +0 -0
  1469. venv/Lib/site-packages/rich/region.py +10 -0
  1470. venv/Lib/site-packages/rich/repr.py +150 -0
  1471. venv/Lib/site-packages/rich/rule.py +130 -0
  1472. venv/Lib/site-packages/rich/scope.py +92 -0
  1473. venv/Lib/site-packages/rich/screen.py +54 -0
  1474. venv/Lib/site-packages/rich/segment.py +780 -0
  1475. venv/Lib/site-packages/rich/spinner.py +132 -0
  1476. venv/Lib/site-packages/rich/status.py +131 -0
  1477. venv/Lib/site-packages/rich/style.py +796 -0
  1478. venv/Lib/site-packages/rich/styled.py +42 -0
  1479. venv/Lib/site-packages/rich/syntax.py +988 -0
  1480. venv/Lib/site-packages/rich/table.py +1015 -0
  1481. venv/Lib/site-packages/rich/terminal_theme.py +153 -0
  1482. venv/Lib/site-packages/rich/text.py +1363 -0
  1483. venv/Lib/site-packages/rich/theme.py +116 -0
  1484. venv/Lib/site-packages/rich/themes.py +5 -0
  1485. venv/Lib/site-packages/rich/traceback.py +924 -0
  1486. venv/Lib/site-packages/rich/tree.py +257 -0
  1487. venv/Lib/site-packages/twine/__init__.py +54 -0
  1488. venv/Lib/site-packages/twine/__main__.py +54 -0
  1489. venv/Lib/site-packages/twine/auth.py +307 -0
  1490. venv/Lib/site-packages/twine/cli.py +139 -0
  1491. venv/Lib/site-packages/twine/commands/__init__.py +93 -0
  1492. venv/Lib/site-packages/twine/commands/check.py +195 -0
  1493. venv/Lib/site-packages/twine/commands/register.py +87 -0
  1494. venv/Lib/site-packages/twine/commands/upload.py +253 -0
  1495. venv/Lib/site-packages/twine/distribution.py +8 -0
  1496. venv/Lib/site-packages/twine/exceptions.py +175 -0
  1497. venv/Lib/site-packages/twine/package.py +403 -0
  1498. venv/Lib/site-packages/twine/py.typed +0 -0
  1499. venv/Lib/site-packages/twine/repository.py +246 -0
  1500. venv/Lib/site-packages/twine/sdist.py +83 -0
  1501. venv/Lib/site-packages/twine/settings.py +360 -0
  1502. venv/Lib/site-packages/twine/utils.py +387 -0
  1503. venv/Lib/site-packages/twine/wheel.py +81 -0
  1504. venv/Lib/site-packages/typing_extensions.py +4317 -0
  1505. venv/Lib/site-packages/typing_inspection/__init__.py +0 -0
  1506. venv/Lib/site-packages/typing_inspection/introspection.py +587 -0
  1507. venv/Lib/site-packages/typing_inspection/py.typed +0 -0
  1508. venv/Lib/site-packages/typing_inspection/typing_objects.py +607 -0
  1509. venv/Lib/site-packages/typing_inspection/typing_objects.pyi +417 -0
  1510. venv/Lib/site-packages/urllib3/__init__.py +211 -0
  1511. venv/Lib/site-packages/urllib3/_base_connection.py +167 -0
  1512. venv/Lib/site-packages/urllib3/_collections.py +486 -0
  1513. venv/Lib/site-packages/urllib3/_request_methods.py +278 -0
  1514. venv/Lib/site-packages/urllib3/_version.py +24 -0
  1515. venv/Lib/site-packages/urllib3/connection.py +1099 -0
  1516. venv/Lib/site-packages/urllib3/connectionpool.py +1191 -0
  1517. venv/Lib/site-packages/urllib3/contrib/__init__.py +0 -0
  1518. venv/Lib/site-packages/urllib3/contrib/emscripten/__init__.py +17 -0
  1519. venv/Lib/site-packages/urllib3/contrib/emscripten/connection.py +260 -0
  1520. venv/Lib/site-packages/urllib3/contrib/emscripten/fetch.py +726 -0
  1521. venv/Lib/site-packages/urllib3/contrib/emscripten/request.py +22 -0
  1522. venv/Lib/site-packages/urllib3/contrib/emscripten/response.py +281 -0
  1523. venv/Lib/site-packages/urllib3/contrib/pyopenssl.py +563 -0
  1524. venv/Lib/site-packages/urllib3/contrib/socks.py +228 -0
  1525. venv/Lib/site-packages/urllib3/exceptions.py +335 -0
  1526. venv/Lib/site-packages/urllib3/fields.py +341 -0
  1527. venv/Lib/site-packages/urllib3/filepost.py +89 -0
  1528. venv/Lib/site-packages/urllib3/http2/__init__.py +53 -0
  1529. venv/Lib/site-packages/urllib3/http2/connection.py +356 -0
  1530. venv/Lib/site-packages/urllib3/http2/probe.py +87 -0
  1531. venv/Lib/site-packages/urllib3/poolmanager.py +653 -0
  1532. venv/Lib/site-packages/urllib3/py.typed +2 -0
  1533. venv/Lib/site-packages/urllib3/response.py +1493 -0
  1534. venv/Lib/site-packages/urllib3/util/__init__.py +42 -0
  1535. venv/Lib/site-packages/urllib3/util/connection.py +137 -0
  1536. venv/Lib/site-packages/urllib3/util/proxy.py +43 -0
  1537. venv/Lib/site-packages/urllib3/util/request.py +263 -0
  1538. venv/Lib/site-packages/urllib3/util/response.py +101 -0
  1539. venv/Lib/site-packages/urllib3/util/retry.py +557 -0
  1540. venv/Lib/site-packages/urllib3/util/ssl_.py +477 -0
  1541. venv/Lib/site-packages/urllib3/util/ssl_match_hostname.py +153 -0
  1542. venv/Lib/site-packages/urllib3/util/ssltransport.py +271 -0
  1543. venv/Lib/site-packages/urllib3/util/timeout.py +275 -0
  1544. venv/Lib/site-packages/urllib3/util/url.py +469 -0
  1545. venv/Lib/site-packages/urllib3/util/util.py +42 -0
  1546. venv/Lib/site-packages/urllib3/util/wait.py +124 -0
  1547. venv/Lib/site-packages/win32ctypes/__init__.py +8 -0
  1548. venv/Lib/site-packages/win32ctypes/core/__init__.py +60 -0
  1549. venv/Lib/site-packages/win32ctypes/core/_winerrors.py +9 -0
  1550. venv/Lib/site-packages/win32ctypes/core/cffi/__init__.py +11 -0
  1551. venv/Lib/site-packages/win32ctypes/core/cffi/_authentication.py +172 -0
  1552. venv/Lib/site-packages/win32ctypes/core/cffi/_common.py +29 -0
  1553. venv/Lib/site-packages/win32ctypes/core/cffi/_dll.py +30 -0
  1554. venv/Lib/site-packages/win32ctypes/core/cffi/_nl_support.py +18 -0
  1555. venv/Lib/site-packages/win32ctypes/core/cffi/_resource.py +132 -0
  1556. venv/Lib/site-packages/win32ctypes/core/cffi/_system_information.py +32 -0
  1557. venv/Lib/site-packages/win32ctypes/core/cffi/_time.py +18 -0
  1558. venv/Lib/site-packages/win32ctypes/core/cffi/_util.py +105 -0
  1559. venv/Lib/site-packages/win32ctypes/core/compat.py +10 -0
  1560. venv/Lib/site-packages/win32ctypes/core/ctypes/__init__.py +11 -0
  1561. venv/Lib/site-packages/win32ctypes/core/ctypes/_authentication.py +122 -0
  1562. venv/Lib/site-packages/win32ctypes/core/ctypes/_common.py +53 -0
  1563. venv/Lib/site-packages/win32ctypes/core/ctypes/_dll.py +21 -0
  1564. venv/Lib/site-packages/win32ctypes/core/ctypes/_nl_support.py +12 -0
  1565. venv/Lib/site-packages/win32ctypes/core/ctypes/_resource.py +148 -0
  1566. venv/Lib/site-packages/win32ctypes/core/ctypes/_system_information.py +36 -0
  1567. venv/Lib/site-packages/win32ctypes/core/ctypes/_time.py +15 -0
  1568. venv/Lib/site-packages/win32ctypes/core/ctypes/_util.py +78 -0
  1569. venv/Lib/site-packages/win32ctypes/pywin32/__init__.py +12 -0
  1570. venv/Lib/site-packages/win32ctypes/pywin32/pywintypes.py +67 -0
  1571. venv/Lib/site-packages/win32ctypes/pywin32/win32api.py +294 -0
  1572. venv/Lib/site-packages/win32ctypes/pywin32/win32cred.py +145 -0
  1573. venv/Lib/site-packages/win32ctypes/pywintypes.py +13 -0
  1574. venv/Lib/site-packages/win32ctypes/tests/__init__.py +21 -0
  1575. venv/Lib/site-packages/win32ctypes/tests/test_backends.py +36 -0
  1576. venv/Lib/site-packages/win32ctypes/tests/test_win32api.py +304 -0
  1577. venv/Lib/site-packages/win32ctypes/tests/test_win32cred.py +230 -0
  1578. venv/Lib/site-packages/win32ctypes/version.py +1 -0
  1579. venv/Lib/site-packages/win32ctypes/win32api.py +13 -0
  1580. venv/Lib/site-packages/win32ctypes/win32cred.py +13 -0
@@ -0,0 +1,4461 @@
1
+ """
2
+ This module contains definitions to build schemas which `pydantic_core` can
3
+ validate and serialize.
4
+ """
5
+
6
+ from __future__ import annotations as _annotations
7
+
8
+ import sys
9
+ import warnings
10
+ from collections.abc import Generator, Hashable, Mapping
11
+ from datetime import date, datetime, time, timedelta
12
+ from decimal import Decimal
13
+ from re import Pattern
14
+ from typing import TYPE_CHECKING, Any, Callable, Literal, Union
15
+
16
+ from typing_extensions import TypeVar, deprecated
17
+
18
+ if sys.version_info < (3, 12):
19
+ from typing_extensions import TypedDict
20
+ else:
21
+ from typing import TypedDict
22
+
23
+ if sys.version_info < (3, 11):
24
+ from typing_extensions import Protocol, Required, TypeAlias
25
+ else:
26
+ from typing import Protocol, Required, TypeAlias
27
+
28
+ if TYPE_CHECKING:
29
+ from pydantic_core import PydanticUndefined
30
+ else:
31
+ # The initial build of pydantic_core requires PydanticUndefined to generate
32
+ # the core schema; so we need to conditionally skip it. mypy doesn't like
33
+ # this at all, hence the TYPE_CHECKING branch above.
34
+ try:
35
+ from pydantic_core import PydanticUndefined
36
+ except ImportError:
37
+ PydanticUndefined = object()
38
+
39
+
40
+ ExtraBehavior = Literal['allow', 'forbid', 'ignore']
41
+
42
+
43
+ class CoreConfig(TypedDict, total=False):
44
+ """
45
+ Base class for schema configuration options.
46
+
47
+ Attributes:
48
+ title: The name of the configuration.
49
+ strict: Whether the configuration should strictly adhere to specified rules.
50
+ extra_fields_behavior: The behavior for handling extra fields.
51
+ typed_dict_total: Whether the TypedDict should be considered total. Default is `True`.
52
+ from_attributes: Whether to use attributes for models, dataclasses, and tagged union keys.
53
+ loc_by_alias: Whether to use the used alias (or first alias for "field required" errors) instead of
54
+ `field_names` to construct error `loc`s. Default is `True`.
55
+ revalidate_instances: Whether instances of models and dataclasses should re-validate. Default is 'never'.
56
+ validate_default: Whether to validate default values during validation. Default is `False`.
57
+ str_max_length: The maximum length for string fields.
58
+ str_min_length: The minimum length for string fields.
59
+ str_strip_whitespace: Whether to strip whitespace from string fields.
60
+ str_to_lower: Whether to convert string fields to lowercase.
61
+ str_to_upper: Whether to convert string fields to uppercase.
62
+ allow_inf_nan: Whether to allow infinity and NaN values for float fields. Default is `True`.
63
+ ser_json_timedelta: The serialization option for `timedelta` values. Default is 'iso8601'.
64
+ Note that if ser_json_temporal is set, then this param will be ignored.
65
+ ser_json_temporal: The serialization option for datetime like values. Default is 'iso8601'.
66
+ The types this covers are datetime, date, time and timedelta.
67
+ If this is set, it will take precedence over ser_json_timedelta
68
+ ser_json_bytes: The serialization option for `bytes` values. Default is 'utf8'.
69
+ ser_json_inf_nan: The serialization option for infinity and NaN values
70
+ in float fields. Default is 'null'.
71
+ val_json_bytes: The validation option for `bytes` values, complementing ser_json_bytes. Default is 'utf8'.
72
+ hide_input_in_errors: Whether to hide input data from `ValidationError` representation.
73
+ validation_error_cause: Whether to add user-python excs to the __cause__ of a ValidationError.
74
+ Requires exceptiongroup backport pre Python 3.11.
75
+ coerce_numbers_to_str: Whether to enable coercion of any `Number` type to `str` (not applicable in `strict` mode).
76
+ regex_engine: The regex engine to use for regex pattern validation. Default is 'rust-regex'. See `StringSchema`.
77
+ cache_strings: Whether to cache strings. Default is `True`, `True` or `'all'` is required to cache strings
78
+ during general validation since validators don't know if they're in a key or a value.
79
+ validate_by_alias: Whether to use the field's alias when validating against the provided input data. Default is `True`.
80
+ validate_by_name: Whether to use the field's name when validating against the provided input data. Default is `False`. Replacement for `populate_by_name`.
81
+ serialize_by_alias: Whether to serialize by alias. Default is `False`, expected to change to `True` in V3.
82
+ polymorphic_serialization: Whether to enable polymorphic serialization for models and dataclasses. Default is `False`.
83
+ url_preserve_empty_path: Whether to preserve empty URL paths when validating values for a URL type. Defaults to `False`.
84
+ """
85
+
86
+ title: str
87
+ strict: bool
88
+ # settings related to typed dicts, model fields, dataclass fields
89
+ extra_fields_behavior: ExtraBehavior
90
+ typed_dict_total: bool # default: True
91
+ # used for models, dataclasses, and tagged union keys
92
+ from_attributes: bool
93
+ # whether to use the used alias (or first alias for "field required" errors) instead of field_names
94
+ # to construct error `loc`s, default True
95
+ loc_by_alias: bool
96
+ # whether instances of models and dataclasses (including subclass instances) should re-validate, default 'never'
97
+ revalidate_instances: Literal['always', 'never', 'subclass-instances']
98
+ # whether to validate default values during validation, default False
99
+ validate_default: bool
100
+ # used on typed-dicts and arguments
101
+ # fields related to string fields only
102
+ str_max_length: int
103
+ str_min_length: int
104
+ str_strip_whitespace: bool
105
+ str_to_lower: bool
106
+ str_to_upper: bool
107
+ # fields related to float fields only
108
+ allow_inf_nan: bool # default: True
109
+ # the config options are used to customise serialization to JSON
110
+ ser_json_timedelta: Literal['iso8601', 'float'] # default: 'iso8601'
111
+ ser_json_temporal: Literal['iso8601', 'seconds', 'milliseconds'] # default: 'iso8601'
112
+ ser_json_bytes: Literal['utf8', 'base64', 'hex'] # default: 'utf8'
113
+ ser_json_inf_nan: Literal['null', 'constants', 'strings'] # default: 'null'
114
+ val_json_bytes: Literal['utf8', 'base64', 'hex'] # default: 'utf8'
115
+ # used to hide input data from ValidationError repr
116
+ hide_input_in_errors: bool
117
+ validation_error_cause: bool # default: False
118
+ coerce_numbers_to_str: bool # default: False
119
+ regex_engine: Literal['rust-regex', 'python-re'] # default: 'rust-regex'
120
+ cache_strings: Union[bool, Literal['all', 'keys', 'none']] # default: 'True'
121
+ validate_by_alias: bool # default: True
122
+ validate_by_name: bool # default: False
123
+ serialize_by_alias: bool # default: False
124
+ polymorphic_serialization: bool # default: False
125
+ url_preserve_empty_path: bool # default: False
126
+
127
+
128
+ IncExCall: TypeAlias = 'set[int | str] | dict[int | str, IncExCall] | None'
129
+
130
+ ContextT = TypeVar('ContextT', covariant=True, default='Any | None')
131
+
132
+
133
+ class SerializationInfo(Protocol[ContextT]):
134
+ """Extra data used during serialization."""
135
+
136
+ @property
137
+ def include(self) -> IncExCall:
138
+ """The `include` argument set during serialization."""
139
+ ...
140
+
141
+ @property
142
+ def exclude(self) -> IncExCall:
143
+ """The `exclude` argument set during serialization."""
144
+ ...
145
+
146
+ @property
147
+ def context(self) -> ContextT:
148
+ """The current serialization context."""
149
+ ...
150
+
151
+ @property
152
+ def mode(self) -> Literal['python', 'json'] | str:
153
+ """The serialization mode set during serialization."""
154
+ ...
155
+
156
+ @property
157
+ def by_alias(self) -> bool:
158
+ """The `by_alias` argument set during serialization."""
159
+ ...
160
+
161
+ @property
162
+ def exclude_unset(self) -> bool:
163
+ """The `exclude_unset` argument set during serialization."""
164
+ ...
165
+
166
+ @property
167
+ def exclude_defaults(self) -> bool:
168
+ """The `exclude_defaults` argument set during serialization."""
169
+ ...
170
+
171
+ @property
172
+ def exclude_none(self) -> bool:
173
+ """The `exclude_none` argument set during serialization."""
174
+ ...
175
+
176
+ @property
177
+ def exclude_computed_fields(self) -> bool:
178
+ """The `exclude_computed_fields` argument set during serialization."""
179
+ ...
180
+
181
+ @property
182
+ def serialize_as_any(self) -> bool:
183
+ """The `serialize_as_any` argument set during serialization."""
184
+ ...
185
+
186
+ @property
187
+ def polymorphic_serialization(self) -> bool | None:
188
+ """The `polymorphic_serialization` argument set during serialization, if any."""
189
+ ...
190
+
191
+ @property
192
+ def round_trip(self) -> bool:
193
+ """The `round_trip` argument set during serialization."""
194
+ ...
195
+
196
+ def mode_is_json(self) -> bool: ...
197
+
198
+ def __str__(self) -> str: ...
199
+
200
+ def __repr__(self) -> str: ...
201
+
202
+
203
+ class FieldSerializationInfo(SerializationInfo[ContextT], Protocol):
204
+ """Extra data used during field serialization."""
205
+
206
+ @property
207
+ def field_name(self) -> str:
208
+ """The name of the current field being serialized."""
209
+ ...
210
+
211
+
212
+ class ValidationInfo(Protocol[ContextT]):
213
+ """Extra data used during validation."""
214
+
215
+ @property
216
+ def context(self) -> ContextT:
217
+ """The current validation context."""
218
+ ...
219
+
220
+ @property
221
+ def config(self) -> CoreConfig | None:
222
+ """The CoreConfig that applies to this validation."""
223
+ ...
224
+
225
+ @property
226
+ def mode(self) -> Literal['python', 'json']:
227
+ """The type of input data we are currently validating."""
228
+ ...
229
+
230
+ @property
231
+ def data(self) -> dict[str, Any]:
232
+ """The data being validated for this model."""
233
+ ...
234
+
235
+ @property
236
+ def field_name(self) -> str | None:
237
+ """
238
+ The name of the current field being validated if this validator is
239
+ attached to a model field.
240
+ """
241
+ ...
242
+
243
+
244
+ ExpectedSerializationTypes = Literal[
245
+ 'none',
246
+ 'int',
247
+ 'bool',
248
+ 'float',
249
+ 'str',
250
+ 'bytes',
251
+ 'bytearray',
252
+ 'list',
253
+ 'tuple',
254
+ 'set',
255
+ 'frozenset',
256
+ 'generator',
257
+ 'dict',
258
+ 'datetime',
259
+ 'date',
260
+ 'time',
261
+ 'timedelta',
262
+ 'url',
263
+ 'multi-host-url',
264
+ 'json',
265
+ 'uuid',
266
+ 'any',
267
+ ]
268
+
269
+
270
+ class SimpleSerSchema(TypedDict, total=False):
271
+ type: Required[ExpectedSerializationTypes]
272
+
273
+
274
+ def simple_ser_schema(type: ExpectedSerializationTypes) -> SimpleSerSchema:
275
+ """
276
+ Returns a schema for serialization with a custom type.
277
+
278
+ Args:
279
+ type: The type to use for serialization
280
+ """
281
+ return SimpleSerSchema(type=type)
282
+
283
+
284
+ # (input_value: Any, /) -> Any
285
+ GeneralPlainNoInfoSerializerFunction = Callable[[Any], Any]
286
+ # (input_value: Any, info: FieldSerializationInfo, /) -> Any
287
+ GeneralPlainInfoSerializerFunction = Callable[[Any, SerializationInfo[Any]], Any]
288
+ # (model: Any, input_value: Any, /) -> Any
289
+ FieldPlainNoInfoSerializerFunction = Callable[[Any, Any], Any]
290
+ # (model: Any, input_value: Any, info: FieldSerializationInfo, /) -> Any
291
+ FieldPlainInfoSerializerFunction = Callable[[Any, Any, FieldSerializationInfo[Any]], Any]
292
+ SerializerFunction = Union[
293
+ GeneralPlainNoInfoSerializerFunction,
294
+ GeneralPlainInfoSerializerFunction,
295
+ FieldPlainNoInfoSerializerFunction,
296
+ FieldPlainInfoSerializerFunction,
297
+ ]
298
+
299
+ WhenUsed = Literal['always', 'unless-none', 'json', 'json-unless-none']
300
+ """
301
+ Values have the following meanings:
302
+
303
+ * `'always'` means always use
304
+ * `'unless-none'` means use unless the value is `None`
305
+ * `'json'` means use when serializing to JSON
306
+ * `'json-unless-none'` means use when serializing to JSON and the value is not `None`
307
+ """
308
+
309
+
310
+ class PlainSerializerFunctionSerSchema(TypedDict, total=False):
311
+ type: Required[Literal['function-plain']]
312
+ function: Required[SerializerFunction]
313
+ is_field_serializer: bool # default False
314
+ info_arg: bool # default False
315
+ return_schema: CoreSchema # if omitted, AnySchema is used
316
+ when_used: WhenUsed # default: 'always'
317
+
318
+
319
+ def plain_serializer_function_ser_schema(
320
+ function: SerializerFunction,
321
+ *,
322
+ is_field_serializer: bool | None = None,
323
+ info_arg: bool | None = None,
324
+ return_schema: CoreSchema | None = None,
325
+ when_used: WhenUsed = 'always',
326
+ ) -> PlainSerializerFunctionSerSchema:
327
+ """
328
+ Returns a schema for serialization with a function, can be either a "general" or "field" function.
329
+
330
+ Args:
331
+ function: The function to use for serialization
332
+ is_field_serializer: Whether the serializer is for a field, e.g. takes `model` as the first argument,
333
+ and `info` includes `field_name`
334
+ info_arg: Whether the function takes an `info` argument
335
+ return_schema: Schema to use for serializing return value
336
+ when_used: When the function should be called
337
+ """
338
+ if when_used == 'always':
339
+ # just to avoid extra elements in schema, and to use the actual default defined in rust
340
+ when_used = None # type: ignore
341
+ return _dict_not_none(
342
+ type='function-plain',
343
+ function=function,
344
+ is_field_serializer=is_field_serializer,
345
+ info_arg=info_arg,
346
+ return_schema=return_schema,
347
+ when_used=when_used,
348
+ )
349
+
350
+
351
+ class SerializerFunctionWrapHandler(Protocol): # pragma: no cover
352
+ def __call__(self, input_value: Any, index_key: int | str | None = None, /) -> Any: ...
353
+
354
+
355
+ # (input_value: Any, serializer: SerializerFunctionWrapHandler, /) -> Any
356
+ GeneralWrapNoInfoSerializerFunction = Callable[[Any, SerializerFunctionWrapHandler], Any]
357
+ # (input_value: Any, serializer: SerializerFunctionWrapHandler, info: SerializationInfo, /) -> Any
358
+ GeneralWrapInfoSerializerFunction = Callable[[Any, SerializerFunctionWrapHandler, SerializationInfo[Any]], Any]
359
+ # (model: Any, input_value: Any, serializer: SerializerFunctionWrapHandler, /) -> Any
360
+ FieldWrapNoInfoSerializerFunction = Callable[[Any, Any, SerializerFunctionWrapHandler], Any]
361
+ # (model: Any, input_value: Any, serializer: SerializerFunctionWrapHandler, info: FieldSerializationInfo, /) -> Any
362
+ FieldWrapInfoSerializerFunction = Callable[[Any, Any, SerializerFunctionWrapHandler, FieldSerializationInfo[Any]], Any]
363
+ WrapSerializerFunction = Union[
364
+ GeneralWrapNoInfoSerializerFunction,
365
+ GeneralWrapInfoSerializerFunction,
366
+ FieldWrapNoInfoSerializerFunction,
367
+ FieldWrapInfoSerializerFunction,
368
+ ]
369
+
370
+
371
+ class WrapSerializerFunctionSerSchema(TypedDict, total=False):
372
+ type: Required[Literal['function-wrap']]
373
+ function: Required[WrapSerializerFunction]
374
+ is_field_serializer: bool # default False
375
+ info_arg: bool # default False
376
+ schema: CoreSchema # if omitted, the schema on which this serializer is defined is used
377
+ return_schema: CoreSchema # if omitted, AnySchema is used
378
+ when_used: WhenUsed # default: 'always'
379
+
380
+
381
+ def wrap_serializer_function_ser_schema(
382
+ function: WrapSerializerFunction,
383
+ *,
384
+ is_field_serializer: bool | None = None,
385
+ info_arg: bool | None = None,
386
+ schema: CoreSchema | None = None,
387
+ return_schema: CoreSchema | None = None,
388
+ when_used: WhenUsed = 'always',
389
+ ) -> WrapSerializerFunctionSerSchema:
390
+ """
391
+ Returns a schema for serialization with a wrap function, can be either a "general" or "field" function.
392
+
393
+ Args:
394
+ function: The function to use for serialization
395
+ is_field_serializer: Whether the serializer is for a field, e.g. takes `model` as the first argument,
396
+ and `info` includes `field_name`
397
+ info_arg: Whether the function takes an `info` argument
398
+ schema: The schema to use for the inner serialization
399
+ return_schema: Schema to use for serializing return value
400
+ when_used: When the function should be called
401
+ """
402
+ if when_used == 'always':
403
+ # just to avoid extra elements in schema, and to use the actual default defined in rust
404
+ when_used = None # type: ignore
405
+ return _dict_not_none(
406
+ type='function-wrap',
407
+ function=function,
408
+ is_field_serializer=is_field_serializer,
409
+ info_arg=info_arg,
410
+ schema=schema,
411
+ return_schema=return_schema,
412
+ when_used=when_used,
413
+ )
414
+
415
+
416
+ class FormatSerSchema(TypedDict, total=False):
417
+ type: Required[Literal['format']]
418
+ formatting_string: Required[str]
419
+ when_used: WhenUsed # default: 'json-unless-none'
420
+
421
+
422
+ def format_ser_schema(formatting_string: str, *, when_used: WhenUsed = 'json-unless-none') -> FormatSerSchema:
423
+ """
424
+ Returns a schema for serialization using python's `format` method.
425
+
426
+ Args:
427
+ formatting_string: String defining the format to use
428
+ when_used: Same meaning as for [general_function_plain_ser_schema], but with a different default
429
+ """
430
+ if when_used == 'json-unless-none':
431
+ # just to avoid extra elements in schema, and to use the actual default defined in rust
432
+ when_used = None # type: ignore
433
+ return _dict_not_none(type='format', formatting_string=formatting_string, when_used=when_used)
434
+
435
+
436
+ class ToStringSerSchema(TypedDict, total=False):
437
+ type: Required[Literal['to-string']]
438
+ when_used: WhenUsed # default: 'json-unless-none'
439
+
440
+
441
+ def to_string_ser_schema(*, when_used: WhenUsed = 'json-unless-none') -> ToStringSerSchema:
442
+ """
443
+ Returns a schema for serialization using python's `str()` / `__str__` method.
444
+
445
+ Args:
446
+ when_used: Same meaning as for [general_function_plain_ser_schema], but with a different default
447
+ """
448
+ s = dict(type='to-string')
449
+ if when_used != 'json-unless-none':
450
+ # just to avoid extra elements in schema, and to use the actual default defined in rust
451
+ s['when_used'] = when_used
452
+ return s # type: ignore
453
+
454
+
455
+ class ModelSerSchema(TypedDict, total=False):
456
+ type: Required[Literal['model']]
457
+ cls: Required[type[Any]]
458
+ schema: Required[CoreSchema]
459
+
460
+
461
+ def model_ser_schema(cls: type[Any], schema: CoreSchema) -> ModelSerSchema:
462
+ """
463
+ Returns a schema for serialization using a model.
464
+
465
+ Args:
466
+ cls: The expected class type, used to generate warnings if the wrong type is passed
467
+ schema: Internal schema to use to serialize the model dict
468
+ """
469
+ return ModelSerSchema(type='model', cls=cls, schema=schema)
470
+
471
+
472
+ SerSchema = Union[
473
+ SimpleSerSchema,
474
+ PlainSerializerFunctionSerSchema,
475
+ WrapSerializerFunctionSerSchema,
476
+ FormatSerSchema,
477
+ ToStringSerSchema,
478
+ ModelSerSchema,
479
+ ]
480
+
481
+
482
+ class InvalidSchema(TypedDict, total=False):
483
+ type: Required[Literal['invalid']]
484
+ ref: str
485
+ metadata: dict[str, Any]
486
+ # note, we never plan to use this, but include it for type checking purposes to match
487
+ # all other CoreSchema union members
488
+ serialization: SerSchema
489
+
490
+
491
+ def invalid_schema(ref: str | None = None, metadata: dict[str, Any] | None = None) -> InvalidSchema:
492
+ """
493
+ Returns an invalid schema, used to indicate that a schema is invalid.
494
+
495
+ Args:
496
+ ref: optional unique identifier of the schema, used to reference the schema in other places
497
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
498
+ """
499
+
500
+ return _dict_not_none(type='invalid', ref=ref, metadata=metadata)
501
+
502
+
503
+ class ComputedField(TypedDict, total=False):
504
+ type: Required[Literal['computed-field']]
505
+ property_name: Required[str]
506
+ return_schema: Required[CoreSchema]
507
+ alias: str
508
+ serialization_exclude_if: Callable[[Any], bool]
509
+ metadata: dict[str, Any]
510
+
511
+
512
+ def computed_field(
513
+ property_name: str,
514
+ return_schema: CoreSchema,
515
+ *,
516
+ alias: str | None = None,
517
+ serialization_exclude_if: Callable[[Any], bool] | None = None,
518
+ metadata: dict[str, Any] | None = None,
519
+ ) -> ComputedField:
520
+ """
521
+ ComputedFields are properties of a model or dataclass that are included in serialization.
522
+
523
+ Args:
524
+ property_name: The name of the property on the model or dataclass
525
+ return_schema: The schema used for the type returned by the computed field
526
+ alias: The name to use in the serialized output
527
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
528
+ """
529
+ return _dict_not_none(
530
+ type='computed-field',
531
+ property_name=property_name,
532
+ return_schema=return_schema,
533
+ alias=alias,
534
+ serialization_exclude_if=serialization_exclude_if,
535
+ metadata=metadata,
536
+ )
537
+
538
+
539
+ class AnySchema(TypedDict, total=False):
540
+ type: Required[Literal['any']]
541
+ ref: str
542
+ metadata: dict[str, Any]
543
+ serialization: SerSchema
544
+
545
+
546
+ def any_schema(
547
+ *, ref: str | None = None, metadata: dict[str, Any] | None = None, serialization: SerSchema | None = None
548
+ ) -> AnySchema:
549
+ """
550
+ Returns a schema that matches any value, e.g.:
551
+
552
+ ```py
553
+ from pydantic_core import SchemaValidator, core_schema
554
+
555
+ schema = core_schema.any_schema()
556
+ v = SchemaValidator(schema)
557
+ assert v.validate_python(1) == 1
558
+ ```
559
+
560
+ Args:
561
+ ref: optional unique identifier of the schema, used to reference the schema in other places
562
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
563
+ serialization: Custom serialization schema
564
+ """
565
+ return _dict_not_none(type='any', ref=ref, metadata=metadata, serialization=serialization)
566
+
567
+
568
+ class NoneSchema(TypedDict, total=False):
569
+ type: Required[Literal['none']]
570
+ ref: str
571
+ metadata: dict[str, Any]
572
+ serialization: SerSchema
573
+
574
+
575
+ def none_schema(
576
+ *, ref: str | None = None, metadata: dict[str, Any] | None = None, serialization: SerSchema | None = None
577
+ ) -> NoneSchema:
578
+ """
579
+ Returns a schema that matches a None value, e.g.:
580
+
581
+ ```py
582
+ from pydantic_core import SchemaValidator, core_schema
583
+
584
+ schema = core_schema.none_schema()
585
+ v = SchemaValidator(schema)
586
+ assert v.validate_python(None) is None
587
+ ```
588
+
589
+ Args:
590
+ ref: optional unique identifier of the schema, used to reference the schema in other places
591
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
592
+ serialization: Custom serialization schema
593
+ """
594
+ return _dict_not_none(type='none', ref=ref, metadata=metadata, serialization=serialization)
595
+
596
+
597
+ class BoolSchema(TypedDict, total=False):
598
+ type: Required[Literal['bool']]
599
+ strict: bool
600
+ ref: str
601
+ metadata: dict[str, Any]
602
+ serialization: SerSchema
603
+
604
+
605
+ def bool_schema(
606
+ strict: bool | None = None,
607
+ ref: str | None = None,
608
+ metadata: dict[str, Any] | None = None,
609
+ serialization: SerSchema | None = None,
610
+ ) -> BoolSchema:
611
+ """
612
+ Returns a schema that matches a bool value, e.g.:
613
+
614
+ ```py
615
+ from pydantic_core import SchemaValidator, core_schema
616
+
617
+ schema = core_schema.bool_schema()
618
+ v = SchemaValidator(schema)
619
+ assert v.validate_python('True') is True
620
+ ```
621
+
622
+ Args:
623
+ strict: Whether the value should be a bool or a value that can be converted to a bool
624
+ ref: optional unique identifier of the schema, used to reference the schema in other places
625
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
626
+ serialization: Custom serialization schema
627
+ """
628
+ return _dict_not_none(type='bool', strict=strict, ref=ref, metadata=metadata, serialization=serialization)
629
+
630
+
631
+ class IntSchema(TypedDict, total=False):
632
+ type: Required[Literal['int']]
633
+ multiple_of: int
634
+ le: int
635
+ ge: int
636
+ lt: int
637
+ gt: int
638
+ strict: bool
639
+ ref: str
640
+ metadata: dict[str, Any]
641
+ serialization: SerSchema
642
+
643
+
644
+ def int_schema(
645
+ *,
646
+ multiple_of: int | None = None,
647
+ le: int | None = None,
648
+ ge: int | None = None,
649
+ lt: int | None = None,
650
+ gt: int | None = None,
651
+ strict: bool | None = None,
652
+ ref: str | None = None,
653
+ metadata: dict[str, Any] | None = None,
654
+ serialization: SerSchema | None = None,
655
+ ) -> IntSchema:
656
+ """
657
+ Returns a schema that matches a int value, e.g.:
658
+
659
+ ```py
660
+ from pydantic_core import SchemaValidator, core_schema
661
+
662
+ schema = core_schema.int_schema(multiple_of=2, le=6, ge=2)
663
+ v = SchemaValidator(schema)
664
+ assert v.validate_python('4') == 4
665
+ ```
666
+
667
+ Args:
668
+ multiple_of: The value must be a multiple of this number
669
+ le: The value must be less than or equal to this number
670
+ ge: The value must be greater than or equal to this number
671
+ lt: The value must be strictly less than this number
672
+ gt: The value must be strictly greater than this number
673
+ strict: Whether the value should be a int or a value that can be converted to a int
674
+ ref: optional unique identifier of the schema, used to reference the schema in other places
675
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
676
+ serialization: Custom serialization schema
677
+ """
678
+ return _dict_not_none(
679
+ type='int',
680
+ multiple_of=multiple_of,
681
+ le=le,
682
+ ge=ge,
683
+ lt=lt,
684
+ gt=gt,
685
+ strict=strict,
686
+ ref=ref,
687
+ metadata=metadata,
688
+ serialization=serialization,
689
+ )
690
+
691
+
692
+ class FloatSchema(TypedDict, total=False):
693
+ type: Required[Literal['float']]
694
+ allow_inf_nan: bool # whether 'NaN', '+inf', '-inf' should be forbidden. default: True
695
+ multiple_of: float
696
+ le: float
697
+ ge: float
698
+ lt: float
699
+ gt: float
700
+ strict: bool
701
+ ref: str
702
+ metadata: dict[str, Any]
703
+ serialization: SerSchema
704
+
705
+
706
+ def float_schema(
707
+ *,
708
+ allow_inf_nan: bool | None = None,
709
+ multiple_of: float | None = None,
710
+ le: float | None = None,
711
+ ge: float | None = None,
712
+ lt: float | None = None,
713
+ gt: float | None = None,
714
+ strict: bool | None = None,
715
+ ref: str | None = None,
716
+ metadata: dict[str, Any] | None = None,
717
+ serialization: SerSchema | None = None,
718
+ ) -> FloatSchema:
719
+ """
720
+ Returns a schema that matches a float value, e.g.:
721
+
722
+ ```py
723
+ from pydantic_core import SchemaValidator, core_schema
724
+
725
+ schema = core_schema.float_schema(le=0.8, ge=0.2)
726
+ v = SchemaValidator(schema)
727
+ assert v.validate_python('0.5') == 0.5
728
+ ```
729
+
730
+ Args:
731
+ allow_inf_nan: Whether to allow inf and nan values
732
+ multiple_of: The value must be a multiple of this number
733
+ le: The value must be less than or equal to this number
734
+ ge: The value must be greater than or equal to this number
735
+ lt: The value must be strictly less than this number
736
+ gt: The value must be strictly greater than this number
737
+ strict: Whether the value should be a float or a value that can be converted to a float
738
+ ref: optional unique identifier of the schema, used to reference the schema in other places
739
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
740
+ serialization: Custom serialization schema
741
+ """
742
+ return _dict_not_none(
743
+ type='float',
744
+ allow_inf_nan=allow_inf_nan,
745
+ multiple_of=multiple_of,
746
+ le=le,
747
+ ge=ge,
748
+ lt=lt,
749
+ gt=gt,
750
+ strict=strict,
751
+ ref=ref,
752
+ metadata=metadata,
753
+ serialization=serialization,
754
+ )
755
+
756
+
757
+ class DecimalSchema(TypedDict, total=False):
758
+ type: Required[Literal['decimal']]
759
+ allow_inf_nan: bool # whether 'NaN', '+inf', '-inf' should be forbidden. default: False
760
+ multiple_of: Decimal
761
+ le: Decimal
762
+ ge: Decimal
763
+ lt: Decimal
764
+ gt: Decimal
765
+ max_digits: int
766
+ decimal_places: int
767
+ strict: bool
768
+ ref: str
769
+ metadata: dict[str, Any]
770
+ serialization: SerSchema
771
+
772
+
773
+ def decimal_schema(
774
+ *,
775
+ allow_inf_nan: bool | None = None,
776
+ multiple_of: Decimal | None = None,
777
+ le: Decimal | None = None,
778
+ ge: Decimal | None = None,
779
+ lt: Decimal | None = None,
780
+ gt: Decimal | None = None,
781
+ max_digits: int | None = None,
782
+ decimal_places: int | None = None,
783
+ strict: bool | None = None,
784
+ ref: str | None = None,
785
+ metadata: dict[str, Any] | None = None,
786
+ serialization: SerSchema | None = None,
787
+ ) -> DecimalSchema:
788
+ """
789
+ Returns a schema that matches a decimal value, e.g.:
790
+
791
+ ```py
792
+ from decimal import Decimal
793
+ from pydantic_core import SchemaValidator, core_schema
794
+
795
+ schema = core_schema.decimal_schema(le=0.8, ge=0.2)
796
+ v = SchemaValidator(schema)
797
+ assert v.validate_python('0.5') == Decimal('0.5')
798
+ ```
799
+
800
+ Args:
801
+ allow_inf_nan: Whether to allow inf and nan values
802
+ multiple_of: The value must be a multiple of this number
803
+ le: The value must be less than or equal to this number
804
+ ge: The value must be greater than or equal to this number
805
+ lt: The value must be strictly less than this number
806
+ gt: The value must be strictly greater than this number
807
+ max_digits: The maximum number of decimal digits allowed
808
+ decimal_places: The maximum number of decimal places allowed
809
+ strict: Whether the value should be a float or a value that can be converted to a float
810
+ ref: optional unique identifier of the schema, used to reference the schema in other places
811
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
812
+ serialization: Custom serialization schema
813
+ """
814
+ return _dict_not_none(
815
+ type='decimal',
816
+ gt=gt,
817
+ ge=ge,
818
+ lt=lt,
819
+ le=le,
820
+ max_digits=max_digits,
821
+ decimal_places=decimal_places,
822
+ multiple_of=multiple_of,
823
+ allow_inf_nan=allow_inf_nan,
824
+ strict=strict,
825
+ ref=ref,
826
+ metadata=metadata,
827
+ serialization=serialization,
828
+ )
829
+
830
+
831
+ class ComplexSchema(TypedDict, total=False):
832
+ type: Required[Literal['complex']]
833
+ strict: bool
834
+ ref: str
835
+ metadata: dict[str, Any]
836
+ serialization: SerSchema
837
+
838
+
839
+ def complex_schema(
840
+ *,
841
+ strict: bool | None = None,
842
+ ref: str | None = None,
843
+ metadata: dict[str, Any] | None = None,
844
+ serialization: SerSchema | None = None,
845
+ ) -> ComplexSchema:
846
+ """
847
+ Returns a schema that matches a complex value, e.g.:
848
+
849
+ ```py
850
+ from pydantic_core import SchemaValidator, core_schema
851
+
852
+ schema = core_schema.complex_schema()
853
+ v = SchemaValidator(schema)
854
+ assert v.validate_python('1+2j') == complex(1, 2)
855
+ assert v.validate_python(complex(1, 2)) == complex(1, 2)
856
+ ```
857
+
858
+ Args:
859
+ strict: Whether the value should be a complex object instance or a value that can be converted to a complex object
860
+ ref: optional unique identifier of the schema, used to reference the schema in other places
861
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
862
+ serialization: Custom serialization schema
863
+ """
864
+ return _dict_not_none(
865
+ type='complex',
866
+ strict=strict,
867
+ ref=ref,
868
+ metadata=metadata,
869
+ serialization=serialization,
870
+ )
871
+
872
+
873
+ class StringSchema(TypedDict, total=False):
874
+ type: Required[Literal['str']]
875
+ pattern: Union[str, Pattern[str]]
876
+ max_length: int
877
+ min_length: int
878
+ strip_whitespace: bool
879
+ to_lower: bool
880
+ to_upper: bool
881
+ regex_engine: Literal['rust-regex', 'python-re'] # default: 'rust-regex'
882
+ strict: bool
883
+ coerce_numbers_to_str: bool
884
+ ref: str
885
+ metadata: dict[str, Any]
886
+ serialization: SerSchema
887
+
888
+
889
+ def str_schema(
890
+ *,
891
+ pattern: str | Pattern[str] | None = None,
892
+ max_length: int | None = None,
893
+ min_length: int | None = None,
894
+ strip_whitespace: bool | None = None,
895
+ to_lower: bool | None = None,
896
+ to_upper: bool | None = None,
897
+ regex_engine: Literal['rust-regex', 'python-re'] | None = None,
898
+ strict: bool | None = None,
899
+ coerce_numbers_to_str: bool | None = None,
900
+ ref: str | None = None,
901
+ metadata: dict[str, Any] | None = None,
902
+ serialization: SerSchema | None = None,
903
+ ) -> StringSchema:
904
+ """
905
+ Returns a schema that matches a string value, e.g.:
906
+
907
+ ```py
908
+ from pydantic_core import SchemaValidator, core_schema
909
+
910
+ schema = core_schema.str_schema(max_length=10, min_length=2)
911
+ v = SchemaValidator(schema)
912
+ assert v.validate_python('hello') == 'hello'
913
+ ```
914
+
915
+ Args:
916
+ pattern: A regex pattern that the value must match
917
+ max_length: The value must be at most this length
918
+ min_length: The value must be at least this length
919
+ strip_whitespace: Whether to strip whitespace from the value
920
+ to_lower: Whether to convert the value to lowercase
921
+ to_upper: Whether to convert the value to uppercase
922
+ regex_engine: The regex engine to use for pattern validation. Default is 'rust-regex'.
923
+ - `rust-regex` uses the [`regex`](https://docs.rs/regex) Rust
924
+ crate, which is non-backtracking and therefore more DDoS
925
+ resistant, but does not support all regex features.
926
+ - `python-re` use the [`re`](https://docs.python.org/3/library/re.html) module,
927
+ which supports all regex features, but may be slower.
928
+ strict: Whether the value should be a string or a value that can be converted to a string
929
+ coerce_numbers_to_str: Whether to enable coercion of any `Number` type to `str` (not applicable in `strict` mode).
930
+ ref: optional unique identifier of the schema, used to reference the schema in other places
931
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
932
+ serialization: Custom serialization schema
933
+ """
934
+ return _dict_not_none(
935
+ type='str',
936
+ pattern=pattern,
937
+ max_length=max_length,
938
+ min_length=min_length,
939
+ strip_whitespace=strip_whitespace,
940
+ to_lower=to_lower,
941
+ to_upper=to_upper,
942
+ regex_engine=regex_engine,
943
+ strict=strict,
944
+ coerce_numbers_to_str=coerce_numbers_to_str,
945
+ ref=ref,
946
+ metadata=metadata,
947
+ serialization=serialization,
948
+ )
949
+
950
+
951
+ class BytesSchema(TypedDict, total=False):
952
+ type: Required[Literal['bytes']]
953
+ max_length: int
954
+ min_length: int
955
+ strict: bool
956
+ ref: str
957
+ metadata: dict[str, Any]
958
+ serialization: SerSchema
959
+
960
+
961
+ def bytes_schema(
962
+ *,
963
+ max_length: int | None = None,
964
+ min_length: int | None = None,
965
+ strict: bool | None = None,
966
+ ref: str | None = None,
967
+ metadata: dict[str, Any] | None = None,
968
+ serialization: SerSchema | None = None,
969
+ ) -> BytesSchema:
970
+ """
971
+ Returns a schema that matches a bytes value, e.g.:
972
+
973
+ ```py
974
+ from pydantic_core import SchemaValidator, core_schema
975
+
976
+ schema = core_schema.bytes_schema(max_length=10, min_length=2)
977
+ v = SchemaValidator(schema)
978
+ assert v.validate_python(b'hello') == b'hello'
979
+ ```
980
+
981
+ Args:
982
+ max_length: The value must be at most this length
983
+ min_length: The value must be at least this length
984
+ strict: Whether the value should be a bytes or a value that can be converted to a bytes
985
+ ref: optional unique identifier of the schema, used to reference the schema in other places
986
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
987
+ serialization: Custom serialization schema
988
+ """
989
+ return _dict_not_none(
990
+ type='bytes',
991
+ max_length=max_length,
992
+ min_length=min_length,
993
+ strict=strict,
994
+ ref=ref,
995
+ metadata=metadata,
996
+ serialization=serialization,
997
+ )
998
+
999
+
1000
+ class DateSchema(TypedDict, total=False):
1001
+ type: Required[Literal['date']]
1002
+ strict: bool
1003
+ le: date
1004
+ ge: date
1005
+ lt: date
1006
+ gt: date
1007
+ now_op: Literal['past', 'future']
1008
+ # defaults to current local utc offset from `time.localtime().tm_gmtoff`
1009
+ # value is restricted to -86_400 < offset < 86_400:
1010
+ now_utc_offset: int
1011
+ ref: str
1012
+ metadata: dict[str, Any]
1013
+ serialization: SerSchema
1014
+
1015
+
1016
+ def date_schema(
1017
+ *,
1018
+ strict: bool | None = None,
1019
+ le: date | None = None,
1020
+ ge: date | None = None,
1021
+ lt: date | None = None,
1022
+ gt: date | None = None,
1023
+ now_op: Literal['past', 'future'] | None = None,
1024
+ now_utc_offset: int | None = None,
1025
+ ref: str | None = None,
1026
+ metadata: dict[str, Any] | None = None,
1027
+ serialization: SerSchema | None = None,
1028
+ ) -> DateSchema:
1029
+ """
1030
+ Returns a schema that matches a date value, e.g.:
1031
+
1032
+ ```py
1033
+ from datetime import date
1034
+ from pydantic_core import SchemaValidator, core_schema
1035
+
1036
+ schema = core_schema.date_schema(le=date(2020, 1, 1), ge=date(2019, 1, 1))
1037
+ v = SchemaValidator(schema)
1038
+ assert v.validate_python(date(2019, 6, 1)) == date(2019, 6, 1)
1039
+ ```
1040
+
1041
+ Args:
1042
+ strict: Whether the value should be a date or a value that can be converted to a date
1043
+ le: The value must be less than or equal to this date
1044
+ ge: The value must be greater than or equal to this date
1045
+ lt: The value must be strictly less than this date
1046
+ gt: The value must be strictly greater than this date
1047
+ now_op: The value must be in the past or future relative to the current date
1048
+ now_utc_offset: The value must be in the past or future relative to the current date with this utc offset
1049
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1050
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1051
+ serialization: Custom serialization schema
1052
+ """
1053
+ return _dict_not_none(
1054
+ type='date',
1055
+ strict=strict,
1056
+ le=le,
1057
+ ge=ge,
1058
+ lt=lt,
1059
+ gt=gt,
1060
+ now_op=now_op,
1061
+ now_utc_offset=now_utc_offset,
1062
+ ref=ref,
1063
+ metadata=metadata,
1064
+ serialization=serialization,
1065
+ )
1066
+
1067
+
1068
+ class TimeSchema(TypedDict, total=False):
1069
+ type: Required[Literal['time']]
1070
+ strict: bool
1071
+ le: time
1072
+ ge: time
1073
+ lt: time
1074
+ gt: time
1075
+ tz_constraint: Union[Literal['aware', 'naive'], int]
1076
+ microseconds_precision: Literal['truncate', 'error']
1077
+ ref: str
1078
+ metadata: dict[str, Any]
1079
+ serialization: SerSchema
1080
+
1081
+
1082
+ def time_schema(
1083
+ *,
1084
+ strict: bool | None = None,
1085
+ le: time | None = None,
1086
+ ge: time | None = None,
1087
+ lt: time | None = None,
1088
+ gt: time | None = None,
1089
+ tz_constraint: Literal['aware', 'naive'] | int | None = None,
1090
+ microseconds_precision: Literal['truncate', 'error'] = 'truncate',
1091
+ ref: str | None = None,
1092
+ metadata: dict[str, Any] | None = None,
1093
+ serialization: SerSchema | None = None,
1094
+ ) -> TimeSchema:
1095
+ """
1096
+ Returns a schema that matches a time value, e.g.:
1097
+
1098
+ ```py
1099
+ from datetime import time
1100
+ from pydantic_core import SchemaValidator, core_schema
1101
+
1102
+ schema = core_schema.time_schema(le=time(12, 0, 0), ge=time(6, 0, 0))
1103
+ v = SchemaValidator(schema)
1104
+ assert v.validate_python(time(9, 0, 0)) == time(9, 0, 0)
1105
+ ```
1106
+
1107
+ Args:
1108
+ strict: Whether the value should be a time or a value that can be converted to a time
1109
+ le: The value must be less than or equal to this time
1110
+ ge: The value must be greater than or equal to this time
1111
+ lt: The value must be strictly less than this time
1112
+ gt: The value must be strictly greater than this time
1113
+ tz_constraint: The value must be timezone aware or naive, or an int to indicate required tz offset
1114
+ microseconds_precision: The behavior when seconds have more than 6 digits or microseconds is too large
1115
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1116
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1117
+ serialization: Custom serialization schema
1118
+ """
1119
+ return _dict_not_none(
1120
+ type='time',
1121
+ strict=strict,
1122
+ le=le,
1123
+ ge=ge,
1124
+ lt=lt,
1125
+ gt=gt,
1126
+ tz_constraint=tz_constraint,
1127
+ microseconds_precision=microseconds_precision,
1128
+ ref=ref,
1129
+ metadata=metadata,
1130
+ serialization=serialization,
1131
+ )
1132
+
1133
+
1134
+ class DatetimeSchema(TypedDict, total=False):
1135
+ type: Required[Literal['datetime']]
1136
+ strict: bool
1137
+ le: datetime
1138
+ ge: datetime
1139
+ lt: datetime
1140
+ gt: datetime
1141
+ now_op: Literal['past', 'future']
1142
+ tz_constraint: Union[Literal['aware', 'naive'], int]
1143
+ # defaults to current local utc offset from `time.localtime().tm_gmtoff`
1144
+ # value is restricted to -86_400 < offset < 86_400 by bounds in generate_self_schema.py
1145
+ now_utc_offset: int
1146
+ microseconds_precision: Literal['truncate', 'error'] # default: 'truncate'
1147
+ ref: str
1148
+ metadata: dict[str, Any]
1149
+ serialization: SerSchema
1150
+
1151
+
1152
+ def datetime_schema(
1153
+ *,
1154
+ strict: bool | None = None,
1155
+ le: datetime | None = None,
1156
+ ge: datetime | None = None,
1157
+ lt: datetime | None = None,
1158
+ gt: datetime | None = None,
1159
+ now_op: Literal['past', 'future'] | None = None,
1160
+ tz_constraint: Literal['aware', 'naive'] | int | None = None,
1161
+ now_utc_offset: int | None = None,
1162
+ microseconds_precision: Literal['truncate', 'error'] = 'truncate',
1163
+ ref: str | None = None,
1164
+ metadata: dict[str, Any] | None = None,
1165
+ serialization: SerSchema | None = None,
1166
+ ) -> DatetimeSchema:
1167
+ """
1168
+ Returns a schema that matches a datetime value, e.g.:
1169
+
1170
+ ```py
1171
+ from datetime import datetime
1172
+ from pydantic_core import SchemaValidator, core_schema
1173
+
1174
+ schema = core_schema.datetime_schema()
1175
+ v = SchemaValidator(schema)
1176
+ now = datetime.now()
1177
+ assert v.validate_python(str(now)) == now
1178
+ ```
1179
+
1180
+ Args:
1181
+ strict: Whether the value should be a datetime or a value that can be converted to a datetime
1182
+ le: The value must be less than or equal to this datetime
1183
+ ge: The value must be greater than or equal to this datetime
1184
+ lt: The value must be strictly less than this datetime
1185
+ gt: The value must be strictly greater than this datetime
1186
+ now_op: The value must be in the past or future relative to the current datetime
1187
+ tz_constraint: The value must be timezone aware or naive, or an int to indicate required tz offset
1188
+ TODO: use of a tzinfo where offset changes based on the datetime is not yet supported
1189
+ now_utc_offset: The value must be in the past or future relative to the current datetime with this utc offset
1190
+ microseconds_precision: The behavior when seconds have more than 6 digits or microseconds is too large
1191
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1192
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1193
+ serialization: Custom serialization schema
1194
+ """
1195
+ return _dict_not_none(
1196
+ type='datetime',
1197
+ strict=strict,
1198
+ le=le,
1199
+ ge=ge,
1200
+ lt=lt,
1201
+ gt=gt,
1202
+ now_op=now_op,
1203
+ tz_constraint=tz_constraint,
1204
+ now_utc_offset=now_utc_offset,
1205
+ microseconds_precision=microseconds_precision,
1206
+ ref=ref,
1207
+ metadata=metadata,
1208
+ serialization=serialization,
1209
+ )
1210
+
1211
+
1212
+ class TimedeltaSchema(TypedDict, total=False):
1213
+ type: Required[Literal['timedelta']]
1214
+ strict: bool
1215
+ le: timedelta
1216
+ ge: timedelta
1217
+ lt: timedelta
1218
+ gt: timedelta
1219
+ microseconds_precision: Literal['truncate', 'error']
1220
+ ref: str
1221
+ metadata: dict[str, Any]
1222
+ serialization: SerSchema
1223
+
1224
+
1225
+ def timedelta_schema(
1226
+ *,
1227
+ strict: bool | None = None,
1228
+ le: timedelta | None = None,
1229
+ ge: timedelta | None = None,
1230
+ lt: timedelta | None = None,
1231
+ gt: timedelta | None = None,
1232
+ microseconds_precision: Literal['truncate', 'error'] = 'truncate',
1233
+ ref: str | None = None,
1234
+ metadata: dict[str, Any] | None = None,
1235
+ serialization: SerSchema | None = None,
1236
+ ) -> TimedeltaSchema:
1237
+ """
1238
+ Returns a schema that matches a timedelta value, e.g.:
1239
+
1240
+ ```py
1241
+ from datetime import timedelta
1242
+ from pydantic_core import SchemaValidator, core_schema
1243
+
1244
+ schema = core_schema.timedelta_schema(le=timedelta(days=1), ge=timedelta(days=0))
1245
+ v = SchemaValidator(schema)
1246
+ assert v.validate_python(timedelta(hours=12)) == timedelta(hours=12)
1247
+ ```
1248
+
1249
+ Args:
1250
+ strict: Whether the value should be a timedelta or a value that can be converted to a timedelta
1251
+ le: The value must be less than or equal to this timedelta
1252
+ ge: The value must be greater than or equal to this timedelta
1253
+ lt: The value must be strictly less than this timedelta
1254
+ gt: The value must be strictly greater than this timedelta
1255
+ microseconds_precision: The behavior when seconds have more than 6 digits or microseconds is too large
1256
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1257
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1258
+ serialization: Custom serialization schema
1259
+ """
1260
+ return _dict_not_none(
1261
+ type='timedelta',
1262
+ strict=strict,
1263
+ le=le,
1264
+ ge=ge,
1265
+ lt=lt,
1266
+ gt=gt,
1267
+ microseconds_precision=microseconds_precision,
1268
+ ref=ref,
1269
+ metadata=metadata,
1270
+ serialization=serialization,
1271
+ )
1272
+
1273
+
1274
+ class LiteralSchema(TypedDict, total=False):
1275
+ type: Required[Literal['literal']]
1276
+ expected: Required[list[Any]]
1277
+ ref: str
1278
+ metadata: dict[str, Any]
1279
+ serialization: SerSchema
1280
+
1281
+
1282
+ def literal_schema(
1283
+ expected: list[Any],
1284
+ *,
1285
+ ref: str | None = None,
1286
+ metadata: dict[str, Any] | None = None,
1287
+ serialization: SerSchema | None = None,
1288
+ ) -> LiteralSchema:
1289
+ """
1290
+ Returns a schema that matches a literal value, e.g.:
1291
+
1292
+ ```py
1293
+ from pydantic_core import SchemaValidator, core_schema
1294
+
1295
+ schema = core_schema.literal_schema(['hello', 'world'])
1296
+ v = SchemaValidator(schema)
1297
+ assert v.validate_python('hello') == 'hello'
1298
+ ```
1299
+
1300
+ Args:
1301
+ expected: The value must be one of these values
1302
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1303
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1304
+ serialization: Custom serialization schema
1305
+ """
1306
+ return _dict_not_none(type='literal', expected=expected, ref=ref, metadata=metadata, serialization=serialization)
1307
+
1308
+
1309
+ class EnumSchema(TypedDict, total=False):
1310
+ type: Required[Literal['enum']]
1311
+ cls: Required[Any]
1312
+ members: Required[list[Any]]
1313
+ sub_type: Literal['str', 'int', 'float']
1314
+ missing: Callable[[Any], Any]
1315
+ strict: bool
1316
+ ref: str
1317
+ metadata: dict[str, Any]
1318
+ serialization: SerSchema
1319
+
1320
+
1321
+ def enum_schema(
1322
+ cls: Any,
1323
+ members: list[Any],
1324
+ *,
1325
+ sub_type: Literal['str', 'int', 'float'] | None = None,
1326
+ missing: Callable[[Any], Any] | None = None,
1327
+ strict: bool | None = None,
1328
+ ref: str | None = None,
1329
+ metadata: dict[str, Any] | None = None,
1330
+ serialization: SerSchema | None = None,
1331
+ ) -> EnumSchema:
1332
+ """
1333
+ Returns a schema that matches an enum value, e.g.:
1334
+
1335
+ ```py
1336
+ from enum import Enum
1337
+ from pydantic_core import SchemaValidator, core_schema
1338
+
1339
+ class Color(Enum):
1340
+ RED = 1
1341
+ GREEN = 2
1342
+ BLUE = 3
1343
+
1344
+ schema = core_schema.enum_schema(Color, list(Color.__members__.values()))
1345
+ v = SchemaValidator(schema)
1346
+ assert v.validate_python(2) is Color.GREEN
1347
+ ```
1348
+
1349
+ Args:
1350
+ cls: The enum class
1351
+ members: The members of the enum, generally `list(MyEnum.__members__.values())`
1352
+ sub_type: The type of the enum, either 'str' or 'int' or None for plain enums
1353
+ missing: A function to use when the value is not found in the enum, from `_missing_`
1354
+ strict: Whether to use strict mode, defaults to False
1355
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1356
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1357
+ serialization: Custom serialization schema
1358
+ """
1359
+ return _dict_not_none(
1360
+ type='enum',
1361
+ cls=cls,
1362
+ members=members,
1363
+ sub_type=sub_type,
1364
+ missing=missing,
1365
+ strict=strict,
1366
+ ref=ref,
1367
+ metadata=metadata,
1368
+ serialization=serialization,
1369
+ )
1370
+
1371
+
1372
+ class MissingSentinelSchema(TypedDict, total=False):
1373
+ type: Required[Literal['missing-sentinel']]
1374
+ metadata: dict[str, Any]
1375
+ serialization: SerSchema
1376
+
1377
+
1378
+ def missing_sentinel_schema(
1379
+ metadata: dict[str, Any] | None = None,
1380
+ serialization: SerSchema | None = None,
1381
+ ) -> MissingSentinelSchema:
1382
+ """Returns a schema for the `MISSING` sentinel."""
1383
+
1384
+ return _dict_not_none(
1385
+ type='missing-sentinel',
1386
+ metadata=metadata,
1387
+ serialization=serialization,
1388
+ )
1389
+
1390
+
1391
+ # must match input/parse_json.rs::JsonType::try_from
1392
+ JsonType = Literal['null', 'bool', 'int', 'float', 'str', 'list', 'dict']
1393
+
1394
+
1395
+ class IsInstanceSchema(TypedDict, total=False):
1396
+ type: Required[Literal['is-instance']]
1397
+ cls: Required[Any]
1398
+ cls_repr: str
1399
+ ref: str
1400
+ metadata: dict[str, Any]
1401
+ serialization: SerSchema
1402
+
1403
+
1404
+ def is_instance_schema(
1405
+ cls: Any,
1406
+ *,
1407
+ cls_repr: str | None = None,
1408
+ ref: str | None = None,
1409
+ metadata: dict[str, Any] | None = None,
1410
+ serialization: SerSchema | None = None,
1411
+ ) -> IsInstanceSchema:
1412
+ """
1413
+ Returns a schema that checks if a value is an instance of a class, equivalent to python's `isinstance` method, e.g.:
1414
+
1415
+ ```py
1416
+ from pydantic_core import SchemaValidator, core_schema
1417
+
1418
+ class A:
1419
+ pass
1420
+
1421
+ schema = core_schema.is_instance_schema(cls=A)
1422
+ v = SchemaValidator(schema)
1423
+ v.validate_python(A())
1424
+ ```
1425
+
1426
+ Args:
1427
+ cls: The value must be an instance of this class
1428
+ cls_repr: If provided this string is used in the validator name instead of `repr(cls)`
1429
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1430
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1431
+ serialization: Custom serialization schema
1432
+ """
1433
+ return _dict_not_none(
1434
+ type='is-instance', cls=cls, cls_repr=cls_repr, ref=ref, metadata=metadata, serialization=serialization
1435
+ )
1436
+
1437
+
1438
+ class IsSubclassSchema(TypedDict, total=False):
1439
+ type: Required[Literal['is-subclass']]
1440
+ cls: Required[type[Any]]
1441
+ cls_repr: str
1442
+ ref: str
1443
+ metadata: dict[str, Any]
1444
+ serialization: SerSchema
1445
+
1446
+
1447
+ def is_subclass_schema(
1448
+ cls: type[Any],
1449
+ *,
1450
+ cls_repr: str | None = None,
1451
+ ref: str | None = None,
1452
+ metadata: dict[str, Any] | None = None,
1453
+ serialization: SerSchema | None = None,
1454
+ ) -> IsInstanceSchema:
1455
+ """
1456
+ Returns a schema that checks if a value is a subtype of a class, equivalent to python's `issubclass` method, e.g.:
1457
+
1458
+ ```py
1459
+ from pydantic_core import SchemaValidator, core_schema
1460
+
1461
+ class A:
1462
+ pass
1463
+
1464
+ class B(A):
1465
+ pass
1466
+
1467
+ schema = core_schema.is_subclass_schema(cls=A)
1468
+ v = SchemaValidator(schema)
1469
+ v.validate_python(B)
1470
+ ```
1471
+
1472
+ Args:
1473
+ cls: The value must be a subclass of this class
1474
+ cls_repr: If provided this string is used in the validator name instead of `repr(cls)`
1475
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1476
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1477
+ serialization: Custom serialization schema
1478
+ """
1479
+ return _dict_not_none(
1480
+ type='is-subclass', cls=cls, cls_repr=cls_repr, ref=ref, metadata=metadata, serialization=serialization
1481
+ )
1482
+
1483
+
1484
+ class CallableSchema(TypedDict, total=False):
1485
+ type: Required[Literal['callable']]
1486
+ ref: str
1487
+ metadata: dict[str, Any]
1488
+ serialization: SerSchema
1489
+
1490
+
1491
+ def callable_schema(
1492
+ *, ref: str | None = None, metadata: dict[str, Any] | None = None, serialization: SerSchema | None = None
1493
+ ) -> CallableSchema:
1494
+ """
1495
+ Returns a schema that checks if a value is callable, equivalent to python's `callable` method, e.g.:
1496
+
1497
+ ```py
1498
+ from pydantic_core import SchemaValidator, core_schema
1499
+
1500
+ schema = core_schema.callable_schema()
1501
+ v = SchemaValidator(schema)
1502
+ v.validate_python(min)
1503
+ ```
1504
+
1505
+ Args:
1506
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1507
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1508
+ serialization: Custom serialization schema
1509
+ """
1510
+ return _dict_not_none(type='callable', ref=ref, metadata=metadata, serialization=serialization)
1511
+
1512
+
1513
+ class UuidSchema(TypedDict, total=False):
1514
+ type: Required[Literal['uuid']]
1515
+ version: Literal[1, 3, 4, 5, 7]
1516
+ strict: bool
1517
+ ref: str
1518
+ metadata: dict[str, Any]
1519
+ serialization: SerSchema
1520
+
1521
+
1522
+ def uuid_schema(
1523
+ *,
1524
+ version: Literal[1, 3, 4, 5, 6, 7, 8] | None = None,
1525
+ strict: bool | None = None,
1526
+ ref: str | None = None,
1527
+ metadata: dict[str, Any] | None = None,
1528
+ serialization: SerSchema | None = None,
1529
+ ) -> UuidSchema:
1530
+ return _dict_not_none(
1531
+ type='uuid', version=version, strict=strict, ref=ref, metadata=metadata, serialization=serialization
1532
+ )
1533
+
1534
+
1535
+ class IncExSeqSerSchema(TypedDict, total=False):
1536
+ type: Required[Literal['include-exclude-sequence']]
1537
+ include: set[int]
1538
+ exclude: set[int]
1539
+
1540
+
1541
+ def filter_seq_schema(*, include: set[int] | None = None, exclude: set[int] | None = None) -> IncExSeqSerSchema:
1542
+ return _dict_not_none(type='include-exclude-sequence', include=include, exclude=exclude)
1543
+
1544
+
1545
+ IncExSeqOrElseSerSchema = Union[IncExSeqSerSchema, SerSchema]
1546
+
1547
+
1548
+ class ListSchema(TypedDict, total=False):
1549
+ type: Required[Literal['list']]
1550
+ items_schema: CoreSchema
1551
+ min_length: int
1552
+ max_length: int
1553
+ fail_fast: bool
1554
+ strict: bool
1555
+ ref: str
1556
+ metadata: dict[str, Any]
1557
+ serialization: IncExSeqOrElseSerSchema
1558
+
1559
+
1560
+ def list_schema(
1561
+ items_schema: CoreSchema | None = None,
1562
+ *,
1563
+ min_length: int | None = None,
1564
+ max_length: int | None = None,
1565
+ fail_fast: bool | None = None,
1566
+ strict: bool | None = None,
1567
+ ref: str | None = None,
1568
+ metadata: dict[str, Any] | None = None,
1569
+ serialization: IncExSeqOrElseSerSchema | None = None,
1570
+ ) -> ListSchema:
1571
+ """
1572
+ Returns a schema that matches a list value, e.g.:
1573
+
1574
+ ```py
1575
+ from pydantic_core import SchemaValidator, core_schema
1576
+
1577
+ schema = core_schema.list_schema(core_schema.int_schema(), min_length=0, max_length=10)
1578
+ v = SchemaValidator(schema)
1579
+ assert v.validate_python(['4']) == [4]
1580
+ ```
1581
+
1582
+ Args:
1583
+ items_schema: The value must be a list of items that match this schema
1584
+ min_length: The value must be a list with at least this many items
1585
+ max_length: The value must be a list with at most this many items
1586
+ fail_fast: Stop validation on the first error
1587
+ strict: The value must be a list with exactly this many items
1588
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1589
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1590
+ serialization: Custom serialization schema
1591
+ """
1592
+ return _dict_not_none(
1593
+ type='list',
1594
+ items_schema=items_schema,
1595
+ min_length=min_length,
1596
+ max_length=max_length,
1597
+ fail_fast=fail_fast,
1598
+ strict=strict,
1599
+ ref=ref,
1600
+ metadata=metadata,
1601
+ serialization=serialization,
1602
+ )
1603
+
1604
+
1605
+ # @deprecated('tuple_positional_schema is deprecated. Use pydantic_core.core_schema.tuple_schema instead.')
1606
+ def tuple_positional_schema(
1607
+ items_schema: list[CoreSchema],
1608
+ *,
1609
+ extras_schema: CoreSchema | None = None,
1610
+ strict: bool | None = None,
1611
+ ref: str | None = None,
1612
+ metadata: dict[str, Any] | None = None,
1613
+ serialization: IncExSeqOrElseSerSchema | None = None,
1614
+ ) -> TupleSchema:
1615
+ """
1616
+ Returns a schema that matches a tuple of schemas, e.g.:
1617
+
1618
+ ```py
1619
+ from pydantic_core import SchemaValidator, core_schema
1620
+
1621
+ schema = core_schema.tuple_positional_schema(
1622
+ [core_schema.int_schema(), core_schema.str_schema()]
1623
+ )
1624
+ v = SchemaValidator(schema)
1625
+ assert v.validate_python((1, 'hello')) == (1, 'hello')
1626
+ ```
1627
+
1628
+ Args:
1629
+ items_schema: The value must be a tuple with items that match these schemas
1630
+ extras_schema: The value must be a tuple with items that match this schema
1631
+ This was inspired by JSON schema's `prefixItems` and `items` fields.
1632
+ In python's `typing.Tuple`, you can't specify a type for "extra" items -- they must all be the same type
1633
+ if the length is variable. So this field won't be set from a `typing.Tuple` annotation on a pydantic model.
1634
+ strict: The value must be a tuple with exactly this many items
1635
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1636
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1637
+ serialization: Custom serialization schema
1638
+ """
1639
+ if extras_schema is not None:
1640
+ variadic_item_index = len(items_schema)
1641
+ items_schema = items_schema + [extras_schema]
1642
+ else:
1643
+ variadic_item_index = None
1644
+ return tuple_schema(
1645
+ items_schema=items_schema,
1646
+ variadic_item_index=variadic_item_index,
1647
+ strict=strict,
1648
+ ref=ref,
1649
+ metadata=metadata,
1650
+ serialization=serialization,
1651
+ )
1652
+
1653
+
1654
+ # @deprecated('tuple_variable_schema is deprecated. Use pydantic_core.core_schema.tuple_schema instead.')
1655
+ def tuple_variable_schema(
1656
+ items_schema: CoreSchema | None = None,
1657
+ *,
1658
+ min_length: int | None = None,
1659
+ max_length: int | None = None,
1660
+ strict: bool | None = None,
1661
+ ref: str | None = None,
1662
+ metadata: dict[str, Any] | None = None,
1663
+ serialization: IncExSeqOrElseSerSchema | None = None,
1664
+ ) -> TupleSchema:
1665
+ """
1666
+ Returns a schema that matches a tuple of a given schema, e.g.:
1667
+
1668
+ ```py
1669
+ from pydantic_core import SchemaValidator, core_schema
1670
+
1671
+ schema = core_schema.tuple_variable_schema(
1672
+ items_schema=core_schema.int_schema(), min_length=0, max_length=10
1673
+ )
1674
+ v = SchemaValidator(schema)
1675
+ assert v.validate_python(('1', 2, 3)) == (1, 2, 3)
1676
+ ```
1677
+
1678
+ Args:
1679
+ items_schema: The value must be a tuple with items that match this schema
1680
+ min_length: The value must be a tuple with at least this many items
1681
+ max_length: The value must be a tuple with at most this many items
1682
+ strict: The value must be a tuple with exactly this many items
1683
+ ref: Optional unique identifier of the schema, used to reference the schema in other places
1684
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1685
+ serialization: Custom serialization schema
1686
+ """
1687
+ return tuple_schema(
1688
+ items_schema=[items_schema or any_schema()],
1689
+ variadic_item_index=0,
1690
+ min_length=min_length,
1691
+ max_length=max_length,
1692
+ strict=strict,
1693
+ ref=ref,
1694
+ metadata=metadata,
1695
+ serialization=serialization,
1696
+ )
1697
+
1698
+
1699
+ class TupleSchema(TypedDict, total=False):
1700
+ type: Required[Literal['tuple']]
1701
+ items_schema: Required[list[CoreSchema]]
1702
+ variadic_item_index: int
1703
+ min_length: int
1704
+ max_length: int
1705
+ fail_fast: bool
1706
+ strict: bool
1707
+ ref: str
1708
+ metadata: dict[str, Any]
1709
+ serialization: IncExSeqOrElseSerSchema
1710
+
1711
+
1712
+ def tuple_schema(
1713
+ items_schema: list[CoreSchema],
1714
+ *,
1715
+ variadic_item_index: int | None = None,
1716
+ min_length: int | None = None,
1717
+ max_length: int | None = None,
1718
+ fail_fast: bool | None = None,
1719
+ strict: bool | None = None,
1720
+ ref: str | None = None,
1721
+ metadata: dict[str, Any] | None = None,
1722
+ serialization: IncExSeqOrElseSerSchema | None = None,
1723
+ ) -> TupleSchema:
1724
+ """
1725
+ Returns a schema that matches a tuple of schemas, with an optional variadic item, e.g.:
1726
+
1727
+ ```py
1728
+ from pydantic_core import SchemaValidator, core_schema
1729
+
1730
+ schema = core_schema.tuple_schema(
1731
+ [core_schema.int_schema(), core_schema.str_schema(), core_schema.float_schema()],
1732
+ variadic_item_index=1,
1733
+ )
1734
+ v = SchemaValidator(schema)
1735
+ assert v.validate_python((1, 'hello', 'world', 1.5)) == (1, 'hello', 'world', 1.5)
1736
+ ```
1737
+
1738
+ Args:
1739
+ items_schema: The value must be a tuple with items that match these schemas
1740
+ variadic_item_index: The index of the schema in `items_schema` to be treated as variadic (following PEP 646)
1741
+ min_length: The value must be a tuple with at least this many items
1742
+ max_length: The value must be a tuple with at most this many items
1743
+ fail_fast: Stop validation on the first error
1744
+ strict: The value must be a tuple with exactly this many items
1745
+ ref: Optional unique identifier of the schema, used to reference the schema in other places
1746
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1747
+ serialization: Custom serialization schema
1748
+ """
1749
+ return _dict_not_none(
1750
+ type='tuple',
1751
+ items_schema=items_schema,
1752
+ variadic_item_index=variadic_item_index,
1753
+ min_length=min_length,
1754
+ max_length=max_length,
1755
+ fail_fast=fail_fast,
1756
+ strict=strict,
1757
+ ref=ref,
1758
+ metadata=metadata,
1759
+ serialization=serialization,
1760
+ )
1761
+
1762
+
1763
+ class SetSchema(TypedDict, total=False):
1764
+ type: Required[Literal['set']]
1765
+ items_schema: CoreSchema
1766
+ min_length: int
1767
+ max_length: int
1768
+ fail_fast: bool
1769
+ strict: bool
1770
+ ref: str
1771
+ metadata: dict[str, Any]
1772
+ serialization: SerSchema
1773
+
1774
+
1775
+ def set_schema(
1776
+ items_schema: CoreSchema | None = None,
1777
+ *,
1778
+ min_length: int | None = None,
1779
+ max_length: int | None = None,
1780
+ fail_fast: bool | None = None,
1781
+ strict: bool | None = None,
1782
+ ref: str | None = None,
1783
+ metadata: dict[str, Any] | None = None,
1784
+ serialization: SerSchema | None = None,
1785
+ ) -> SetSchema:
1786
+ """
1787
+ Returns a schema that matches a set of a given schema, e.g.:
1788
+
1789
+ ```py
1790
+ from pydantic_core import SchemaValidator, core_schema
1791
+
1792
+ schema = core_schema.set_schema(
1793
+ items_schema=core_schema.int_schema(), min_length=0, max_length=10
1794
+ )
1795
+ v = SchemaValidator(schema)
1796
+ assert v.validate_python({1, '2', 3}) == {1, 2, 3}
1797
+ ```
1798
+
1799
+ Args:
1800
+ items_schema: The value must be a set with items that match this schema
1801
+ min_length: The value must be a set with at least this many items
1802
+ max_length: The value must be a set with at most this many items
1803
+ fail_fast: Stop validation on the first error
1804
+ strict: The value must be a set with exactly this many items
1805
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1806
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1807
+ serialization: Custom serialization schema
1808
+ """
1809
+ return _dict_not_none(
1810
+ type='set',
1811
+ items_schema=items_schema,
1812
+ min_length=min_length,
1813
+ max_length=max_length,
1814
+ fail_fast=fail_fast,
1815
+ strict=strict,
1816
+ ref=ref,
1817
+ metadata=metadata,
1818
+ serialization=serialization,
1819
+ )
1820
+
1821
+
1822
+ class FrozenSetSchema(TypedDict, total=False):
1823
+ type: Required[Literal['frozenset']]
1824
+ items_schema: CoreSchema
1825
+ min_length: int
1826
+ max_length: int
1827
+ fail_fast: bool
1828
+ strict: bool
1829
+ ref: str
1830
+ metadata: dict[str, Any]
1831
+ serialization: SerSchema
1832
+
1833
+
1834
+ def frozenset_schema(
1835
+ items_schema: CoreSchema | None = None,
1836
+ *,
1837
+ min_length: int | None = None,
1838
+ max_length: int | None = None,
1839
+ fail_fast: bool | None = None,
1840
+ strict: bool | None = None,
1841
+ ref: str | None = None,
1842
+ metadata: dict[str, Any] | None = None,
1843
+ serialization: SerSchema | None = None,
1844
+ ) -> FrozenSetSchema:
1845
+ """
1846
+ Returns a schema that matches a frozenset of a given schema, e.g.:
1847
+
1848
+ ```py
1849
+ from pydantic_core import SchemaValidator, core_schema
1850
+
1851
+ schema = core_schema.frozenset_schema(
1852
+ items_schema=core_schema.int_schema(), min_length=0, max_length=10
1853
+ )
1854
+ v = SchemaValidator(schema)
1855
+ assert v.validate_python(frozenset(range(3))) == frozenset({0, 1, 2})
1856
+ ```
1857
+
1858
+ Args:
1859
+ items_schema: The value must be a frozenset with items that match this schema
1860
+ min_length: The value must be a frozenset with at least this many items
1861
+ max_length: The value must be a frozenset with at most this many items
1862
+ fail_fast: Stop validation on the first error
1863
+ strict: The value must be a frozenset with exactly this many items
1864
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1865
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1866
+ serialization: Custom serialization schema
1867
+ """
1868
+ return _dict_not_none(
1869
+ type='frozenset',
1870
+ items_schema=items_schema,
1871
+ min_length=min_length,
1872
+ max_length=max_length,
1873
+ fail_fast=fail_fast,
1874
+ strict=strict,
1875
+ ref=ref,
1876
+ metadata=metadata,
1877
+ serialization=serialization,
1878
+ )
1879
+
1880
+
1881
+ class GeneratorSchema(TypedDict, total=False):
1882
+ type: Required[Literal['generator']]
1883
+ items_schema: CoreSchema
1884
+ min_length: int
1885
+ max_length: int
1886
+ ref: str
1887
+ metadata: dict[str, Any]
1888
+ serialization: IncExSeqOrElseSerSchema
1889
+
1890
+
1891
+ def generator_schema(
1892
+ items_schema: CoreSchema | None = None,
1893
+ *,
1894
+ min_length: int | None = None,
1895
+ max_length: int | None = None,
1896
+ ref: str | None = None,
1897
+ metadata: dict[str, Any] | None = None,
1898
+ serialization: IncExSeqOrElseSerSchema | None = None,
1899
+ ) -> GeneratorSchema:
1900
+ """
1901
+ Returns a schema that matches a generator value, e.g.:
1902
+
1903
+ ```py
1904
+ from typing import Iterator
1905
+ from pydantic_core import SchemaValidator, core_schema
1906
+
1907
+ def gen() -> Iterator[int]:
1908
+ yield 1
1909
+
1910
+ schema = core_schema.generator_schema(items_schema=core_schema.int_schema())
1911
+ v = SchemaValidator(schema)
1912
+ v.validate_python(gen())
1913
+ ```
1914
+
1915
+ Unlike other types, validated generators do not raise ValidationErrors eagerly,
1916
+ but instead will raise a ValidationError when a violating value is actually read from the generator.
1917
+ This is to ensure that "validated" generators retain the benefit of lazy evaluation.
1918
+
1919
+ Args:
1920
+ items_schema: The value must be a generator with items that match this schema
1921
+ min_length: The value must be a generator that yields at least this many items
1922
+ max_length: The value must be a generator that yields at most this many items
1923
+ ref: optional unique identifier of the schema, used to reference the schema in other places
1924
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
1925
+ serialization: Custom serialization schema
1926
+ """
1927
+ return _dict_not_none(
1928
+ type='generator',
1929
+ items_schema=items_schema,
1930
+ min_length=min_length,
1931
+ max_length=max_length,
1932
+ ref=ref,
1933
+ metadata=metadata,
1934
+ serialization=serialization,
1935
+ )
1936
+
1937
+
1938
+ IncExDict = set[Union[int, str]]
1939
+
1940
+
1941
+ class IncExDictSerSchema(TypedDict, total=False):
1942
+ type: Required[Literal['include-exclude-dict']]
1943
+ include: IncExDict
1944
+ exclude: IncExDict
1945
+
1946
+
1947
+ def filter_dict_schema(*, include: IncExDict | None = None, exclude: IncExDict | None = None) -> IncExDictSerSchema:
1948
+ return _dict_not_none(type='include-exclude-dict', include=include, exclude=exclude)
1949
+
1950
+
1951
+ IncExDictOrElseSerSchema = Union[IncExDictSerSchema, SerSchema]
1952
+
1953
+
1954
+ class DictSchema(TypedDict, total=False):
1955
+ type: Required[Literal['dict']]
1956
+ keys_schema: CoreSchema # default: AnySchema
1957
+ values_schema: CoreSchema # default: AnySchema
1958
+ min_length: int
1959
+ max_length: int
1960
+ fail_fast: bool
1961
+ strict: bool
1962
+ ref: str
1963
+ metadata: dict[str, Any]
1964
+ serialization: IncExDictOrElseSerSchema
1965
+
1966
+
1967
+ def dict_schema(
1968
+ keys_schema: CoreSchema | None = None,
1969
+ values_schema: CoreSchema | None = None,
1970
+ *,
1971
+ min_length: int | None = None,
1972
+ max_length: int | None = None,
1973
+ fail_fast: bool | None = None,
1974
+ strict: bool | None = None,
1975
+ ref: str | None = None,
1976
+ metadata: dict[str, Any] | None = None,
1977
+ serialization: SerSchema | None = None,
1978
+ ) -> DictSchema:
1979
+ """
1980
+ Returns a schema that matches a dict value, e.g.:
1981
+
1982
+ ```py
1983
+ from pydantic_core import SchemaValidator, core_schema
1984
+
1985
+ schema = core_schema.dict_schema(
1986
+ keys_schema=core_schema.str_schema(), values_schema=core_schema.int_schema()
1987
+ )
1988
+ v = SchemaValidator(schema)
1989
+ assert v.validate_python({'a': '1', 'b': 2}) == {'a': 1, 'b': 2}
1990
+ ```
1991
+
1992
+ Args:
1993
+ keys_schema: The value must be a dict with keys that match this schema
1994
+ values_schema: The value must be a dict with values that match this schema
1995
+ min_length: The value must be a dict with at least this many items
1996
+ max_length: The value must be a dict with at most this many items
1997
+ fail_fast: Stop validation on the first error
1998
+ strict: Whether the keys and values should be validated with strict mode
1999
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2000
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2001
+ serialization: Custom serialization schema
2002
+ """
2003
+ return _dict_not_none(
2004
+ type='dict',
2005
+ keys_schema=keys_schema,
2006
+ values_schema=values_schema,
2007
+ min_length=min_length,
2008
+ max_length=max_length,
2009
+ fail_fast=fail_fast,
2010
+ strict=strict,
2011
+ ref=ref,
2012
+ metadata=metadata,
2013
+ serialization=serialization,
2014
+ )
2015
+
2016
+
2017
+ # (input_value: Any, /) -> Any
2018
+ NoInfoValidatorFunction = Callable[[Any], Any]
2019
+
2020
+
2021
+ class NoInfoValidatorFunctionSchema(TypedDict):
2022
+ type: Literal['no-info']
2023
+ function: NoInfoValidatorFunction
2024
+
2025
+
2026
+ # (input_value: Any, info: ValidationInfo, /) -> Any
2027
+ WithInfoValidatorFunction = Callable[[Any, ValidationInfo[Any]], Any]
2028
+
2029
+
2030
+ class WithInfoValidatorFunctionSchema(TypedDict, total=False):
2031
+ type: Required[Literal['with-info']]
2032
+ function: Required[WithInfoValidatorFunction]
2033
+ field_name: str # deprecated
2034
+
2035
+
2036
+ ValidationFunction = Union[NoInfoValidatorFunctionSchema, WithInfoValidatorFunctionSchema]
2037
+
2038
+
2039
+ class _ValidatorFunctionSchema(TypedDict, total=False):
2040
+ function: Required[ValidationFunction]
2041
+ schema: Required[CoreSchema]
2042
+ ref: str
2043
+ metadata: dict[str, Any]
2044
+ serialization: SerSchema
2045
+
2046
+
2047
+ class BeforeValidatorFunctionSchema(_ValidatorFunctionSchema, total=False):
2048
+ type: Required[Literal['function-before']]
2049
+ json_schema_input_schema: CoreSchema
2050
+
2051
+
2052
+ def no_info_before_validator_function(
2053
+ function: NoInfoValidatorFunction,
2054
+ schema: CoreSchema,
2055
+ *,
2056
+ ref: str | None = None,
2057
+ json_schema_input_schema: CoreSchema | None = None,
2058
+ metadata: dict[str, Any] | None = None,
2059
+ serialization: SerSchema | None = None,
2060
+ ) -> BeforeValidatorFunctionSchema:
2061
+ """
2062
+ Returns a schema that calls a validator function before validating, no `info` argument is provided, e.g.:
2063
+
2064
+ ```py
2065
+ from pydantic_core import SchemaValidator, core_schema
2066
+
2067
+ def fn(v: bytes) -> str:
2068
+ return v.decode() + 'world'
2069
+
2070
+ func_schema = core_schema.no_info_before_validator_function(
2071
+ function=fn, schema=core_schema.str_schema()
2072
+ )
2073
+ schema = core_schema.typed_dict_schema({'a': core_schema.typed_dict_field(func_schema)})
2074
+
2075
+ v = SchemaValidator(schema)
2076
+ assert v.validate_python({'a': b'hello '}) == {'a': 'hello world'}
2077
+ ```
2078
+
2079
+ Args:
2080
+ function: The validator function to call
2081
+ schema: The schema to validate the output of the validator function
2082
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2083
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2084
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2085
+ serialization: Custom serialization schema
2086
+ """
2087
+ return _dict_not_none(
2088
+ type='function-before',
2089
+ function={'type': 'no-info', 'function': function},
2090
+ schema=schema,
2091
+ ref=ref,
2092
+ json_schema_input_schema=json_schema_input_schema,
2093
+ metadata=metadata,
2094
+ serialization=serialization,
2095
+ )
2096
+
2097
+
2098
+ def with_info_before_validator_function(
2099
+ function: WithInfoValidatorFunction,
2100
+ schema: CoreSchema,
2101
+ *,
2102
+ field_name: str | None = None,
2103
+ ref: str | None = None,
2104
+ json_schema_input_schema: CoreSchema | None = None,
2105
+ metadata: dict[str, Any] | None = None,
2106
+ serialization: SerSchema | None = None,
2107
+ ) -> BeforeValidatorFunctionSchema:
2108
+ """
2109
+ Returns a schema that calls a validator function before validation, the function is called with
2110
+ an `info` argument, e.g.:
2111
+
2112
+ ```py
2113
+ from pydantic_core import SchemaValidator, core_schema
2114
+
2115
+ def fn(v: bytes, info: core_schema.ValidationInfo) -> str:
2116
+ assert info.data is not None
2117
+ assert info.field_name is not None
2118
+ return v.decode() + 'world'
2119
+
2120
+ func_schema = core_schema.with_info_before_validator_function(
2121
+ function=fn, schema=core_schema.str_schema()
2122
+ )
2123
+ schema = core_schema.typed_dict_schema({'a': core_schema.typed_dict_field(func_schema)})
2124
+
2125
+ v = SchemaValidator(schema)
2126
+ assert v.validate_python({'a': b'hello '}) == {'a': 'hello world'}
2127
+ ```
2128
+
2129
+ Args:
2130
+ function: The validator function to call
2131
+ field_name: The name of the field this validator is applied to, if any (deprecated)
2132
+ schema: The schema to validate the output of the validator function
2133
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2134
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2135
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2136
+ serialization: Custom serialization schema
2137
+ """
2138
+ if field_name is not None:
2139
+ warnings.warn(
2140
+ 'The `field_name` argument on `with_info_before_validator_function` is deprecated, it will be passed to the function through `ValidationState` instead.',
2141
+ DeprecationWarning,
2142
+ stacklevel=2,
2143
+ )
2144
+
2145
+ return _dict_not_none(
2146
+ type='function-before',
2147
+ function=_dict_not_none(type='with-info', function=function, field_name=field_name),
2148
+ schema=schema,
2149
+ ref=ref,
2150
+ json_schema_input_schema=json_schema_input_schema,
2151
+ metadata=metadata,
2152
+ serialization=serialization,
2153
+ )
2154
+
2155
+
2156
+ class AfterValidatorFunctionSchema(_ValidatorFunctionSchema, total=False):
2157
+ type: Required[Literal['function-after']]
2158
+
2159
+
2160
+ def no_info_after_validator_function(
2161
+ function: NoInfoValidatorFunction,
2162
+ schema: CoreSchema,
2163
+ *,
2164
+ ref: str | None = None,
2165
+ json_schema_input_schema: CoreSchema | None = None,
2166
+ metadata: dict[str, Any] | None = None,
2167
+ serialization: SerSchema | None = None,
2168
+ ) -> AfterValidatorFunctionSchema:
2169
+ """
2170
+ Returns a schema that calls a validator function after validating, no `info` argument is provided, e.g.:
2171
+
2172
+ ```py
2173
+ from pydantic_core import SchemaValidator, core_schema
2174
+
2175
+ def fn(v: str) -> str:
2176
+ return v + 'world'
2177
+
2178
+ func_schema = core_schema.no_info_after_validator_function(fn, core_schema.str_schema())
2179
+ schema = core_schema.typed_dict_schema({'a': core_schema.typed_dict_field(func_schema)})
2180
+
2181
+ v = SchemaValidator(schema)
2182
+ assert v.validate_python({'a': b'hello '}) == {'a': 'hello world'}
2183
+ ```
2184
+
2185
+ Args:
2186
+ function: The validator function to call after the schema is validated
2187
+ schema: The schema to validate before the validator function
2188
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2189
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2190
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2191
+ serialization: Custom serialization schema
2192
+ """
2193
+ return _dict_not_none(
2194
+ type='function-after',
2195
+ function={'type': 'no-info', 'function': function},
2196
+ schema=schema,
2197
+ ref=ref,
2198
+ json_schema_input_schema=json_schema_input_schema,
2199
+ metadata=metadata,
2200
+ serialization=serialization,
2201
+ )
2202
+
2203
+
2204
+ def with_info_after_validator_function(
2205
+ function: WithInfoValidatorFunction,
2206
+ schema: CoreSchema,
2207
+ *,
2208
+ field_name: str | None = None,
2209
+ ref: str | None = None,
2210
+ metadata: dict[str, Any] | None = None,
2211
+ serialization: SerSchema | None = None,
2212
+ ) -> AfterValidatorFunctionSchema:
2213
+ """
2214
+ Returns a schema that calls a validator function after validation, the function is called with
2215
+ an `info` argument, e.g.:
2216
+
2217
+ ```py
2218
+ from pydantic_core import SchemaValidator, core_schema
2219
+
2220
+ def fn(v: str, info: core_schema.ValidationInfo) -> str:
2221
+ assert info.data is not None
2222
+ assert info.field_name is not None
2223
+ return v + 'world'
2224
+
2225
+ func_schema = core_schema.with_info_after_validator_function(
2226
+ function=fn, schema=core_schema.str_schema()
2227
+ )
2228
+ schema = core_schema.typed_dict_schema({'a': core_schema.typed_dict_field(func_schema)})
2229
+
2230
+ v = SchemaValidator(schema)
2231
+ assert v.validate_python({'a': b'hello '}) == {'a': 'hello world'}
2232
+ ```
2233
+
2234
+ Args:
2235
+ function: The validator function to call after the schema is validated
2236
+ schema: The schema to validate before the validator function
2237
+ field_name: The name of the field this validator is applied to, if any (deprecated)
2238
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2239
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2240
+ serialization: Custom serialization schema
2241
+ """
2242
+ if field_name is not None:
2243
+ warnings.warn(
2244
+ 'The `field_name` argument on `with_info_after_validator_function` is deprecated, it will be passed to the function through `ValidationState` instead.',
2245
+ DeprecationWarning,
2246
+ stacklevel=2,
2247
+ )
2248
+
2249
+ return _dict_not_none(
2250
+ type='function-after',
2251
+ function=_dict_not_none(type='with-info', function=function, field_name=field_name),
2252
+ schema=schema,
2253
+ ref=ref,
2254
+ metadata=metadata,
2255
+ serialization=serialization,
2256
+ )
2257
+
2258
+
2259
+ class ValidatorFunctionWrapHandler(Protocol):
2260
+ def __call__(self, input_value: Any, outer_location: str | int | None = None, /) -> Any: # pragma: no cover
2261
+ ...
2262
+
2263
+
2264
+ # (input_value: Any, validator: ValidatorFunctionWrapHandler, /) -> Any
2265
+ NoInfoWrapValidatorFunction = Callable[[Any, ValidatorFunctionWrapHandler], Any]
2266
+
2267
+
2268
+ class NoInfoWrapValidatorFunctionSchema(TypedDict):
2269
+ type: Literal['no-info']
2270
+ function: NoInfoWrapValidatorFunction
2271
+
2272
+
2273
+ # (input_value: Any, validator: ValidatorFunctionWrapHandler, info: ValidationInfo, /) -> Any
2274
+ WithInfoWrapValidatorFunction = Callable[[Any, ValidatorFunctionWrapHandler, ValidationInfo[Any]], Any]
2275
+
2276
+
2277
+ class WithInfoWrapValidatorFunctionSchema(TypedDict, total=False):
2278
+ type: Required[Literal['with-info']]
2279
+ function: Required[WithInfoWrapValidatorFunction]
2280
+ field_name: str # deprecated
2281
+
2282
+
2283
+ WrapValidatorFunction = Union[NoInfoWrapValidatorFunctionSchema, WithInfoWrapValidatorFunctionSchema]
2284
+
2285
+
2286
+ class WrapValidatorFunctionSchema(TypedDict, total=False):
2287
+ type: Required[Literal['function-wrap']]
2288
+ function: Required[WrapValidatorFunction]
2289
+ schema: Required[CoreSchema]
2290
+ ref: str
2291
+ json_schema_input_schema: CoreSchema
2292
+ metadata: dict[str, Any]
2293
+ serialization: SerSchema
2294
+
2295
+
2296
+ def no_info_wrap_validator_function(
2297
+ function: NoInfoWrapValidatorFunction,
2298
+ schema: CoreSchema,
2299
+ *,
2300
+ ref: str | None = None,
2301
+ json_schema_input_schema: CoreSchema | None = None,
2302
+ metadata: dict[str, Any] | None = None,
2303
+ serialization: SerSchema | None = None,
2304
+ ) -> WrapValidatorFunctionSchema:
2305
+ """
2306
+ Returns a schema which calls a function with a `validator` callable argument which can
2307
+ optionally be used to call inner validation with the function logic, this is much like the
2308
+ "onion" implementation of middleware in many popular web frameworks, no `info` argument is passed, e.g.:
2309
+
2310
+ ```py
2311
+ from pydantic_core import SchemaValidator, core_schema
2312
+
2313
+ def fn(
2314
+ v: str,
2315
+ validator: core_schema.ValidatorFunctionWrapHandler,
2316
+ ) -> str:
2317
+ return validator(input_value=v) + 'world'
2318
+
2319
+ schema = core_schema.no_info_wrap_validator_function(
2320
+ function=fn, schema=core_schema.str_schema()
2321
+ )
2322
+ v = SchemaValidator(schema)
2323
+ assert v.validate_python('hello ') == 'hello world'
2324
+ ```
2325
+
2326
+ Args:
2327
+ function: The validator function to call
2328
+ schema: The schema to validate the output of the validator function
2329
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2330
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2331
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2332
+ serialization: Custom serialization schema
2333
+ """
2334
+ return _dict_not_none(
2335
+ type='function-wrap',
2336
+ function={'type': 'no-info', 'function': function},
2337
+ schema=schema,
2338
+ json_schema_input_schema=json_schema_input_schema,
2339
+ ref=ref,
2340
+ metadata=metadata,
2341
+ serialization=serialization,
2342
+ )
2343
+
2344
+
2345
+ def with_info_wrap_validator_function(
2346
+ function: WithInfoWrapValidatorFunction,
2347
+ schema: CoreSchema,
2348
+ *,
2349
+ field_name: str | None = None,
2350
+ json_schema_input_schema: CoreSchema | None = None,
2351
+ ref: str | None = None,
2352
+ metadata: dict[str, Any] | None = None,
2353
+ serialization: SerSchema | None = None,
2354
+ ) -> WrapValidatorFunctionSchema:
2355
+ """
2356
+ Returns a schema which calls a function with a `validator` callable argument which can
2357
+ optionally be used to call inner validation with the function logic, this is much like the
2358
+ "onion" implementation of middleware in many popular web frameworks, an `info` argument is also passed, e.g.:
2359
+
2360
+ ```py
2361
+ from pydantic_core import SchemaValidator, core_schema
2362
+
2363
+ def fn(
2364
+ v: str,
2365
+ validator: core_schema.ValidatorFunctionWrapHandler,
2366
+ info: core_schema.ValidationInfo,
2367
+ ) -> str:
2368
+ return validator(input_value=v) + 'world'
2369
+
2370
+ schema = core_schema.with_info_wrap_validator_function(
2371
+ function=fn, schema=core_schema.str_schema()
2372
+ )
2373
+ v = SchemaValidator(schema)
2374
+ assert v.validate_python('hello ') == 'hello world'
2375
+ ```
2376
+
2377
+ Args:
2378
+ function: The validator function to call
2379
+ schema: The schema to validate the output of the validator function
2380
+ field_name: The name of the field this validator is applied to, if any (deprecated)
2381
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2382
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2383
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2384
+ serialization: Custom serialization schema
2385
+ """
2386
+ if field_name is not None:
2387
+ warnings.warn(
2388
+ 'The `field_name` argument on `with_info_wrap_validator_function` is deprecated, it will be passed to the function through `ValidationState` instead.',
2389
+ DeprecationWarning,
2390
+ stacklevel=2,
2391
+ )
2392
+
2393
+ return _dict_not_none(
2394
+ type='function-wrap',
2395
+ function=_dict_not_none(type='with-info', function=function, field_name=field_name),
2396
+ schema=schema,
2397
+ json_schema_input_schema=json_schema_input_schema,
2398
+ ref=ref,
2399
+ metadata=metadata,
2400
+ serialization=serialization,
2401
+ )
2402
+
2403
+
2404
+ class PlainValidatorFunctionSchema(TypedDict, total=False):
2405
+ type: Required[Literal['function-plain']]
2406
+ function: Required[ValidationFunction]
2407
+ ref: str
2408
+ json_schema_input_schema: CoreSchema
2409
+ metadata: dict[str, Any]
2410
+ serialization: SerSchema
2411
+
2412
+
2413
+ def no_info_plain_validator_function(
2414
+ function: NoInfoValidatorFunction,
2415
+ *,
2416
+ ref: str | None = None,
2417
+ json_schema_input_schema: CoreSchema | None = None,
2418
+ metadata: dict[str, Any] | None = None,
2419
+ serialization: SerSchema | None = None,
2420
+ ) -> PlainValidatorFunctionSchema:
2421
+ """
2422
+ Returns a schema that uses the provided function for validation, no `info` argument is passed, e.g.:
2423
+
2424
+ ```py
2425
+ from pydantic_core import SchemaValidator, core_schema
2426
+
2427
+ def fn(v: str) -> str:
2428
+ assert 'hello' in v
2429
+ return v + 'world'
2430
+
2431
+ schema = core_schema.no_info_plain_validator_function(function=fn)
2432
+ v = SchemaValidator(schema)
2433
+ assert v.validate_python('hello ') == 'hello world'
2434
+ ```
2435
+
2436
+ Args:
2437
+ function: The validator function to call
2438
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2439
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2440
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2441
+ serialization: Custom serialization schema
2442
+ """
2443
+ return _dict_not_none(
2444
+ type='function-plain',
2445
+ function={'type': 'no-info', 'function': function},
2446
+ ref=ref,
2447
+ json_schema_input_schema=json_schema_input_schema,
2448
+ metadata=metadata,
2449
+ serialization=serialization,
2450
+ )
2451
+
2452
+
2453
+ def with_info_plain_validator_function(
2454
+ function: WithInfoValidatorFunction,
2455
+ *,
2456
+ field_name: str | None = None,
2457
+ ref: str | None = None,
2458
+ json_schema_input_schema: CoreSchema | None = None,
2459
+ metadata: dict[str, Any] | None = None,
2460
+ serialization: SerSchema | None = None,
2461
+ ) -> PlainValidatorFunctionSchema:
2462
+ """
2463
+ Returns a schema that uses the provided function for validation, an `info` argument is passed, e.g.:
2464
+
2465
+ ```py
2466
+ from pydantic_core import SchemaValidator, core_schema
2467
+
2468
+ def fn(v: str, info: core_schema.ValidationInfo) -> str:
2469
+ assert 'hello' in v
2470
+ return v + 'world'
2471
+
2472
+ schema = core_schema.with_info_plain_validator_function(function=fn)
2473
+ v = SchemaValidator(schema)
2474
+ assert v.validate_python('hello ') == 'hello world'
2475
+ ```
2476
+
2477
+ Args:
2478
+ function: The validator function to call
2479
+ field_name: The name of the field this validator is applied to, if any (deprecated)
2480
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2481
+ json_schema_input_schema: The core schema to be used to generate the corresponding JSON Schema input type
2482
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2483
+ serialization: Custom serialization schema
2484
+ """
2485
+ if field_name is not None:
2486
+ warnings.warn(
2487
+ 'The `field_name` argument on `with_info_plain_validator_function` is deprecated, it will be passed to the function through `ValidationState` instead.',
2488
+ DeprecationWarning,
2489
+ stacklevel=2,
2490
+ )
2491
+
2492
+ return _dict_not_none(
2493
+ type='function-plain',
2494
+ function=_dict_not_none(type='with-info', function=function, field_name=field_name),
2495
+ ref=ref,
2496
+ json_schema_input_schema=json_schema_input_schema,
2497
+ metadata=metadata,
2498
+ serialization=serialization,
2499
+ )
2500
+
2501
+
2502
+ class WithDefaultSchema(TypedDict, total=False):
2503
+ type: Required[Literal['default']]
2504
+ schema: Required[CoreSchema]
2505
+ default: Any
2506
+ default_factory: Union[Callable[[], Any], Callable[[dict[str, Any]], Any]]
2507
+ default_factory_takes_data: bool
2508
+ on_error: Literal['raise', 'omit', 'default'] # default: 'raise'
2509
+ validate_default: bool # default: False
2510
+ strict: bool
2511
+ ref: str
2512
+ metadata: dict[str, Any]
2513
+ serialization: SerSchema
2514
+
2515
+
2516
+ def with_default_schema(
2517
+ schema: CoreSchema,
2518
+ *,
2519
+ default: Any = PydanticUndefined,
2520
+ default_factory: Union[Callable[[], Any], Callable[[dict[str, Any]], Any], None] = None,
2521
+ default_factory_takes_data: bool | None = None,
2522
+ on_error: Literal['raise', 'omit', 'default'] | None = None,
2523
+ validate_default: bool | None = None,
2524
+ strict: bool | None = None,
2525
+ ref: str | None = None,
2526
+ metadata: dict[str, Any] | None = None,
2527
+ serialization: SerSchema | None = None,
2528
+ ) -> WithDefaultSchema:
2529
+ """
2530
+ Returns a schema that adds a default value to the given schema, e.g.:
2531
+
2532
+ ```py
2533
+ from pydantic_core import SchemaValidator, core_schema
2534
+
2535
+ schema = core_schema.with_default_schema(core_schema.str_schema(), default='hello')
2536
+ wrapper_schema = core_schema.typed_dict_schema(
2537
+ {'a': core_schema.typed_dict_field(schema)}
2538
+ )
2539
+ v = SchemaValidator(wrapper_schema)
2540
+ assert v.validate_python({}) == v.validate_python({'a': 'hello'})
2541
+ ```
2542
+
2543
+ Args:
2544
+ schema: The schema to add a default value to
2545
+ default: The default value to use
2546
+ default_factory: A callable that returns the default value to use
2547
+ default_factory_takes_data: Whether the default factory takes a validated data argument
2548
+ on_error: What to do if the schema validation fails. One of 'raise', 'omit', 'default'
2549
+ validate_default: Whether the default value should be validated
2550
+ strict: Whether the underlying schema should be validated with strict mode
2551
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2552
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2553
+ serialization: Custom serialization schema
2554
+ """
2555
+ s = _dict_not_none(
2556
+ type='default',
2557
+ schema=schema,
2558
+ default_factory=default_factory,
2559
+ default_factory_takes_data=default_factory_takes_data,
2560
+ on_error=on_error,
2561
+ validate_default=validate_default,
2562
+ strict=strict,
2563
+ ref=ref,
2564
+ metadata=metadata,
2565
+ serialization=serialization,
2566
+ )
2567
+ if default is not PydanticUndefined:
2568
+ s['default'] = default
2569
+ return s
2570
+
2571
+
2572
+ class NullableSchema(TypedDict, total=False):
2573
+ type: Required[Literal['nullable']]
2574
+ schema: Required[CoreSchema]
2575
+ strict: bool
2576
+ ref: str
2577
+ metadata: dict[str, Any]
2578
+ serialization: SerSchema
2579
+
2580
+
2581
+ def nullable_schema(
2582
+ schema: CoreSchema,
2583
+ *,
2584
+ strict: bool | None = None,
2585
+ ref: str | None = None,
2586
+ metadata: dict[str, Any] | None = None,
2587
+ serialization: SerSchema | None = None,
2588
+ ) -> NullableSchema:
2589
+ """
2590
+ Returns a schema that matches a nullable value, e.g.:
2591
+
2592
+ ```py
2593
+ from pydantic_core import SchemaValidator, core_schema
2594
+
2595
+ schema = core_schema.nullable_schema(core_schema.str_schema())
2596
+ v = SchemaValidator(schema)
2597
+ assert v.validate_python(None) is None
2598
+ ```
2599
+
2600
+ Args:
2601
+ schema: The schema to wrap
2602
+ strict: Whether the underlying schema should be validated with strict mode
2603
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2604
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2605
+ serialization: Custom serialization schema
2606
+ """
2607
+ return _dict_not_none(
2608
+ type='nullable', schema=schema, strict=strict, ref=ref, metadata=metadata, serialization=serialization
2609
+ )
2610
+
2611
+
2612
+ class UnionSchema(TypedDict, total=False):
2613
+ type: Required[Literal['union']]
2614
+ choices: Required[list[Union[CoreSchema, tuple[CoreSchema, str]]]]
2615
+ # default true, whether to automatically collapse unions with one element to the inner validator
2616
+ auto_collapse: bool
2617
+ custom_error_type: str
2618
+ custom_error_message: str
2619
+ custom_error_context: dict[str, Union[str, int, float]]
2620
+ mode: Literal['smart', 'left_to_right'] # default: 'smart'
2621
+ strict: bool
2622
+ ref: str
2623
+ metadata: dict[str, Any]
2624
+ serialization: SerSchema
2625
+
2626
+
2627
+ def union_schema(
2628
+ choices: list[CoreSchema | tuple[CoreSchema, str]],
2629
+ *,
2630
+ auto_collapse: bool | None = None,
2631
+ custom_error_type: str | None = None,
2632
+ custom_error_message: str | None = None,
2633
+ custom_error_context: dict[str, str | int] | None = None,
2634
+ mode: Literal['smart', 'left_to_right'] | None = None,
2635
+ ref: str | None = None,
2636
+ metadata: dict[str, Any] | None = None,
2637
+ serialization: SerSchema | None = None,
2638
+ ) -> UnionSchema:
2639
+ """
2640
+ Returns a schema that matches a union value, e.g.:
2641
+
2642
+ ```py
2643
+ from pydantic_core import SchemaValidator, core_schema
2644
+
2645
+ schema = core_schema.union_schema([core_schema.str_schema(), core_schema.int_schema()])
2646
+ v = SchemaValidator(schema)
2647
+ assert v.validate_python('hello') == 'hello'
2648
+ assert v.validate_python(1) == 1
2649
+ ```
2650
+
2651
+ Args:
2652
+ choices: The schemas to match. If a tuple, the second item is used as the label for the case.
2653
+ auto_collapse: whether to automatically collapse unions with one element to the inner validator, default true
2654
+ custom_error_type: The custom error type to use if the validation fails
2655
+ custom_error_message: The custom error message to use if the validation fails
2656
+ custom_error_context: The custom error context to use if the validation fails
2657
+ mode: How to select which choice to return
2658
+ * `smart` (default) will try to return the choice which is the closest match to the input value
2659
+ * `left_to_right` will return the first choice in `choices` which succeeds validation
2660
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2661
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2662
+ serialization: Custom serialization schema
2663
+ """
2664
+ return _dict_not_none(
2665
+ type='union',
2666
+ choices=choices,
2667
+ auto_collapse=auto_collapse,
2668
+ custom_error_type=custom_error_type,
2669
+ custom_error_message=custom_error_message,
2670
+ custom_error_context=custom_error_context,
2671
+ mode=mode,
2672
+ ref=ref,
2673
+ metadata=metadata,
2674
+ serialization=serialization,
2675
+ )
2676
+
2677
+
2678
+ class TaggedUnionSchema(TypedDict, total=False):
2679
+ type: Required[Literal['tagged-union']]
2680
+ choices: Required[dict[Hashable, CoreSchema]]
2681
+ discriminator: Required[Union[str, list[Union[str, int]], list[list[Union[str, int]]], Callable[[Any], Hashable]]]
2682
+ custom_error_type: str
2683
+ custom_error_message: str
2684
+ custom_error_context: dict[str, Union[str, int, float]]
2685
+ strict: bool
2686
+ from_attributes: bool # default: True
2687
+ ref: str
2688
+ metadata: dict[str, Any]
2689
+ serialization: SerSchema
2690
+
2691
+
2692
+ def tagged_union_schema(
2693
+ choices: dict[Any, CoreSchema],
2694
+ discriminator: str | list[str | int] | list[list[str | int]] | Callable[[Any], Any],
2695
+ *,
2696
+ custom_error_type: str | None = None,
2697
+ custom_error_message: str | None = None,
2698
+ custom_error_context: dict[str, int | str | float] | None = None,
2699
+ strict: bool | None = None,
2700
+ from_attributes: bool | None = None,
2701
+ ref: str | None = None,
2702
+ metadata: dict[str, Any] | None = None,
2703
+ serialization: SerSchema | None = None,
2704
+ ) -> TaggedUnionSchema:
2705
+ """
2706
+ Returns a schema that matches a tagged union value, e.g.:
2707
+
2708
+ ```py
2709
+ from pydantic_core import SchemaValidator, core_schema
2710
+
2711
+ apple_schema = core_schema.typed_dict_schema(
2712
+ {
2713
+ 'foo': core_schema.typed_dict_field(core_schema.str_schema()),
2714
+ 'bar': core_schema.typed_dict_field(core_schema.int_schema()),
2715
+ }
2716
+ )
2717
+ banana_schema = core_schema.typed_dict_schema(
2718
+ {
2719
+ 'foo': core_schema.typed_dict_field(core_schema.str_schema()),
2720
+ 'spam': core_schema.typed_dict_field(
2721
+ core_schema.list_schema(items_schema=core_schema.int_schema())
2722
+ ),
2723
+ }
2724
+ )
2725
+ schema = core_schema.tagged_union_schema(
2726
+ choices={
2727
+ 'apple': apple_schema,
2728
+ 'banana': banana_schema,
2729
+ },
2730
+ discriminator='foo',
2731
+ )
2732
+ v = SchemaValidator(schema)
2733
+ assert v.validate_python({'foo': 'apple', 'bar': '123'}) == {'foo': 'apple', 'bar': 123}
2734
+ assert v.validate_python({'foo': 'banana', 'spam': [1, 2, 3]}) == {
2735
+ 'foo': 'banana',
2736
+ 'spam': [1, 2, 3],
2737
+ }
2738
+ ```
2739
+
2740
+ Args:
2741
+ choices: The schemas to match
2742
+ When retrieving a schema from `choices` using the discriminator value, if the value is a str,
2743
+ it should be fed back into the `choices` map until a schema is obtained
2744
+ (This approach is to prevent multiple ownership of a single schema in Rust)
2745
+ discriminator: The discriminator to use to determine the schema to use
2746
+ * If `discriminator` is a str, it is the name of the attribute to use as the discriminator
2747
+ * If `discriminator` is a list of int/str, it should be used as a "path" to access the discriminator
2748
+ * If `discriminator` is a list of lists, each inner list is a path, and the first path that exists is used
2749
+ * If `discriminator` is a callable, it should return the discriminator when called on the value to validate;
2750
+ the callable can return `None` to indicate that there is no matching discriminator present on the input
2751
+ custom_error_type: The custom error type to use if the validation fails
2752
+ custom_error_message: The custom error message to use if the validation fails
2753
+ custom_error_context: The custom error context to use if the validation fails
2754
+ strict: Whether the underlying schemas should be validated with strict mode
2755
+ from_attributes: Whether to use the attributes of the object to retrieve the discriminator value
2756
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2757
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2758
+ serialization: Custom serialization schema
2759
+ """
2760
+ return _dict_not_none(
2761
+ type='tagged-union',
2762
+ choices=choices,
2763
+ discriminator=discriminator,
2764
+ custom_error_type=custom_error_type,
2765
+ custom_error_message=custom_error_message,
2766
+ custom_error_context=custom_error_context,
2767
+ strict=strict,
2768
+ from_attributes=from_attributes,
2769
+ ref=ref,
2770
+ metadata=metadata,
2771
+ serialization=serialization,
2772
+ )
2773
+
2774
+
2775
+ class ChainSchema(TypedDict, total=False):
2776
+ type: Required[Literal['chain']]
2777
+ steps: Required[list[CoreSchema]]
2778
+ ref: str
2779
+ metadata: dict[str, Any]
2780
+ serialization: SerSchema
2781
+
2782
+
2783
+ def chain_schema(
2784
+ steps: list[CoreSchema],
2785
+ *,
2786
+ ref: str | None = None,
2787
+ metadata: dict[str, Any] | None = None,
2788
+ serialization: SerSchema | None = None,
2789
+ ) -> ChainSchema:
2790
+ """
2791
+ Returns a schema that chains the provided validation schemas, e.g.:
2792
+
2793
+ ```py
2794
+ from pydantic_core import SchemaValidator, core_schema
2795
+
2796
+ def fn(v: str, info: core_schema.ValidationInfo) -> str:
2797
+ assert 'hello' in v
2798
+ return v + ' world'
2799
+
2800
+ fn_schema = core_schema.with_info_plain_validator_function(function=fn)
2801
+ schema = core_schema.chain_schema(
2802
+ [fn_schema, fn_schema, fn_schema, core_schema.str_schema()]
2803
+ )
2804
+ v = SchemaValidator(schema)
2805
+ assert v.validate_python('hello') == 'hello world world world'
2806
+ ```
2807
+
2808
+ Args:
2809
+ steps: The schemas to chain
2810
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2811
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2812
+ serialization: Custom serialization schema
2813
+ """
2814
+ return _dict_not_none(type='chain', steps=steps, ref=ref, metadata=metadata, serialization=serialization)
2815
+
2816
+
2817
+ class LaxOrStrictSchema(TypedDict, total=False):
2818
+ type: Required[Literal['lax-or-strict']]
2819
+ lax_schema: Required[CoreSchema]
2820
+ strict_schema: Required[CoreSchema]
2821
+ strict: bool
2822
+ ref: str
2823
+ metadata: dict[str, Any]
2824
+ serialization: SerSchema
2825
+
2826
+
2827
+ def lax_or_strict_schema(
2828
+ lax_schema: CoreSchema,
2829
+ strict_schema: CoreSchema,
2830
+ *,
2831
+ strict: bool | None = None,
2832
+ ref: str | None = None,
2833
+ metadata: dict[str, Any] | None = None,
2834
+ serialization: SerSchema | None = None,
2835
+ ) -> LaxOrStrictSchema:
2836
+ """
2837
+ Returns a schema that uses the lax or strict schema, e.g.:
2838
+
2839
+ ```py
2840
+ from pydantic_core import SchemaValidator, core_schema
2841
+
2842
+ def fn(v: str, info: core_schema.ValidationInfo) -> str:
2843
+ assert 'hello' in v
2844
+ return v + ' world'
2845
+
2846
+ lax_schema = core_schema.int_schema(strict=False)
2847
+ strict_schema = core_schema.int_schema(strict=True)
2848
+
2849
+ schema = core_schema.lax_or_strict_schema(
2850
+ lax_schema=lax_schema, strict_schema=strict_schema, strict=True
2851
+ )
2852
+ v = SchemaValidator(schema)
2853
+ assert v.validate_python(123) == 123
2854
+
2855
+ schema = core_schema.lax_or_strict_schema(
2856
+ lax_schema=lax_schema, strict_schema=strict_schema, strict=False
2857
+ )
2858
+ v = SchemaValidator(schema)
2859
+ assert v.validate_python('123') == 123
2860
+ ```
2861
+
2862
+ Args:
2863
+ lax_schema: The lax schema to use
2864
+ strict_schema: The strict schema to use
2865
+ strict: Whether the strict schema should be used
2866
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2867
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2868
+ serialization: Custom serialization schema
2869
+ """
2870
+ return _dict_not_none(
2871
+ type='lax-or-strict',
2872
+ lax_schema=lax_schema,
2873
+ strict_schema=strict_schema,
2874
+ strict=strict,
2875
+ ref=ref,
2876
+ metadata=metadata,
2877
+ serialization=serialization,
2878
+ )
2879
+
2880
+
2881
+ class JsonOrPythonSchema(TypedDict, total=False):
2882
+ type: Required[Literal['json-or-python']]
2883
+ json_schema: Required[CoreSchema]
2884
+ python_schema: Required[CoreSchema]
2885
+ ref: str
2886
+ metadata: dict[str, Any]
2887
+ serialization: SerSchema
2888
+
2889
+
2890
+ def json_or_python_schema(
2891
+ json_schema: CoreSchema,
2892
+ python_schema: CoreSchema,
2893
+ *,
2894
+ ref: str | None = None,
2895
+ metadata: dict[str, Any] | None = None,
2896
+ serialization: SerSchema | None = None,
2897
+ ) -> JsonOrPythonSchema:
2898
+ """
2899
+ Returns a schema that uses the Json or Python schema depending on the input:
2900
+
2901
+ ```py
2902
+ from pydantic_core import SchemaValidator, ValidationError, core_schema
2903
+
2904
+ v = SchemaValidator(
2905
+ core_schema.json_or_python_schema(
2906
+ json_schema=core_schema.int_schema(),
2907
+ python_schema=core_schema.int_schema(strict=True),
2908
+ )
2909
+ )
2910
+
2911
+ assert v.validate_json('"123"') == 123
2912
+
2913
+ try:
2914
+ v.validate_python('123')
2915
+ except ValidationError:
2916
+ pass
2917
+ else:
2918
+ raise AssertionError('Validation should have failed')
2919
+ ```
2920
+
2921
+ Args:
2922
+ json_schema: The schema to use for Json inputs
2923
+ python_schema: The schema to use for Python inputs
2924
+ ref: optional unique identifier of the schema, used to reference the schema in other places
2925
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2926
+ serialization: Custom serialization schema
2927
+ """
2928
+ return _dict_not_none(
2929
+ type='json-or-python',
2930
+ json_schema=json_schema,
2931
+ python_schema=python_schema,
2932
+ ref=ref,
2933
+ metadata=metadata,
2934
+ serialization=serialization,
2935
+ )
2936
+
2937
+
2938
+ class TypedDictField(TypedDict, total=False):
2939
+ type: Required[Literal['typed-dict-field']]
2940
+ schema: Required[CoreSchema]
2941
+ required: bool
2942
+ validation_alias: Union[str, list[Union[str, int]], list[list[Union[str, int]]]]
2943
+ serialization_alias: str
2944
+ serialization_exclude: bool # default: False
2945
+ metadata: dict[str, Any]
2946
+ serialization_exclude_if: Callable[[Any], bool] # default None
2947
+
2948
+
2949
+ def typed_dict_field(
2950
+ schema: CoreSchema,
2951
+ *,
2952
+ required: bool | None = None,
2953
+ validation_alias: str | list[str | int] | list[list[str | int]] | None = None,
2954
+ serialization_alias: str | None = None,
2955
+ serialization_exclude: bool | None = None,
2956
+ metadata: dict[str, Any] | None = None,
2957
+ serialization_exclude_if: Callable[[Any], bool] | None = None,
2958
+ ) -> TypedDictField:
2959
+ """
2960
+ Returns a schema that matches a typed dict field, e.g.:
2961
+
2962
+ ```py
2963
+ from pydantic_core import core_schema
2964
+
2965
+ field = core_schema.typed_dict_field(schema=core_schema.int_schema(), required=True)
2966
+ ```
2967
+
2968
+ Args:
2969
+ schema: The schema to use for the field
2970
+ required: Whether the field is required, otherwise uses the value from `total` on the typed dict
2971
+ validation_alias: The alias(es) to use to find the field in the validation data
2972
+ serialization_alias: The alias to use as a key when serializing
2973
+ serialization_exclude: Whether to exclude the field when serializing
2974
+ serialization_exclude_if: A callable that determines whether to exclude the field when serializing based on its value.
2975
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
2976
+ """
2977
+ return _dict_not_none(
2978
+ type='typed-dict-field',
2979
+ schema=schema,
2980
+ required=required,
2981
+ validation_alias=validation_alias,
2982
+ serialization_alias=serialization_alias,
2983
+ serialization_exclude=serialization_exclude,
2984
+ serialization_exclude_if=serialization_exclude_if,
2985
+ metadata=metadata,
2986
+ )
2987
+
2988
+
2989
+ class TypedDictSchema(TypedDict, total=False):
2990
+ type: Required[Literal['typed-dict']]
2991
+ fields: Required[dict[str, TypedDictField]]
2992
+ cls: type[Any]
2993
+ cls_name: str
2994
+ computed_fields: list[ComputedField]
2995
+ strict: bool
2996
+ extras_schema: CoreSchema
2997
+ # all these values can be set via config, equivalent fields have `typed_dict_` prefix
2998
+ extra_behavior: ExtraBehavior
2999
+ total: bool # default: True
3000
+ ref: str
3001
+ metadata: dict[str, Any]
3002
+ serialization: SerSchema
3003
+ config: CoreConfig
3004
+
3005
+
3006
+ def typed_dict_schema(
3007
+ fields: dict[str, TypedDictField],
3008
+ *,
3009
+ cls: type[Any] | None = None,
3010
+ cls_name: str | None = None,
3011
+ computed_fields: list[ComputedField] | None = None,
3012
+ strict: bool | None = None,
3013
+ extras_schema: CoreSchema | None = None,
3014
+ extra_behavior: ExtraBehavior | None = None,
3015
+ total: bool | None = None,
3016
+ ref: str | None = None,
3017
+ metadata: dict[str, Any] | None = None,
3018
+ serialization: SerSchema | None = None,
3019
+ config: CoreConfig | None = None,
3020
+ ) -> TypedDictSchema:
3021
+ """
3022
+ Returns a schema that matches a typed dict, e.g.:
3023
+
3024
+ ```py
3025
+ from typing_extensions import TypedDict
3026
+
3027
+ from pydantic_core import SchemaValidator, core_schema
3028
+
3029
+ class MyTypedDict(TypedDict):
3030
+ a: str
3031
+
3032
+ wrapper_schema = core_schema.typed_dict_schema(
3033
+ {'a': core_schema.typed_dict_field(core_schema.str_schema())}, cls=MyTypedDict
3034
+ )
3035
+ v = SchemaValidator(wrapper_schema)
3036
+ assert v.validate_python({'a': 'hello'}) == {'a': 'hello'}
3037
+ ```
3038
+
3039
+ Args:
3040
+ fields: The fields to use for the typed dict
3041
+ cls: The class to use for the typed dict
3042
+ cls_name: The name to use in error locations. Falls back to `cls.__name__`, or the validator name if no class
3043
+ is provided.
3044
+ computed_fields: Computed fields to use when serializing the model, only applies when directly inside a model
3045
+ strict: Whether the typed dict is strict
3046
+ extras_schema: The extra validator to use for the typed dict
3047
+ ref: optional unique identifier of the schema, used to reference the schema in other places
3048
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
3049
+ extra_behavior: The extra behavior to use for the typed dict
3050
+ total: Whether the typed dict is total, otherwise uses `typed_dict_total` from config
3051
+ serialization: Custom serialization schema
3052
+ """
3053
+ return _dict_not_none(
3054
+ type='typed-dict',
3055
+ fields=fields,
3056
+ cls=cls,
3057
+ cls_name=cls_name,
3058
+ computed_fields=computed_fields,
3059
+ strict=strict,
3060
+ extras_schema=extras_schema,
3061
+ extra_behavior=extra_behavior,
3062
+ total=total,
3063
+ ref=ref,
3064
+ metadata=metadata,
3065
+ serialization=serialization,
3066
+ config=config,
3067
+ )
3068
+
3069
+
3070
+ class ModelField(TypedDict, total=False):
3071
+ type: Required[Literal['model-field']]
3072
+ schema: Required[CoreSchema]
3073
+ validation_alias: Union[str, list[Union[str, int]], list[list[Union[str, int]]]]
3074
+ serialization_alias: str
3075
+ serialization_exclude: bool # default: False
3076
+ serialization_exclude_if: Callable[[Any], bool] # default: None
3077
+ frozen: bool
3078
+ metadata: dict[str, Any]
3079
+
3080
+
3081
+ def model_field(
3082
+ schema: CoreSchema,
3083
+ *,
3084
+ validation_alias: str | list[str | int] | list[list[str | int]] | None = None,
3085
+ serialization_alias: str | None = None,
3086
+ serialization_exclude: bool | None = None,
3087
+ serialization_exclude_if: Callable[[Any], bool] | None = None,
3088
+ frozen: bool | None = None,
3089
+ metadata: dict[str, Any] | None = None,
3090
+ ) -> ModelField:
3091
+ """
3092
+ Returns a schema for a model field, e.g.:
3093
+
3094
+ ```py
3095
+ from pydantic_core import core_schema
3096
+
3097
+ field = core_schema.model_field(schema=core_schema.int_schema())
3098
+ ```
3099
+
3100
+ Args:
3101
+ schema: The schema to use for the field
3102
+ validation_alias: The alias(es) to use to find the field in the validation data
3103
+ serialization_alias: The alias to use as a key when serializing
3104
+ serialization_exclude: Whether to exclude the field when serializing
3105
+ serialization_exclude_if: A Callable that determines whether to exclude a field during serialization based on its value.
3106
+ frozen: Whether the field is frozen
3107
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
3108
+ """
3109
+ return _dict_not_none(
3110
+ type='model-field',
3111
+ schema=schema,
3112
+ validation_alias=validation_alias,
3113
+ serialization_alias=serialization_alias,
3114
+ serialization_exclude=serialization_exclude,
3115
+ serialization_exclude_if=serialization_exclude_if,
3116
+ frozen=frozen,
3117
+ metadata=metadata,
3118
+ )
3119
+
3120
+
3121
+ class ModelFieldsSchema(TypedDict, total=False):
3122
+ type: Required[Literal['model-fields']]
3123
+ fields: Required[dict[str, ModelField]]
3124
+ model_name: str
3125
+ computed_fields: list[ComputedField]
3126
+ strict: bool
3127
+ extras_schema: CoreSchema
3128
+ extras_keys_schema: CoreSchema
3129
+ extra_behavior: ExtraBehavior
3130
+ from_attributes: bool
3131
+ ref: str
3132
+ metadata: dict[str, Any]
3133
+ serialization: SerSchema
3134
+
3135
+
3136
+ def model_fields_schema(
3137
+ fields: dict[str, ModelField],
3138
+ *,
3139
+ model_name: str | None = None,
3140
+ computed_fields: list[ComputedField] | None = None,
3141
+ strict: bool | None = None,
3142
+ extras_schema: CoreSchema | None = None,
3143
+ extras_keys_schema: CoreSchema | None = None,
3144
+ extra_behavior: ExtraBehavior | None = None,
3145
+ from_attributes: bool | None = None,
3146
+ ref: str | None = None,
3147
+ metadata: dict[str, Any] | None = None,
3148
+ serialization: SerSchema | None = None,
3149
+ ) -> ModelFieldsSchema:
3150
+ """
3151
+ Returns a schema that matches the fields of a Pydantic model, e.g.:
3152
+
3153
+ ```py
3154
+ from pydantic_core import SchemaValidator, core_schema
3155
+
3156
+ wrapper_schema = core_schema.model_fields_schema(
3157
+ {'a': core_schema.model_field(core_schema.str_schema())}
3158
+ )
3159
+ v = SchemaValidator(wrapper_schema)
3160
+ print(v.validate_python({'a': 'hello'}))
3161
+ #> ({'a': 'hello'}, None, {'a'})
3162
+ ```
3163
+
3164
+ Args:
3165
+ fields: The fields of the model
3166
+ model_name: The name of the model, used for error messages, defaults to "Model"
3167
+ computed_fields: Computed fields to use when serializing the model, only applies when directly inside a model
3168
+ strict: Whether the model is strict
3169
+ extras_schema: The schema to use when validating extra input data
3170
+ extras_keys_schema: The schema to use when validating the keys of extra input data
3171
+ ref: optional unique identifier of the schema, used to reference the schema in other places
3172
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
3173
+ extra_behavior: The extra behavior to use for the model fields
3174
+ from_attributes: Whether the model fields should be populated from attributes
3175
+ serialization: Custom serialization schema
3176
+ """
3177
+ return _dict_not_none(
3178
+ type='model-fields',
3179
+ fields=fields,
3180
+ model_name=model_name,
3181
+ computed_fields=computed_fields,
3182
+ strict=strict,
3183
+ extras_schema=extras_schema,
3184
+ extras_keys_schema=extras_keys_schema,
3185
+ extra_behavior=extra_behavior,
3186
+ from_attributes=from_attributes,
3187
+ ref=ref,
3188
+ metadata=metadata,
3189
+ serialization=serialization,
3190
+ )
3191
+
3192
+
3193
+ class ModelSchema(TypedDict, total=False):
3194
+ type: Required[Literal['model']]
3195
+ cls: Required[type[Any]]
3196
+ generic_origin: type[Any]
3197
+ schema: Required[CoreSchema]
3198
+ custom_init: bool
3199
+ root_model: bool
3200
+ post_init: str
3201
+ revalidate_instances: Literal['always', 'never', 'subclass-instances'] # default: 'never'
3202
+ strict: bool
3203
+ frozen: bool
3204
+ extra_behavior: ExtraBehavior
3205
+ config: CoreConfig
3206
+ ref: str
3207
+ metadata: dict[str, Any]
3208
+ serialization: SerSchema
3209
+
3210
+
3211
+ def model_schema(
3212
+ cls: type[Any],
3213
+ schema: CoreSchema,
3214
+ *,
3215
+ generic_origin: type[Any] | None = None,
3216
+ custom_init: bool | None = None,
3217
+ root_model: bool | None = None,
3218
+ post_init: str | None = None,
3219
+ revalidate_instances: Literal['always', 'never', 'subclass-instances'] | None = None,
3220
+ strict: bool | None = None,
3221
+ frozen: bool | None = None,
3222
+ extra_behavior: ExtraBehavior | None = None,
3223
+ config: CoreConfig | None = None,
3224
+ ref: str | None = None,
3225
+ metadata: dict[str, Any] | None = None,
3226
+ serialization: SerSchema | None = None,
3227
+ ) -> ModelSchema:
3228
+ """
3229
+ A model schema generally contains a typed-dict schema.
3230
+ It will run the typed dict validator, then create a new class
3231
+ and set the dict and fields set returned from the typed dict validator
3232
+ to `__dict__` and `__pydantic_fields_set__` respectively.
3233
+
3234
+ Example:
3235
+
3236
+ ```py
3237
+ from pydantic_core import CoreConfig, SchemaValidator, core_schema
3238
+
3239
+ class MyModel:
3240
+ __slots__ = (
3241
+ '__dict__',
3242
+ '__pydantic_fields_set__',
3243
+ '__pydantic_extra__',
3244
+ '__pydantic_private__',
3245
+ )
3246
+
3247
+ schema = core_schema.model_schema(
3248
+ cls=MyModel,
3249
+ config=CoreConfig(str_max_length=5),
3250
+ schema=core_schema.model_fields_schema(
3251
+ fields={'a': core_schema.model_field(core_schema.str_schema())},
3252
+ ),
3253
+ )
3254
+ v = SchemaValidator(schema)
3255
+ assert v.isinstance_python({'a': 'hello'}) is True
3256
+ assert v.isinstance_python({'a': 'too long'}) is False
3257
+ ```
3258
+
3259
+ Args:
3260
+ cls: The class to use for the model
3261
+ schema: The schema to use for the model
3262
+ generic_origin: The origin type used for this model, if it's a parametrized generic. Ex,
3263
+ if this model schema represents `SomeModel[int]`, generic_origin is `SomeModel`
3264
+ custom_init: Whether the model has a custom init method
3265
+ root_model: Whether the model is a `RootModel`
3266
+ post_init: The call after init to use for the model
3267
+ revalidate_instances: whether instances of models and dataclasses (including subclass instances)
3268
+ should re-validate defaults to config.revalidate_instances, else 'never'
3269
+ strict: Whether the model is strict
3270
+ frozen: Whether the model is frozen
3271
+ extra_behavior: The extra behavior to use for the model, used in serialization
3272
+ config: The config to use for the model
3273
+ ref: optional unique identifier of the schema, used to reference the schema in other places
3274
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
3275
+ serialization: Custom serialization schema
3276
+ """
3277
+ return _dict_not_none(
3278
+ type='model',
3279
+ cls=cls,
3280
+ generic_origin=generic_origin,
3281
+ schema=schema,
3282
+ custom_init=custom_init,
3283
+ root_model=root_model,
3284
+ post_init=post_init,
3285
+ revalidate_instances=revalidate_instances,
3286
+ strict=strict,
3287
+ frozen=frozen,
3288
+ extra_behavior=extra_behavior,
3289
+ config=config,
3290
+ ref=ref,
3291
+ metadata=metadata,
3292
+ serialization=serialization,
3293
+ )
3294
+
3295
+
3296
+ class DataclassField(TypedDict, total=False):
3297
+ type: Required[Literal['dataclass-field']]
3298
+ name: Required[str]
3299
+ schema: Required[CoreSchema]
3300
+ kw_only: bool # default: True
3301
+ init: bool # default: True
3302
+ init_only: bool # default: False
3303
+ frozen: bool # default: False
3304
+ validation_alias: Union[str, list[Union[str, int]], list[list[Union[str, int]]]]
3305
+ serialization_alias: str
3306
+ serialization_exclude: bool # default: False
3307
+ metadata: dict[str, Any]
3308
+ serialization_exclude_if: Callable[[Any], bool] # default: None
3309
+
3310
+
3311
+ def dataclass_field(
3312
+ name: str,
3313
+ schema: CoreSchema,
3314
+ *,
3315
+ kw_only: bool | None = None,
3316
+ init: bool | None = None,
3317
+ init_only: bool | None = None,
3318
+ validation_alias: str | list[str | int] | list[list[str | int]] | None = None,
3319
+ serialization_alias: str | None = None,
3320
+ serialization_exclude: bool | None = None,
3321
+ metadata: dict[str, Any] | None = None,
3322
+ serialization_exclude_if: Callable[[Any], bool] | None = None,
3323
+ frozen: bool | None = None,
3324
+ ) -> DataclassField:
3325
+ """
3326
+ Returns a schema for a dataclass field, e.g.:
3327
+
3328
+ ```py
3329
+ from pydantic_core import SchemaValidator, core_schema
3330
+
3331
+ field = core_schema.dataclass_field(
3332
+ name='a', schema=core_schema.str_schema(), kw_only=False
3333
+ )
3334
+ schema = core_schema.dataclass_args_schema('Foobar', [field])
3335
+ v = SchemaValidator(schema)
3336
+ assert v.validate_python({'a': 'hello'}) == ({'a': 'hello'}, None)
3337
+ ```
3338
+
3339
+ Args:
3340
+ name: The name to use for the argument parameter
3341
+ schema: The schema to use for the argument parameter
3342
+ kw_only: Whether the field can be set with a positional argument as well as a keyword argument
3343
+ init: Whether the field should be validated during initialization
3344
+ init_only: Whether the field should be omitted from `__dict__` and passed to `__post_init__`
3345
+ validation_alias: The alias(es) to use to find the field in the validation data
3346
+ serialization_alias: The alias to use as a key when serializing
3347
+ serialization_exclude: Whether to exclude the field when serializing
3348
+ serialization_exclude_if: A callable that determines whether to exclude the field when serializing based on its value.
3349
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
3350
+ frozen: Whether the field is frozen
3351
+ """
3352
+ return _dict_not_none(
3353
+ type='dataclass-field',
3354
+ name=name,
3355
+ schema=schema,
3356
+ kw_only=kw_only,
3357
+ init=init,
3358
+ init_only=init_only,
3359
+ validation_alias=validation_alias,
3360
+ serialization_alias=serialization_alias,
3361
+ serialization_exclude=serialization_exclude,
3362
+ serialization_exclude_if=serialization_exclude_if,
3363
+ metadata=metadata,
3364
+ frozen=frozen,
3365
+ )
3366
+
3367
+
3368
+ class DataclassArgsSchema(TypedDict, total=False):
3369
+ type: Required[Literal['dataclass-args']]
3370
+ dataclass_name: Required[str]
3371
+ fields: Required[list[DataclassField]]
3372
+ computed_fields: list[ComputedField]
3373
+ collect_init_only: bool # default: False
3374
+ ref: str
3375
+ metadata: dict[str, Any]
3376
+ serialization: SerSchema
3377
+ extra_behavior: ExtraBehavior
3378
+
3379
+
3380
+ def dataclass_args_schema(
3381
+ dataclass_name: str,
3382
+ fields: list[DataclassField],
3383
+ *,
3384
+ computed_fields: list[ComputedField] | None = None,
3385
+ collect_init_only: bool | None = None,
3386
+ ref: str | None = None,
3387
+ metadata: dict[str, Any] | None = None,
3388
+ serialization: SerSchema | None = None,
3389
+ extra_behavior: ExtraBehavior | None = None,
3390
+ ) -> DataclassArgsSchema:
3391
+ """
3392
+ Returns a schema for validating dataclass arguments, e.g.:
3393
+
3394
+ ```py
3395
+ from pydantic_core import SchemaValidator, core_schema
3396
+
3397
+ field_a = core_schema.dataclass_field(
3398
+ name='a', schema=core_schema.str_schema(), kw_only=False
3399
+ )
3400
+ field_b = core_schema.dataclass_field(
3401
+ name='b', schema=core_schema.bool_schema(), kw_only=False
3402
+ )
3403
+ schema = core_schema.dataclass_args_schema('Foobar', [field_a, field_b])
3404
+ v = SchemaValidator(schema)
3405
+ assert v.validate_python({'a': 'hello', 'b': True}) == ({'a': 'hello', 'b': True}, None)
3406
+ ```
3407
+
3408
+ Args:
3409
+ dataclass_name: The name of the dataclass being validated
3410
+ fields: The fields to use for the dataclass
3411
+ computed_fields: Computed fields to use when serializing the dataclass
3412
+ collect_init_only: Whether to collect init only fields into a dict to pass to `__post_init__`
3413
+ ref: optional unique identifier of the schema, used to reference the schema in other places
3414
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
3415
+ serialization: Custom serialization schema
3416
+ extra_behavior: How to handle extra fields
3417
+ """
3418
+ return _dict_not_none(
3419
+ type='dataclass-args',
3420
+ dataclass_name=dataclass_name,
3421
+ fields=fields,
3422
+ computed_fields=computed_fields,
3423
+ collect_init_only=collect_init_only,
3424
+ ref=ref,
3425
+ metadata=metadata,
3426
+ serialization=serialization,
3427
+ extra_behavior=extra_behavior,
3428
+ )
3429
+
3430
+
3431
+ class DataclassSchema(TypedDict, total=False):
3432
+ type: Required[Literal['dataclass']]
3433
+ cls: Required[type[Any]]
3434
+ generic_origin: type[Any]
3435
+ schema: Required[CoreSchema]
3436
+ fields: Required[list[str]]
3437
+ cls_name: str
3438
+ post_init: bool # default: False
3439
+ revalidate_instances: Literal['always', 'never', 'subclass-instances'] # default: 'never'
3440
+ strict: bool # default: False
3441
+ frozen: bool # default False
3442
+ ref: str
3443
+ metadata: dict[str, Any]
3444
+ serialization: SerSchema
3445
+ slots: bool
3446
+ config: CoreConfig
3447
+
3448
+
3449
+ def dataclass_schema(
3450
+ cls: type[Any],
3451
+ schema: CoreSchema,
3452
+ fields: list[str],
3453
+ *,
3454
+ generic_origin: type[Any] | None = None,
3455
+ cls_name: str | None = None,
3456
+ post_init: bool | None = None,
3457
+ revalidate_instances: Literal['always', 'never', 'subclass-instances'] | None = None,
3458
+ strict: bool | None = None,
3459
+ ref: str | None = None,
3460
+ metadata: dict[str, Any] | None = None,
3461
+ serialization: SerSchema | None = None,
3462
+ frozen: bool | None = None,
3463
+ slots: bool | None = None,
3464
+ config: CoreConfig | None = None,
3465
+ ) -> DataclassSchema:
3466
+ """
3467
+ Returns a schema for a dataclass. As with `ModelSchema`, this schema can only be used as a field within
3468
+ another schema, not as the root type.
3469
+
3470
+ Args:
3471
+ cls: The dataclass type, used to perform subclass checks
3472
+ schema: The schema to use for the dataclass fields
3473
+ fields: Fields of the dataclass, this is used in serialization and in validation during re-validation
3474
+ and while validating assignment
3475
+ generic_origin: The origin type used for this dataclass, if it's a parametrized generic. Ex,
3476
+ if this model schema represents `SomeDataclass[int]`, generic_origin is `SomeDataclass`
3477
+ cls_name: The name to use in error locs, etc; this is useful for generics (default: `cls.__name__`)
3478
+ post_init: Whether to call `__post_init__` after validation
3479
+ revalidate_instances: whether instances of models and dataclasses (including subclass instances)
3480
+ should re-validate defaults to config.revalidate_instances, else 'never'
3481
+ strict: Whether to require an exact instance of `cls`
3482
+ ref: optional unique identifier of the schema, used to reference the schema in other places
3483
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
3484
+ serialization: Custom serialization schema
3485
+ frozen: Whether the dataclass is frozen
3486
+ slots: Whether `slots=True` on the dataclass, means each field is assigned independently, rather than
3487
+ simply setting `__dict__`, default false
3488
+ """
3489
+ return _dict_not_none(
3490
+ type='dataclass',
3491
+ cls=cls,
3492
+ generic_origin=generic_origin,
3493
+ fields=fields,
3494
+ cls_name=cls_name,
3495
+ schema=schema,
3496
+ post_init=post_init,
3497
+ revalidate_instances=revalidate_instances,
3498
+ strict=strict,
3499
+ ref=ref,
3500
+ metadata=metadata,
3501
+ serialization=serialization,
3502
+ frozen=frozen,
3503
+ slots=slots,
3504
+ config=config,
3505
+ )
3506
+
3507
+
3508
+ class ArgumentsParameter(TypedDict, total=False):
3509
+ name: Required[str]
3510
+ schema: Required[CoreSchema]
3511
+ mode: Literal['positional_only', 'positional_or_keyword', 'keyword_only'] # default positional_or_keyword
3512
+ alias: Union[str, list[Union[str, int]], list[list[Union[str, int]]]]
3513
+
3514
+
3515
+ def arguments_parameter(
3516
+ name: str,
3517
+ schema: CoreSchema,
3518
+ *,
3519
+ mode: Literal['positional_only', 'positional_or_keyword', 'keyword_only'] | None = None,
3520
+ alias: str | list[str | int] | list[list[str | int]] | None = None,
3521
+ ) -> ArgumentsParameter:
3522
+ """
3523
+ Returns a schema that matches an argument parameter, e.g.:
3524
+
3525
+ ```py
3526
+ from pydantic_core import SchemaValidator, core_schema
3527
+
3528
+ param = core_schema.arguments_parameter(
3529
+ name='a', schema=core_schema.str_schema(), mode='positional_only'
3530
+ )
3531
+ schema = core_schema.arguments_schema([param])
3532
+ v = SchemaValidator(schema)
3533
+ assert v.validate_python(('hello',)) == (('hello',), {})
3534
+ ```
3535
+
3536
+ Args:
3537
+ name: The name to use for the argument parameter
3538
+ schema: The schema to use for the argument parameter
3539
+ mode: The mode to use for the argument parameter
3540
+ alias: The alias to use for the argument parameter
3541
+ """
3542
+ return _dict_not_none(name=name, schema=schema, mode=mode, alias=alias)
3543
+
3544
+
3545
+ VarKwargsMode: TypeAlias = Literal['uniform', 'unpacked-typed-dict']
3546
+
3547
+
3548
+ class ArgumentsSchema(TypedDict, total=False):
3549
+ type: Required[Literal['arguments']]
3550
+ arguments_schema: Required[list[ArgumentsParameter]]
3551
+ validate_by_name: bool
3552
+ validate_by_alias: bool
3553
+ var_args_schema: CoreSchema
3554
+ var_kwargs_mode: VarKwargsMode
3555
+ var_kwargs_schema: CoreSchema
3556
+ ref: str
3557
+ metadata: dict[str, Any]
3558
+ serialization: SerSchema
3559
+
3560
+
3561
+ def arguments_schema(
3562
+ arguments: list[ArgumentsParameter],
3563
+ *,
3564
+ validate_by_name: bool | None = None,
3565
+ validate_by_alias: bool | None = None,
3566
+ var_args_schema: CoreSchema | None = None,
3567
+ var_kwargs_mode: VarKwargsMode | None = None,
3568
+ var_kwargs_schema: CoreSchema | None = None,
3569
+ ref: str | None = None,
3570
+ metadata: dict[str, Any] | None = None,
3571
+ serialization: SerSchema | None = None,
3572
+ ) -> ArgumentsSchema:
3573
+ """
3574
+ Returns a schema that matches an arguments schema, e.g.:
3575
+
3576
+ ```py
3577
+ from pydantic_core import SchemaValidator, core_schema
3578
+
3579
+ param_a = core_schema.arguments_parameter(
3580
+ name='a', schema=core_schema.str_schema(), mode='positional_only'
3581
+ )
3582
+ param_b = core_schema.arguments_parameter(
3583
+ name='b', schema=core_schema.bool_schema(), mode='positional_only'
3584
+ )
3585
+ schema = core_schema.arguments_schema([param_a, param_b])
3586
+ v = SchemaValidator(schema)
3587
+ assert v.validate_python(('hello', True)) == (('hello', True), {})
3588
+ ```
3589
+
3590
+ Args:
3591
+ arguments: The arguments to use for the arguments schema
3592
+ validate_by_name: Whether to populate by the parameter names, defaults to `False`.
3593
+ validate_by_alias: Whether to populate by the parameter aliases, defaults to `True`.
3594
+ var_args_schema: The variable args schema to use for the arguments schema
3595
+ var_kwargs_mode: The validation mode to use for variadic keyword arguments. If `'uniform'`, every value of the
3596
+ keyword arguments will be validated against the `var_kwargs_schema` schema. If `'unpacked-typed-dict'`,
3597
+ the `var_kwargs_schema` argument must be a [`typed_dict_schema`][pydantic_core.core_schema.typed_dict_schema]
3598
+ var_kwargs_schema: The variable kwargs schema to use for the arguments schema
3599
+ ref: optional unique identifier of the schema, used to reference the schema in other places
3600
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
3601
+ serialization: Custom serialization schema
3602
+ """
3603
+ return _dict_not_none(
3604
+ type='arguments',
3605
+ arguments_schema=arguments,
3606
+ validate_by_name=validate_by_name,
3607
+ validate_by_alias=validate_by_alias,
3608
+ var_args_schema=var_args_schema,
3609
+ var_kwargs_mode=var_kwargs_mode,
3610
+ var_kwargs_schema=var_kwargs_schema,
3611
+ ref=ref,
3612
+ metadata=metadata,
3613
+ serialization=serialization,
3614
+ )
3615
+
3616
+
3617
+ class ArgumentsV3Parameter(TypedDict, total=False):
3618
+ name: Required[str]
3619
+ schema: Required[CoreSchema]
3620
+ mode: Literal[
3621
+ 'positional_only',
3622
+ 'positional_or_keyword',
3623
+ 'keyword_only',
3624
+ 'var_args',
3625
+ 'var_kwargs_uniform',
3626
+ 'var_kwargs_unpacked_typed_dict',
3627
+ ] # default positional_or_keyword
3628
+ alias: Union[str, list[Union[str, int]], list[list[Union[str, int]]]]
3629
+
3630
+
3631
+ def arguments_v3_parameter(
3632
+ name: str,
3633
+ schema: CoreSchema,
3634
+ *,
3635
+ mode: Literal[
3636
+ 'positional_only',
3637
+ 'positional_or_keyword',
3638
+ 'keyword_only',
3639
+ 'var_args',
3640
+ 'var_kwargs_uniform',
3641
+ 'var_kwargs_unpacked_typed_dict',
3642
+ ]
3643
+ | None = None,
3644
+ alias: str | list[str | int] | list[list[str | int]] | None = None,
3645
+ ) -> ArgumentsV3Parameter:
3646
+ """
3647
+ Returns a schema that matches an argument parameter, e.g.:
3648
+
3649
+ ```py
3650
+ from pydantic_core import SchemaValidator, core_schema
3651
+
3652
+ param = core_schema.arguments_v3_parameter(
3653
+ name='a', schema=core_schema.str_schema(), mode='positional_only'
3654
+ )
3655
+ schema = core_schema.arguments_v3_schema([param])
3656
+ v = SchemaValidator(schema)
3657
+ assert v.validate_python({'a': 'hello'}) == (('hello',), {})
3658
+ ```
3659
+
3660
+ Args:
3661
+ name: The name to use for the argument parameter
3662
+ schema: The schema to use for the argument parameter
3663
+ mode: The mode to use for the argument parameter
3664
+ alias: The alias to use for the argument parameter
3665
+ """
3666
+ return _dict_not_none(name=name, schema=schema, mode=mode, alias=alias)
3667
+
3668
+
3669
+ class ArgumentsV3Schema(TypedDict, total=False):
3670
+ type: Required[Literal['arguments-v3']]
3671
+ arguments_schema: Required[list[ArgumentsV3Parameter]]
3672
+ validate_by_name: bool
3673
+ validate_by_alias: bool
3674
+ extra_behavior: Literal['forbid', 'ignore'] # 'allow' doesn't make sense here.
3675
+ ref: str
3676
+ metadata: dict[str, Any]
3677
+ serialization: SerSchema
3678
+
3679
+
3680
+ def arguments_v3_schema(
3681
+ arguments: list[ArgumentsV3Parameter],
3682
+ *,
3683
+ validate_by_name: bool | None = None,
3684
+ validate_by_alias: bool | None = None,
3685
+ extra_behavior: Literal['forbid', 'ignore'] | None = None,
3686
+ ref: str | None = None,
3687
+ metadata: dict[str, Any] | None = None,
3688
+ serialization: SerSchema | None = None,
3689
+ ) -> ArgumentsV3Schema:
3690
+ """
3691
+ Returns a schema that matches an arguments schema, e.g.:
3692
+
3693
+ ```py
3694
+ from pydantic_core import SchemaValidator, core_schema
3695
+
3696
+ param_a = core_schema.arguments_v3_parameter(
3697
+ name='a', schema=core_schema.str_schema(), mode='positional_only'
3698
+ )
3699
+ param_b = core_schema.arguments_v3_parameter(
3700
+ name='kwargs', schema=core_schema.bool_schema(), mode='var_kwargs_uniform'
3701
+ )
3702
+ schema = core_schema.arguments_v3_schema([param_a, param_b])
3703
+ v = SchemaValidator(schema)
3704
+ assert v.validate_python({'a': 'hi', 'kwargs': {'b': True}}) == (('hi',), {'b': True})
3705
+ ```
3706
+
3707
+ This schema is currently not used by other Pydantic components. In V3, it will most likely
3708
+ become the default arguments schema for the `'call'` schema.
3709
+
3710
+ Args:
3711
+ arguments: The arguments to use for the arguments schema.
3712
+ validate_by_name: Whether to populate by the parameter names, defaults to `False`.
3713
+ validate_by_alias: Whether to populate by the parameter aliases, defaults to `True`.
3714
+ extra_behavior: The extra behavior to use.
3715
+ ref: optional unique identifier of the schema, used to reference the schema in other places.
3716
+ metadata: Any other information you want to include with the schema, not used by pydantic-core.
3717
+ serialization: Custom serialization schema.
3718
+ """
3719
+ return _dict_not_none(
3720
+ type='arguments-v3',
3721
+ arguments_schema=arguments,
3722
+ validate_by_name=validate_by_name,
3723
+ validate_by_alias=validate_by_alias,
3724
+ extra_behavior=extra_behavior,
3725
+ ref=ref,
3726
+ metadata=metadata,
3727
+ serialization=serialization,
3728
+ )
3729
+
3730
+
3731
+ class CallSchema(TypedDict, total=False):
3732
+ type: Required[Literal['call']]
3733
+ arguments_schema: Required[CoreSchema]
3734
+ function: Required[Callable[..., Any]]
3735
+ function_name: str # default function.__name__
3736
+ return_schema: CoreSchema
3737
+ ref: str
3738
+ metadata: dict[str, Any]
3739
+ serialization: SerSchema
3740
+
3741
+
3742
+ def call_schema(
3743
+ arguments: CoreSchema,
3744
+ function: Callable[..., Any],
3745
+ *,
3746
+ function_name: str | None = None,
3747
+ return_schema: CoreSchema | None = None,
3748
+ ref: str | None = None,
3749
+ metadata: dict[str, Any] | None = None,
3750
+ serialization: SerSchema | None = None,
3751
+ ) -> CallSchema:
3752
+ """
3753
+ Returns a schema that matches an arguments schema, then calls a function, e.g.:
3754
+
3755
+ ```py
3756
+ from pydantic_core import SchemaValidator, core_schema
3757
+
3758
+ param_a = core_schema.arguments_parameter(
3759
+ name='a', schema=core_schema.str_schema(), mode='positional_only'
3760
+ )
3761
+ param_b = core_schema.arguments_parameter(
3762
+ name='b', schema=core_schema.bool_schema(), mode='positional_only'
3763
+ )
3764
+ args_schema = core_schema.arguments_schema([param_a, param_b])
3765
+
3766
+ schema = core_schema.call_schema(
3767
+ arguments=args_schema,
3768
+ function=lambda a, b: a + str(not b),
3769
+ return_schema=core_schema.str_schema(),
3770
+ )
3771
+ v = SchemaValidator(schema)
3772
+ assert v.validate_python((('hello', True))) == 'helloFalse'
3773
+ ```
3774
+
3775
+ Args:
3776
+ arguments: The arguments to use for the arguments schema
3777
+ function: The function to use for the call schema
3778
+ function_name: The function name to use for the call schema, if not provided `function.__name__` is used
3779
+ return_schema: The return schema to use for the call schema
3780
+ ref: optional unique identifier of the schema, used to reference the schema in other places
3781
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
3782
+ serialization: Custom serialization schema
3783
+ """
3784
+ return _dict_not_none(
3785
+ type='call',
3786
+ arguments_schema=arguments,
3787
+ function=function,
3788
+ function_name=function_name,
3789
+ return_schema=return_schema,
3790
+ ref=ref,
3791
+ metadata=metadata,
3792
+ serialization=serialization,
3793
+ )
3794
+
3795
+
3796
+ class CustomErrorSchema(TypedDict, total=False):
3797
+ type: Required[Literal['custom-error']]
3798
+ schema: Required[CoreSchema]
3799
+ custom_error_type: Required[str]
3800
+ custom_error_message: str
3801
+ custom_error_context: dict[str, Union[str, int, float]]
3802
+ ref: str
3803
+ metadata: dict[str, Any]
3804
+ serialization: SerSchema
3805
+
3806
+
3807
+ def custom_error_schema(
3808
+ schema: CoreSchema,
3809
+ custom_error_type: str,
3810
+ *,
3811
+ custom_error_message: str | None = None,
3812
+ custom_error_context: dict[str, Any] | None = None,
3813
+ ref: str | None = None,
3814
+ metadata: dict[str, Any] | None = None,
3815
+ serialization: SerSchema | None = None,
3816
+ ) -> CustomErrorSchema:
3817
+ """
3818
+ Returns a schema that matches a custom error value, e.g.:
3819
+
3820
+ ```py
3821
+ from pydantic_core import SchemaValidator, core_schema
3822
+
3823
+ schema = core_schema.custom_error_schema(
3824
+ schema=core_schema.int_schema(),
3825
+ custom_error_type='MyError',
3826
+ custom_error_message='Error msg',
3827
+ )
3828
+ v = SchemaValidator(schema)
3829
+ v.validate_python(1)
3830
+ ```
3831
+
3832
+ Args:
3833
+ schema: The schema to use for the custom error schema
3834
+ custom_error_type: The custom error type to use for the custom error schema
3835
+ custom_error_message: The custom error message to use for the custom error schema
3836
+ custom_error_context: The custom error context to use for the custom error schema
3837
+ ref: optional unique identifier of the schema, used to reference the schema in other places
3838
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
3839
+ serialization: Custom serialization schema
3840
+ """
3841
+ return _dict_not_none(
3842
+ type='custom-error',
3843
+ schema=schema,
3844
+ custom_error_type=custom_error_type,
3845
+ custom_error_message=custom_error_message,
3846
+ custom_error_context=custom_error_context,
3847
+ ref=ref,
3848
+ metadata=metadata,
3849
+ serialization=serialization,
3850
+ )
3851
+
3852
+
3853
+ class JsonSchema(TypedDict, total=False):
3854
+ type: Required[Literal['json']]
3855
+ schema: CoreSchema
3856
+ ref: str
3857
+ metadata: dict[str, Any]
3858
+ serialization: SerSchema
3859
+
3860
+
3861
+ def json_schema(
3862
+ schema: CoreSchema | None = None,
3863
+ *,
3864
+ ref: str | None = None,
3865
+ metadata: dict[str, Any] | None = None,
3866
+ serialization: SerSchema | None = None,
3867
+ ) -> JsonSchema:
3868
+ """
3869
+ Returns a schema that matches a JSON value, e.g.:
3870
+
3871
+ ```py
3872
+ from pydantic_core import SchemaValidator, core_schema
3873
+
3874
+ dict_schema = core_schema.model_fields_schema(
3875
+ {
3876
+ 'field_a': core_schema.model_field(core_schema.str_schema()),
3877
+ 'field_b': core_schema.model_field(core_schema.bool_schema()),
3878
+ },
3879
+ )
3880
+
3881
+ class MyModel:
3882
+ __slots__ = (
3883
+ '__dict__',
3884
+ '__pydantic_fields_set__',
3885
+ '__pydantic_extra__',
3886
+ '__pydantic_private__',
3887
+ )
3888
+ field_a: str
3889
+ field_b: bool
3890
+
3891
+ json_schema = core_schema.json_schema(schema=dict_schema)
3892
+ schema = core_schema.model_schema(cls=MyModel, schema=json_schema)
3893
+ v = SchemaValidator(schema)
3894
+ m = v.validate_python('{"field_a": "hello", "field_b": true}')
3895
+ assert isinstance(m, MyModel)
3896
+ ```
3897
+
3898
+ Args:
3899
+ schema: The schema to use for the JSON schema
3900
+ ref: optional unique identifier of the schema, used to reference the schema in other places
3901
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
3902
+ serialization: Custom serialization schema
3903
+ """
3904
+ return _dict_not_none(type='json', schema=schema, ref=ref, metadata=metadata, serialization=serialization)
3905
+
3906
+
3907
+ class UrlSchema(TypedDict, total=False):
3908
+ type: Required[Literal['url']]
3909
+ max_length: int
3910
+ allowed_schemes: list[str]
3911
+ host_required: bool # default False
3912
+ default_host: str
3913
+ default_port: int
3914
+ default_path: str
3915
+ strict: bool
3916
+ ref: str
3917
+ metadata: dict[str, Any]
3918
+ serialization: SerSchema
3919
+
3920
+
3921
+ def url_schema(
3922
+ *,
3923
+ max_length: int | None = None,
3924
+ allowed_schemes: list[str] | None = None,
3925
+ host_required: bool | None = None,
3926
+ default_host: str | None = None,
3927
+ default_port: int | None = None,
3928
+ default_path: str | None = None,
3929
+ preserve_empty_path: bool | None = None,
3930
+ strict: bool | None = None,
3931
+ ref: str | None = None,
3932
+ metadata: dict[str, Any] | None = None,
3933
+ serialization: SerSchema | None = None,
3934
+ ) -> UrlSchema:
3935
+ """
3936
+ Returns a schema that matches a URL value, e.g.:
3937
+
3938
+ ```py
3939
+ from pydantic_core import SchemaValidator, core_schema
3940
+
3941
+ schema = core_schema.url_schema()
3942
+ v = SchemaValidator(schema)
3943
+ print(v.validate_python('https://example.com'))
3944
+ #> https://example.com/
3945
+ ```
3946
+
3947
+ Args:
3948
+ max_length: The maximum length of the URL
3949
+ allowed_schemes: The allowed URL schemes
3950
+ host_required: Whether the URL must have a host
3951
+ default_host: The default host to use if the URL does not have a host
3952
+ default_port: The default port to use if the URL does not have a port
3953
+ default_path: The default path to use if the URL does not have a path
3954
+ preserve_empty_path: Whether to preserve an empty path or convert it to '/', default False
3955
+ strict: Whether to use strict URL parsing
3956
+ ref: optional unique identifier of the schema, used to reference the schema in other places
3957
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
3958
+ serialization: Custom serialization schema
3959
+ """
3960
+ return _dict_not_none(
3961
+ type='url',
3962
+ max_length=max_length,
3963
+ allowed_schemes=allowed_schemes,
3964
+ host_required=host_required,
3965
+ default_host=default_host,
3966
+ default_port=default_port,
3967
+ default_path=default_path,
3968
+ preserve_empty_path=preserve_empty_path,
3969
+ strict=strict,
3970
+ ref=ref,
3971
+ metadata=metadata,
3972
+ serialization=serialization,
3973
+ )
3974
+
3975
+
3976
+ class MultiHostUrlSchema(TypedDict, total=False):
3977
+ type: Required[Literal['multi-host-url']]
3978
+ max_length: int
3979
+ allowed_schemes: list[str]
3980
+ host_required: bool # default False
3981
+ default_host: str
3982
+ default_port: int
3983
+ default_path: str
3984
+ strict: bool
3985
+ ref: str
3986
+ metadata: dict[str, Any]
3987
+ serialization: SerSchema
3988
+
3989
+
3990
+ def multi_host_url_schema(
3991
+ *,
3992
+ max_length: int | None = None,
3993
+ allowed_schemes: list[str] | None = None,
3994
+ host_required: bool | None = None,
3995
+ default_host: str | None = None,
3996
+ default_port: int | None = None,
3997
+ default_path: str | None = None,
3998
+ preserve_empty_path: bool | None = None,
3999
+ strict: bool | None = None,
4000
+ ref: str | None = None,
4001
+ metadata: dict[str, Any] | None = None,
4002
+ serialization: SerSchema | None = None,
4003
+ ) -> MultiHostUrlSchema:
4004
+ """
4005
+ Returns a schema that matches a URL value with possibly multiple hosts, e.g.:
4006
+
4007
+ ```py
4008
+ from pydantic_core import SchemaValidator, core_schema
4009
+
4010
+ schema = core_schema.multi_host_url_schema()
4011
+ v = SchemaValidator(schema)
4012
+ print(v.validate_python('redis://localhost,0.0.0.0,127.0.0.1'))
4013
+ #> redis://localhost,0.0.0.0,127.0.0.1
4014
+ ```
4015
+
4016
+ Args:
4017
+ max_length: The maximum length of the URL
4018
+ allowed_schemes: The allowed URL schemes
4019
+ host_required: Whether the URL must have a host
4020
+ default_host: The default host to use if the URL does not have a host
4021
+ default_port: The default port to use if the URL does not have a port
4022
+ default_path: The default path to use if the URL does not have a path
4023
+ preserve_empty_path: Whether to preserve an empty path or convert it to '/', default False
4024
+ strict: Whether to use strict URL parsing
4025
+ ref: optional unique identifier of the schema, used to reference the schema in other places
4026
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
4027
+ serialization: Custom serialization schema
4028
+ """
4029
+ return _dict_not_none(
4030
+ type='multi-host-url',
4031
+ max_length=max_length,
4032
+ allowed_schemes=allowed_schemes,
4033
+ host_required=host_required,
4034
+ default_host=default_host,
4035
+ default_port=default_port,
4036
+ default_path=default_path,
4037
+ preserve_empty_path=preserve_empty_path,
4038
+ strict=strict,
4039
+ ref=ref,
4040
+ metadata=metadata,
4041
+ serialization=serialization,
4042
+ )
4043
+
4044
+
4045
+ class DefinitionsSchema(TypedDict, total=False):
4046
+ type: Required[Literal['definitions']]
4047
+ schema: Required[CoreSchema]
4048
+ definitions: Required[list[CoreSchema]]
4049
+ metadata: dict[str, Any]
4050
+ serialization: SerSchema
4051
+
4052
+
4053
+ def definitions_schema(schema: CoreSchema, definitions: list[CoreSchema]) -> DefinitionsSchema:
4054
+ """
4055
+ Build a schema that contains both an inner schema and a list of definitions which can be used
4056
+ within the inner schema.
4057
+
4058
+ ```py
4059
+ from pydantic_core import SchemaValidator, core_schema
4060
+
4061
+ schema = core_schema.definitions_schema(
4062
+ core_schema.list_schema(core_schema.definition_reference_schema('foobar')),
4063
+ [core_schema.int_schema(ref='foobar')],
4064
+ )
4065
+ v = SchemaValidator(schema)
4066
+ assert v.validate_python([1, 2, '3']) == [1, 2, 3]
4067
+ ```
4068
+
4069
+ Args:
4070
+ schema: The inner schema
4071
+ definitions: List of definitions which can be referenced within inner schema
4072
+ """
4073
+ return DefinitionsSchema(type='definitions', schema=schema, definitions=definitions)
4074
+
4075
+
4076
+ class DefinitionReferenceSchema(TypedDict, total=False):
4077
+ type: Required[Literal['definition-ref']]
4078
+ schema_ref: Required[str]
4079
+ ref: str
4080
+ metadata: dict[str, Any]
4081
+ serialization: SerSchema
4082
+
4083
+
4084
+ def definition_reference_schema(
4085
+ schema_ref: str,
4086
+ ref: str | None = None,
4087
+ metadata: dict[str, Any] | None = None,
4088
+ serialization: SerSchema | None = None,
4089
+ ) -> DefinitionReferenceSchema:
4090
+ """
4091
+ Returns a schema that points to a schema stored in "definitions", this is useful for nested recursive
4092
+ models and also when you want to define validators separately from the main schema, e.g.:
4093
+
4094
+ ```py
4095
+ from pydantic_core import SchemaValidator, core_schema
4096
+
4097
+ schema_definition = core_schema.definition_reference_schema('list-schema')
4098
+ schema = core_schema.definitions_schema(
4099
+ schema=schema_definition,
4100
+ definitions=[
4101
+ core_schema.list_schema(items_schema=schema_definition, ref='list-schema'),
4102
+ ],
4103
+ )
4104
+ v = SchemaValidator(schema)
4105
+ assert v.validate_python([()]) == [[]]
4106
+ ```
4107
+
4108
+ Args:
4109
+ schema_ref: The schema ref to use for the definition reference schema
4110
+ metadata: Any other information you want to include with the schema, not used by pydantic-core
4111
+ serialization: Custom serialization schema
4112
+ """
4113
+ return _dict_not_none(
4114
+ type='definition-ref', schema_ref=schema_ref, ref=ref, metadata=metadata, serialization=serialization
4115
+ )
4116
+
4117
+
4118
+ MYPY = False
4119
+ # See https://github.com/python/mypy/issues/14034 for details, in summary mypy is extremely slow to process this
4120
+ # union which kills performance not just for pydantic, but even for code using pydantic
4121
+ if not MYPY:
4122
+ CoreSchema = Union[
4123
+ InvalidSchema,
4124
+ AnySchema,
4125
+ NoneSchema,
4126
+ BoolSchema,
4127
+ IntSchema,
4128
+ FloatSchema,
4129
+ DecimalSchema,
4130
+ StringSchema,
4131
+ BytesSchema,
4132
+ DateSchema,
4133
+ TimeSchema,
4134
+ DatetimeSchema,
4135
+ TimedeltaSchema,
4136
+ LiteralSchema,
4137
+ MissingSentinelSchema,
4138
+ EnumSchema,
4139
+ IsInstanceSchema,
4140
+ IsSubclassSchema,
4141
+ CallableSchema,
4142
+ ListSchema,
4143
+ TupleSchema,
4144
+ SetSchema,
4145
+ FrozenSetSchema,
4146
+ GeneratorSchema,
4147
+ DictSchema,
4148
+ AfterValidatorFunctionSchema,
4149
+ BeforeValidatorFunctionSchema,
4150
+ WrapValidatorFunctionSchema,
4151
+ PlainValidatorFunctionSchema,
4152
+ WithDefaultSchema,
4153
+ NullableSchema,
4154
+ UnionSchema,
4155
+ TaggedUnionSchema,
4156
+ ChainSchema,
4157
+ LaxOrStrictSchema,
4158
+ JsonOrPythonSchema,
4159
+ TypedDictSchema,
4160
+ ModelFieldsSchema,
4161
+ ModelSchema,
4162
+ DataclassArgsSchema,
4163
+ DataclassSchema,
4164
+ ArgumentsSchema,
4165
+ ArgumentsV3Schema,
4166
+ CallSchema,
4167
+ CustomErrorSchema,
4168
+ JsonSchema,
4169
+ UrlSchema,
4170
+ MultiHostUrlSchema,
4171
+ DefinitionsSchema,
4172
+ DefinitionReferenceSchema,
4173
+ UuidSchema,
4174
+ ComplexSchema,
4175
+ ]
4176
+ elif False:
4177
+ CoreSchema: TypeAlias = Mapping[str, Any]
4178
+
4179
+
4180
+ # to update this, call `pytest -k test_core_schema_type_literal` and copy the output
4181
+ CoreSchemaType = Literal[
4182
+ 'invalid',
4183
+ 'any',
4184
+ 'none',
4185
+ 'bool',
4186
+ 'int',
4187
+ 'float',
4188
+ 'decimal',
4189
+ 'str',
4190
+ 'bytes',
4191
+ 'date',
4192
+ 'time',
4193
+ 'datetime',
4194
+ 'timedelta',
4195
+ 'literal',
4196
+ 'missing-sentinel',
4197
+ 'enum',
4198
+ 'is-instance',
4199
+ 'is-subclass',
4200
+ 'callable',
4201
+ 'list',
4202
+ 'tuple',
4203
+ 'set',
4204
+ 'frozenset',
4205
+ 'generator',
4206
+ 'dict',
4207
+ 'function-after',
4208
+ 'function-before',
4209
+ 'function-wrap',
4210
+ 'function-plain',
4211
+ 'default',
4212
+ 'nullable',
4213
+ 'union',
4214
+ 'tagged-union',
4215
+ 'chain',
4216
+ 'lax-or-strict',
4217
+ 'json-or-python',
4218
+ 'typed-dict',
4219
+ 'model-fields',
4220
+ 'model',
4221
+ 'dataclass-args',
4222
+ 'dataclass',
4223
+ 'arguments',
4224
+ 'arguments-v3',
4225
+ 'call',
4226
+ 'custom-error',
4227
+ 'json',
4228
+ 'url',
4229
+ 'multi-host-url',
4230
+ 'definitions',
4231
+ 'definition-ref',
4232
+ 'uuid',
4233
+ 'complex',
4234
+ ]
4235
+
4236
+ CoreSchemaFieldType = Literal['model-field', 'dataclass-field', 'typed-dict-field', 'computed-field']
4237
+
4238
+
4239
+ # used in _pydantic_core.pyi::PydanticKnownError
4240
+ # to update this, call `pytest -k test_all_errors` and copy the output
4241
+ ErrorType = Literal[
4242
+ 'no_such_attribute',
4243
+ 'json_invalid',
4244
+ 'json_type',
4245
+ 'needs_python_object',
4246
+ 'recursion_loop',
4247
+ 'missing',
4248
+ 'frozen_field',
4249
+ 'frozen_instance',
4250
+ 'extra_forbidden',
4251
+ 'invalid_key',
4252
+ 'get_attribute_error',
4253
+ 'model_type',
4254
+ 'model_attributes_type',
4255
+ 'dataclass_type',
4256
+ 'dataclass_exact_type',
4257
+ 'default_factory_not_called',
4258
+ 'none_required',
4259
+ 'greater_than',
4260
+ 'greater_than_equal',
4261
+ 'less_than',
4262
+ 'less_than_equal',
4263
+ 'multiple_of',
4264
+ 'finite_number',
4265
+ 'too_short',
4266
+ 'too_long',
4267
+ 'iterable_type',
4268
+ 'iteration_error',
4269
+ 'string_type',
4270
+ 'string_sub_type',
4271
+ 'string_unicode',
4272
+ 'string_too_short',
4273
+ 'string_too_long',
4274
+ 'string_pattern_mismatch',
4275
+ 'string_not_ascii',
4276
+ 'enum',
4277
+ 'dict_type',
4278
+ 'mapping_type',
4279
+ 'list_type',
4280
+ 'tuple_type',
4281
+ 'set_type',
4282
+ 'set_item_not_hashable',
4283
+ 'bool_type',
4284
+ 'bool_parsing',
4285
+ 'int_type',
4286
+ 'int_parsing',
4287
+ 'int_parsing_size',
4288
+ 'int_from_float',
4289
+ 'float_type',
4290
+ 'float_parsing',
4291
+ 'bytes_type',
4292
+ 'bytes_too_short',
4293
+ 'bytes_too_long',
4294
+ 'bytes_invalid_encoding',
4295
+ 'value_error',
4296
+ 'assertion_error',
4297
+ 'literal_error',
4298
+ 'missing_sentinel_error',
4299
+ 'date_type',
4300
+ 'date_parsing',
4301
+ 'date_from_datetime_parsing',
4302
+ 'date_from_datetime_inexact',
4303
+ 'date_past',
4304
+ 'date_future',
4305
+ 'time_type',
4306
+ 'time_parsing',
4307
+ 'datetime_type',
4308
+ 'datetime_parsing',
4309
+ 'datetime_object_invalid',
4310
+ 'datetime_from_date_parsing',
4311
+ 'datetime_past',
4312
+ 'datetime_future',
4313
+ 'timezone_naive',
4314
+ 'timezone_aware',
4315
+ 'timezone_offset',
4316
+ 'time_delta_type',
4317
+ 'time_delta_parsing',
4318
+ 'frozen_set_type',
4319
+ 'is_instance_of',
4320
+ 'is_subclass_of',
4321
+ 'callable_type',
4322
+ 'union_tag_invalid',
4323
+ 'union_tag_not_found',
4324
+ 'arguments_type',
4325
+ 'missing_argument',
4326
+ 'unexpected_keyword_argument',
4327
+ 'missing_keyword_only_argument',
4328
+ 'unexpected_positional_argument',
4329
+ 'missing_positional_only_argument',
4330
+ 'multiple_argument_values',
4331
+ 'url_type',
4332
+ 'url_parsing',
4333
+ 'url_syntax_violation',
4334
+ 'url_too_long',
4335
+ 'url_scheme',
4336
+ 'uuid_type',
4337
+ 'uuid_parsing',
4338
+ 'uuid_version',
4339
+ 'decimal_type',
4340
+ 'decimal_parsing',
4341
+ 'decimal_max_digits',
4342
+ 'decimal_max_places',
4343
+ 'decimal_whole_digits',
4344
+ 'complex_type',
4345
+ 'complex_str_parsing',
4346
+ ]
4347
+
4348
+
4349
+ def _dict_not_none(**kwargs: Any) -> Any:
4350
+ return {k: v for k, v in kwargs.items() if v is not None}
4351
+
4352
+
4353
+ def iter_union_choices(union_schema: UnionSchema) -> Generator[CoreSchema]:
4354
+ """Iterate over the choices of a `'union'` schema."""
4355
+ for choice in union_schema['choices']:
4356
+ if isinstance(choice, tuple):
4357
+ yield choice[0]
4358
+ else:
4359
+ yield choice
4360
+
4361
+
4362
+ ###############################################################################
4363
+ # All this stuff is deprecated by #980 and will be removed eventually
4364
+ # They're kept because some code external code will be using them
4365
+
4366
+
4367
+ @deprecated('`field_before_validator_function` is deprecated, use `with_info_before_validator_function` instead.')
4368
+ def field_before_validator_function(function: WithInfoValidatorFunction, field_name: str, schema: CoreSchema, **kwargs):
4369
+ warnings.warn(
4370
+ '`field_before_validator_function` is deprecated, use `with_info_before_validator_function` instead.',
4371
+ DeprecationWarning,
4372
+ )
4373
+ return with_info_before_validator_function(function, schema, field_name=field_name, **kwargs)
4374
+
4375
+
4376
+ @deprecated('`general_before_validator_function` is deprecated, use `with_info_before_validator_function` instead.')
4377
+ def general_before_validator_function(*args, **kwargs):
4378
+ warnings.warn(
4379
+ '`general_before_validator_function` is deprecated, use `with_info_before_validator_function` instead.',
4380
+ DeprecationWarning,
4381
+ )
4382
+ return with_info_before_validator_function(*args, **kwargs)
4383
+
4384
+
4385
+ @deprecated('`field_after_validator_function` is deprecated, use `with_info_after_validator_function` instead.')
4386
+ def field_after_validator_function(function: WithInfoValidatorFunction, field_name: str, schema: CoreSchema, **kwargs):
4387
+ warnings.warn(
4388
+ '`field_after_validator_function` is deprecated, use `with_info_after_validator_function` instead.',
4389
+ DeprecationWarning,
4390
+ )
4391
+ return with_info_after_validator_function(function, schema, field_name=field_name, **kwargs)
4392
+
4393
+
4394
+ @deprecated('`general_after_validator_function` is deprecated, use `with_info_after_validator_function` instead.')
4395
+ def general_after_validator_function(*args, **kwargs):
4396
+ warnings.warn(
4397
+ '`general_after_validator_function` is deprecated, use `with_info_after_validator_function` instead.',
4398
+ DeprecationWarning,
4399
+ )
4400
+ return with_info_after_validator_function(*args, **kwargs)
4401
+
4402
+
4403
+ @deprecated('`field_wrap_validator_function` is deprecated, use `with_info_wrap_validator_function` instead.')
4404
+ def field_wrap_validator_function(
4405
+ function: WithInfoWrapValidatorFunction, field_name: str, schema: CoreSchema, **kwargs
4406
+ ):
4407
+ warnings.warn(
4408
+ '`field_wrap_validator_function` is deprecated, use `with_info_wrap_validator_function` instead.',
4409
+ DeprecationWarning,
4410
+ )
4411
+ return with_info_wrap_validator_function(function, schema, field_name=field_name, **kwargs)
4412
+
4413
+
4414
+ @deprecated('`general_wrap_validator_function` is deprecated, use `with_info_wrap_validator_function` instead.')
4415
+ def general_wrap_validator_function(*args, **kwargs):
4416
+ warnings.warn(
4417
+ '`general_wrap_validator_function` is deprecated, use `with_info_wrap_validator_function` instead.',
4418
+ DeprecationWarning,
4419
+ )
4420
+ return with_info_wrap_validator_function(*args, **kwargs)
4421
+
4422
+
4423
+ @deprecated('`field_plain_validator_function` is deprecated, use `with_info_plain_validator_function` instead.')
4424
+ def field_plain_validator_function(function: WithInfoValidatorFunction, field_name: str, **kwargs):
4425
+ warnings.warn(
4426
+ '`field_plain_validator_function` is deprecated, use `with_info_plain_validator_function` instead.',
4427
+ DeprecationWarning,
4428
+ )
4429
+ return with_info_plain_validator_function(function, field_name=field_name, **kwargs)
4430
+
4431
+
4432
+ @deprecated('`general_plain_validator_function` is deprecated, use `with_info_plain_validator_function` instead.')
4433
+ def general_plain_validator_function(*args, **kwargs):
4434
+ warnings.warn(
4435
+ '`general_plain_validator_function` is deprecated, use `with_info_plain_validator_function` instead.',
4436
+ DeprecationWarning,
4437
+ )
4438
+ return with_info_plain_validator_function(*args, **kwargs)
4439
+
4440
+
4441
+ _deprecated_import_lookup = {
4442
+ 'FieldValidationInfo': ValidationInfo,
4443
+ 'FieldValidatorFunction': WithInfoValidatorFunction,
4444
+ 'GeneralValidatorFunction': WithInfoValidatorFunction,
4445
+ 'FieldWrapValidatorFunction': WithInfoWrapValidatorFunction,
4446
+ }
4447
+
4448
+ if TYPE_CHECKING:
4449
+ FieldValidationInfo = ValidationInfo
4450
+
4451
+
4452
+ def __getattr__(attr_name: str) -> object:
4453
+ new_attr = _deprecated_import_lookup.get(attr_name)
4454
+ if new_attr is None:
4455
+ raise AttributeError(f"module 'pydantic_core' has no attribute '{attr_name}'")
4456
+ else:
4457
+ import warnings
4458
+
4459
+ msg = f'`{attr_name}` is deprecated, use `{new_attr.__name__}` instead.'
4460
+ warnings.warn(msg, DeprecationWarning, stacklevel=1)
4461
+ return new_attr