crate 0.35.2__tar.gz → 1.0.0.dev0__tar.gz

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 (202) hide show
  1. {crate-0.35.2 → crate-1.0.0.dev0}/DEVELOP.rst +0 -2
  2. {crate-0.35.2 → crate-1.0.0.dev0}/PKG-INFO +29 -15
  3. {crate-0.35.2 → crate-1.0.0.dev0}/README.rst +8 -10
  4. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/appendices/data-types.rst.txt +158 -0
  5. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/appendices/index.rst.txt +14 -0
  6. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/backlog.rst.txt +6 -0
  7. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/blobs.rst.txt +162 -0
  8. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/blob.rst.txt +100 -0
  9. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/client.rst.txt +321 -0
  10. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/connection.rst.txt +68 -0
  11. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/cursor.rst.txt +443 -0
  12. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/http.rst.txt +246 -0
  13. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/https.rst.txt +127 -0
  14. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/index.rst.txt +27 -0
  15. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/sqlalchemy/advanced-querying.rst.txt +335 -0
  16. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/sqlalchemy/crud.rst.txt +301 -0
  17. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/sqlalchemy/dataframe.rst.txt +258 -0
  18. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/sqlalchemy/getting-started.rst.txt +176 -0
  19. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/sqlalchemy/inspection-reflection.rst.txt +126 -0
  20. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/by-example/sqlalchemy/working-with-types.rst.txt +265 -0
  21. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/connect.rst.txt +286 -0
  22. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/data-types.rst.txt +110 -0
  23. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/getting-started.rst.txt +75 -0
  24. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/index-all.rst.txt +22 -0
  25. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/index.rst.txt +177 -0
  26. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/other-options.rst.txt +55 -0
  27. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/query.rst.txt +303 -0
  28. crate-1.0.0.dev0/docs/.crate-docs/.build/_sources/sqlalchemy.rst.txt +17 -0
  29. crate-1.0.0.dev0/docs/.crate-docs/.build/_static/bundle/main.js.LICENSE.txt +70 -0
  30. crate-1.0.0.dev0/docs/.crate-docs/.build/output.txt +17 -0
  31. crate-1.0.0.dev0/docs/.crate-docs/.build/robots.txt +4 -0
  32. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/Babel-2.11.0.dist-info/entry_points.txt +20 -0
  33. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/Babel-2.11.0.dist-info/top_level.txt +1 -0
  34. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/Jinja2-3.0.3.dist-info/entry_points.txt +3 -0
  35. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/Jinja2-3.0.3.dist-info/top_level.txt +1 -0
  36. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/MarkupSafe-2.1.1.dist-info/top_level.txt +1 -0
  37. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/Pygments-2.13.0.dist-info/entry_points.txt +2 -0
  38. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/Pygments-2.13.0.dist-info/top_level.txt +1 -0
  39. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/alabaster-0.7.12.dist-info/LICENSE.txt +34 -0
  40. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/alabaster-0.7.12.dist-info/entry_points.txt +3 -0
  41. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/alabaster-0.7.12.dist-info/top_level.txt +1 -0
  42. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/certifi-2022.12.7.dist-info/top_level.txt +1 -0
  43. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/charset_normalizer-2.1.1.dist-info/entry_points.txt +2 -0
  44. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/charset_normalizer-2.1.1.dist-info/top_level.txt +1 -0
  45. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/colorama-0.4.6.dist-info/licenses/LICENSE.txt +27 -0
  46. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/crate/theme/rtd/crate/static/bundle/main.js.LICENSE.txt +70 -0
  47. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/README.txt +17 -0
  48. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isoamsa.txt +162 -0
  49. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isoamsb.txt +126 -0
  50. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isoamsc.txt +29 -0
  51. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isoamsn.txt +96 -0
  52. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isoamso.txt +62 -0
  53. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isoamsr.txt +191 -0
  54. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isobox.txt +46 -0
  55. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isocyr1.txt +73 -0
  56. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isocyr2.txt +32 -0
  57. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isodia.txt +20 -0
  58. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isogrk1.txt +55 -0
  59. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isogrk2.txt +26 -0
  60. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isogrk3.txt +52 -0
  61. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isogrk4-wide.txt +49 -0
  62. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isogrk4.txt +8 -0
  63. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isolat1.txt +68 -0
  64. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isolat2.txt +128 -0
  65. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isomfrk-wide.txt +58 -0
  66. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isomfrk.txt +11 -0
  67. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isomopf-wide.txt +32 -0
  68. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isomopf.txt +13 -0
  69. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isomscr-wide.txt +58 -0
  70. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isomscr.txt +17 -0
  71. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isonum.txt +82 -0
  72. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isopub.txt +90 -0
  73. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/isotech.txt +168 -0
  74. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/mmlalias.txt +554 -0
  75. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/mmlextra-wide.txt +113 -0
  76. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/mmlextra.txt +87 -0
  77. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/s5defs.txt +68 -0
  78. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/xhtml1-lat1.txt +102 -0
  79. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/xhtml1-special.txt +37 -0
  80. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/parsers/rst/include/xhtml1-symbol.txt +130 -0
  81. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/writers/html4css1/template.txt +8 -0
  82. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/writers/html5_polyglot/template.txt +8 -0
  83. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/writers/pep_html/template.txt +29 -0
  84. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils/writers/s5_html/themes/README.txt +6 -0
  85. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils-0.16.dist-info/COPYING.txt +137 -0
  86. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/docutils-0.16.dist-info/top_level.txt +1 -0
  87. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/imagesize-1.4.1.dist-info/top_level.txt +1 -0
  88. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/importlib_metadata-5.2.0.dist-info/top_level.txt +1 -0
  89. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/livereload-2.6.3.dist-info/entry_points.txt +2 -0
  90. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/livereload-2.6.3.dist-info/top_level.txt +1 -0
  91. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/pip/_vendor/vendor.txt +23 -0
  92. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/pip-22.3.1.dist-info/LICENSE.txt +20 -0
  93. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/pip-22.3.1.dist-info/entry_points.txt +4 -0
  94. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/pip-22.3.1.dist-info/top_level.txt +1 -0
  95. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/pipdeptree-2.3.3.dist-info/entry_points.txt +2 -0
  96. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/pytz-2022.7.dist-info/LICENSE.txt +19 -0
  97. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/pytz-2022.7.dist-info/top_level.txt +1 -0
  98. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/requests-2.28.1.dist-info/top_level.txt +1 -0
  99. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/setuptools-58.1.0.dist-info/entry_points.txt +56 -0
  100. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/setuptools-58.1.0.dist-info/top_level.txt +3 -0
  101. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/six-1.16.0.dist-info/top_level.txt +1 -0
  102. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/snowballstemmer-2.2.0.dist-info/top_level.txt +1 -0
  103. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinx-5.3.0.dist-info/entry_points.txt +9 -0
  104. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinx_autobuild-2021.3.14.dist-info/entry_points.txt +3 -0
  105. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinx_copybutton-0.5.1.dist-info/top_level.txt +1 -0
  106. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinx_sitemap-2.4.0.dist-info/top_level.txt +1 -0
  107. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_applehelp-1.0.2.dist-info/namespace_packages.txt +1 -0
  108. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_applehelp-1.0.2.dist-info/top_level.txt +1 -0
  109. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_devhelp-1.0.2.dist-info/namespace_packages.txt +1 -0
  110. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_devhelp-1.0.2.dist-info/top_level.txt +1 -0
  111. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_htmlhelp-2.0.0.dist-info/namespace_packages.txt +1 -0
  112. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_htmlhelp-2.0.0.dist-info/top_level.txt +1 -0
  113. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_jsmath-1.0.1.dist-info/namespace_packages.txt +1 -0
  114. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_jsmath-1.0.1.dist-info/top_level.txt +1 -0
  115. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_plantuml-0.24.1-py3.9.egg-info/SOURCES.txt +14 -0
  116. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_plantuml-0.24.1-py3.9.egg-info/installed-files.txt +10 -0
  117. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_plantuml-0.24.1-py3.9.egg-info/namespace_packages.txt +1 -0
  118. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_plantuml-0.24.1-py3.9.egg-info/requires.txt +6 -0
  119. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_plantuml-0.24.1-py3.9.egg-info/top_level.txt +1 -0
  120. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_qthelp-1.0.3.dist-info/namespace_packages.txt +1 -0
  121. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_qthelp-1.0.3.dist-info/top_level.txt +1 -0
  122. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_serializinghtml-1.1.5.dist-info/namespace_packages.txt +1 -0
  123. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_serializinghtml-1.1.5.dist-info/top_level.txt +1 -0
  124. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxext_opengraph-0.7.4.dist-info/top_level.txt +1 -0
  125. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/tornado/test/static/robots.txt +2 -0
  126. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/tornado/test/static_foo.txt +2 -0
  127. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/tornado-6.2.dist-info/top_level.txt +1 -0
  128. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/urllib3-1.26.13.dist-info/LICENSE.txt +21 -0
  129. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/urllib3-1.26.13.dist-info/top_level.txt +1 -0
  130. crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/zipp-3.11.0.dist-info/top_level.txt +1 -0
  131. crate-1.0.0.dev0/docs/.crate-docs/common-build/requirements.txt +10 -0
  132. crate-1.0.0.dev0/docs/.crate-docs/docs/_extra/robots.txt +2 -0
  133. crate-1.0.0.dev0/docs/.crate-docs/docs/requirements.txt +2 -0
  134. crate-1.0.0.dev0/docs/.crate-docs/helpers/preview/etc/requirements.txt +3 -0
  135. crate-1.0.0.dev0/docs/_extra/robots.txt +4 -0
  136. {crate-0.35.2 → crate-1.0.0.dev0}/setup.py +6 -12
  137. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/__init__.py +1 -1
  138. crate-1.0.0.dev0/src/crate/testing/test_datetime_old.py +90 -0
  139. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate.egg-info/PKG-INFO +29 -15
  140. crate-1.0.0.dev0/src/crate.egg-info/SOURCES.txt +171 -0
  141. crate-1.0.0.dev0/src/crate.egg-info/dependency_links.txt +1 -0
  142. crate-1.0.0.dev0/src/crate.egg-info/namespace_packages.txt +1 -0
  143. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate.egg-info/requires.txt +7 -10
  144. crate-1.0.0.dev0/src/crate.egg-info/top_level.txt +1 -0
  145. crate-0.35.2/docs/_extra/robots.txt +0 -4
  146. crate-0.35.2/src/crate/client/sqlalchemy/__init__.py +0 -50
  147. crate-0.35.2/src/crate/client/sqlalchemy/compat/__init__.py +0 -0
  148. crate-0.35.2/src/crate/client/sqlalchemy/compat/api13.py +0 -156
  149. crate-0.35.2/src/crate/client/sqlalchemy/compat/core10.py +0 -264
  150. crate-0.35.2/src/crate/client/sqlalchemy/compat/core14.py +0 -359
  151. crate-0.35.2/src/crate/client/sqlalchemy/compat/core20.py +0 -447
  152. crate-0.35.2/src/crate/client/sqlalchemy/compiler.py +0 -318
  153. crate-0.35.2/src/crate/client/sqlalchemy/dialect.py +0 -369
  154. crate-0.35.2/src/crate/client/sqlalchemy/predicates/__init__.py +0 -99
  155. crate-0.35.2/src/crate/client/sqlalchemy/sa_version.py +0 -28
  156. crate-0.35.2/src/crate/client/sqlalchemy/support.py +0 -62
  157. crate-0.35.2/src/crate/client/sqlalchemy/tests/__init__.py +0 -59
  158. crate-0.35.2/src/crate/client/sqlalchemy/tests/array_test.py +0 -111
  159. crate-0.35.2/src/crate/client/sqlalchemy/tests/bulk_test.py +0 -256
  160. crate-0.35.2/src/crate/client/sqlalchemy/tests/compiler_test.py +0 -434
  161. crate-0.35.2/src/crate/client/sqlalchemy/tests/connection_test.py +0 -129
  162. crate-0.35.2/src/crate/client/sqlalchemy/tests/create_table_test.py +0 -313
  163. crate-0.35.2/src/crate/client/sqlalchemy/tests/datetime_test.py +0 -90
  164. crate-0.35.2/src/crate/client/sqlalchemy/tests/dialect_test.py +0 -156
  165. crate-0.35.2/src/crate/client/sqlalchemy/tests/dict_test.py +0 -460
  166. crate-0.35.2/src/crate/client/sqlalchemy/tests/function_test.py +0 -47
  167. crate-0.35.2/src/crate/client/sqlalchemy/tests/insert_from_select_test.py +0 -85
  168. crate-0.35.2/src/crate/client/sqlalchemy/tests/match_test.py +0 -137
  169. crate-0.35.2/src/crate/client/sqlalchemy/tests/query_caching.py +0 -143
  170. crate-0.35.2/src/crate/client/sqlalchemy/tests/update_test.py +0 -115
  171. crate-0.35.2/src/crate/client/sqlalchemy/tests/warnings_test.py +0 -64
  172. crate-0.35.2/src/crate/client/sqlalchemy/types.py +0 -277
  173. crate-0.35.2/src/crate.egg-info/SOURCES.txt +0 -64
  174. crate-0.35.2/src/crate.egg-info/entry_points.txt +0 -2
  175. {crate-0.35.2 → crate-1.0.0.dev0}/CONTRIBUTING.rst +0 -0
  176. {crate-0.35.2 → crate-1.0.0.dev0}/LICENSE +0 -0
  177. {crate-0.35.2 → crate-1.0.0.dev0}/MANIFEST.in +0 -0
  178. {crate-0.35.2 → crate-1.0.0.dev0}/NOTICE +0 -0
  179. {crate-0.35.2/src/crate.egg-info → crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/crate_docs_theme-0.26.3.dist-info}/namespace_packages.txt +0 -0
  180. {crate-0.35.2/src/crate.egg-info → crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/crate_docs_theme-0.26.3.dist-info}/top_level.txt +0 -0
  181. {crate-0.35.2/src/crate.egg-info → crate-1.0.0.dev0/docs/.crate-docs/.venv/lib/python3.9/site-packages/sphinxcontrib_plantuml-0.24.1-py3.9.egg-info}/dependency_links.txt +0 -0
  182. {crate-0.35.2 → crate-1.0.0.dev0}/docs/requirements.txt +0 -0
  183. {crate-0.35.2 → crate-1.0.0.dev0}/pyproject.toml +0 -0
  184. {crate-0.35.2 → crate-1.0.0.dev0}/setup.cfg +0 -0
  185. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/__init__.py +0 -0
  186. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/_pep440.py +0 -0
  187. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/blob.py +0 -0
  188. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/connection.py +0 -0
  189. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/converter.py +0 -0
  190. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/cursor.py +0 -0
  191. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/exceptions.py +0 -0
  192. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/http.py +0 -0
  193. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/pki/readme.rst +0 -0
  194. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/test_connection.py +0 -0
  195. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/test_cursor.py +0 -0
  196. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/test_http.py +0 -0
  197. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/client/test_util.py +0 -0
  198. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/testing/__init__.py +0 -0
  199. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/testing/layer.py +0 -0
  200. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/testing/settings.py +0 -0
  201. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/testing/test_layer.py +0 -0
  202. {crate-0.35.2 → crate-1.0.0.dev0}/src/crate/testing/util.py +0 -0
@@ -30,9 +30,7 @@ Run all tests::
30
30
 
31
31
  Run specific tests::
32
32
 
33
- ./bin/test -vvvv -t SqlAlchemyCompilerTest
34
33
  ./bin/test -vvvv -t test_score
35
- ./bin/test -vvvv -t sqlalchemy
36
34
 
37
35
  Ignore specific test directories::
38
36
 
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: crate
3
- Version: 0.35.2
3
+ Version: 1.0.0.dev0
4
4
  Summary: CrateDB Python Client
5
5
  Home-page: https://github.com/crate/crate-python
6
6
  Author: Crate.io
7
7
  Author-email: office@crate.io
8
8
  License: Apache License 2.0
9
- Keywords: crate db api sqlalchemy
9
+ Keywords: cratedb db api dbapi database sql http rdbms olap
10
10
  Platform: any
11
11
  Classifier: Development Status :: 5 - Production/Stable
12
12
  Classifier: Intended Audience :: Developers
@@ -26,11 +26,27 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy
26
26
  Classifier: Topic :: Database
27
27
  Requires-Python: >=3.6
28
28
  Description-Content-Type: text/x-rst
29
- Provides-Extra: sqlalchemy
30
- Provides-Extra: test
31
- Provides-Extra: doc
32
29
  License-File: LICENSE
33
30
  License-File: NOTICE
31
+ Requires-Dist: urllib3<2.3
32
+ Requires-Dist: verlib2==0.2.0
33
+ Provides-Extra: test
34
+ Requires-Dist: tox<5,>=3; extra == "test"
35
+ Requires-Dist: zope.testing<6,>=4; extra == "test"
36
+ Requires-Dist: zope.testrunner<7,>=5; extra == "test"
37
+ Requires-Dist: zc.customdoctests<2,>=1.0.1; extra == "test"
38
+ Requires-Dist: backports.zoneinfo<1; python_version < "3.9" and extra == "test"
39
+ Requires-Dist: certifi; extra == "test"
40
+ Requires-Dist: createcoverage<2,>=1; extra == "test"
41
+ Requires-Dist: dask[dataframe]; extra == "test"
42
+ Requires-Dist: stopit<2,>=1.1.2; extra == "test"
43
+ Requires-Dist: flake8<8,>=4; extra == "test"
44
+ Requires-Dist: pandas<2.3; extra == "test"
45
+ Requires-Dist: pueblo>=0.0.7; extra == "test"
46
+ Requires-Dist: pytz; extra == "test"
47
+ Provides-Extra: doc
48
+ Requires-Dist: sphinx<8,>=3.5; extra == "doc"
49
+ Requires-Dist: crate-docs-theme>=0.26.5; extra == "doc"
34
50
 
35
51
  =====================
36
52
  CrateDB Python Client
@@ -75,12 +91,11 @@ CrateDB Python Client
75
91
 
76
92
  |
77
93
 
78
- A Python client library for CrateDB_.
79
-
80
- This library:
94
+ A Python client library for `CrateDB`_, implementing the Python `DB API 2.0`_
95
+ specification.
81
96
 
82
- - Implements the Python `DB API 2.0`_ specification.
83
- - Includes support for SQLAlchemy_ in form of an `SQLAlchemy dialect`_.
97
+ The CrateDB dialect for `SQLAlchemy`_ is provided by the `sqlalchemy-cratedb`_
98
+ package.
84
99
 
85
100
 
86
101
  Installation
@@ -88,10 +103,9 @@ Installation
88
103
 
89
104
  The CrateDB Python client is available as package `crate`_ on `PyPI`_.
90
105
 
91
- To install the most recent driver version, including the SQLAlchemy dialect
92
- extension, run::
106
+ To install the most recent driver version, run::
93
107
 
94
- $ pip install "crate[sqlalchemy]" --upgrade
108
+ $ pip install --upgrade crate
95
109
 
96
110
 
97
111
  Documentation and help
@@ -121,7 +135,7 @@ GitHub`_. We appreciate contributions of any kind.
121
135
  .. _Developer documentation: DEVELOP.rst
122
136
  .. _managed on GitHub: https://github.com/crate/crate-python
123
137
  .. _PyPI: https://pypi.org/
124
- .. _SQLAlchemy: https://www.sqlalchemy.org
125
- .. _SQLAlchemy dialect: https://docs.sqlalchemy.org/dialects/
138
+ .. _SQLAlchemy: https://www.sqlalchemy.org/
139
+ .. _sqlalchemy-cratedb: https://github.com/crate-workbench/sqlalchemy-cratedb
126
140
  .. _StackOverflow: https://stackoverflow.com/tags/cratedb
127
141
  .. _support channels: https://crate.io/support/
@@ -41,12 +41,11 @@ CrateDB Python Client
41
41
 
42
42
  |
43
43
 
44
- A Python client library for CrateDB_.
44
+ A Python client library for `CrateDB`_, implementing the Python `DB API 2.0`_
45
+ specification.
45
46
 
46
- This library:
47
-
48
- - Implements the Python `DB API 2.0`_ specification.
49
- - Includes support for SQLAlchemy_ in form of an `SQLAlchemy dialect`_.
47
+ The CrateDB dialect for `SQLAlchemy`_ is provided by the `sqlalchemy-cratedb`_
48
+ package.
50
49
 
51
50
 
52
51
  Installation
@@ -54,10 +53,9 @@ Installation
54
53
 
55
54
  The CrateDB Python client is available as package `crate`_ on `PyPI`_.
56
55
 
57
- To install the most recent driver version, including the SQLAlchemy dialect
58
- extension, run::
56
+ To install the most recent driver version, run::
59
57
 
60
- $ pip install "crate[sqlalchemy]" --upgrade
58
+ $ pip install --upgrade crate
61
59
 
62
60
 
63
61
  Documentation and help
@@ -87,7 +85,7 @@ GitHub`_. We appreciate contributions of any kind.
87
85
  .. _Developer documentation: DEVELOP.rst
88
86
  .. _managed on GitHub: https://github.com/crate/crate-python
89
87
  .. _PyPI: https://pypi.org/
90
- .. _SQLAlchemy: https://www.sqlalchemy.org
91
- .. _SQLAlchemy dialect: https://docs.sqlalchemy.org/dialects/
88
+ .. _SQLAlchemy: https://www.sqlalchemy.org/
89
+ .. _sqlalchemy-cratedb: https://github.com/crate-workbench/sqlalchemy-cratedb
92
90
  .. _StackOverflow: https://stackoverflow.com/tags/cratedb
93
91
  .. _support channels: https://crate.io/support/
@@ -0,0 +1,158 @@
1
+ .. _data-types:
2
+
3
+ ==========
4
+ Data types
5
+ ==========
6
+
7
+ The :ref:`Database API client <connect>` and the :ref:`SQLAlchemy dialect
8
+ <using-sqlalchemy>` use different Python data types. Consult the corresponding
9
+ section for further information.
10
+
11
+ .. rubric:: Table of contents
12
+
13
+ .. contents::
14
+ :local:
15
+
16
+ .. _data-types-db-api:
17
+
18
+ Database API client
19
+ ===================
20
+
21
+ This section documents data types for the CrateDB :ref:`Database API client
22
+ <connect>`.
23
+
24
+ .. CAUTION::
25
+
26
+ The CrateDB Database API client implementation is incomplete. For the time
27
+ being, the client uses native Python types.
28
+
29
+ In general, types are mapped as follows:
30
+
31
+ ============= ===========
32
+ CrateDB Python
33
+ ============= ===========
34
+ `boolean`__ `boolean`__
35
+ `string`__ `str`__
36
+ `int`__ `int`__
37
+ `long`__ `int`__
38
+ `short`__ `int`__
39
+ `double`__ `float`__
40
+
41
+ `float`__ `float`__
42
+ `byte`__ `int`__
43
+ `geo_point`__ `list`__
44
+ `geo_shape`__ `dict`__
45
+ `object`__ `dict`__
46
+ `array`__ `list`__
47
+ ============= ===========
48
+
49
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#boolean
50
+ __ https://docs.python.org/3/library/stdtypes.html#boolean-values
51
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#character-data
52
+ __ https://docs.python.org/3/library/stdtypes.html#str
53
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
54
+ __ https://docs.python.org/3/library/functions.html#int
55
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
56
+ __ https://docs.python.org/3/library/functions.html#int
57
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
58
+ __ https://docs.python.org/3/library/functions.html#int
59
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
60
+ __ https://docs.python.org/3/library/functions.html#float
61
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
62
+ __ https://docs.python.org/3/library/functions.html#float
63
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
64
+ __ https://docs.python.org/3/library/functions.html#int
65
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#geo-point
66
+ __ https://docs.python.org/3/library/stdtypes.html#list
67
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#geo-shape
68
+ __ https://docs.python.org/3/library/stdtypes.html#dict
69
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#object
70
+ __ https://docs.python.org/3/library/stdtypes.html#dict
71
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#array
72
+ __ https://docs.python.org/3/library/stdtypes.html#list
73
+
74
+ When writing to CrateDB, the following conversions take place:
75
+
76
+ ============= ====================================
77
+ Python CrateDB
78
+ ============= ====================================
79
+ `Decimal`__ `string`__
80
+ `date`__ `integer`__, `long`__, or `string`__
81
+ `datetime`__ `integer`__, `long`__, or `string`__
82
+ ============= ====================================
83
+
84
+ __ https://docs.python.org/3/library/decimal.html
85
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#character-data
86
+ __ https://docs.python.org/3/library/datetime.html#date-objects
87
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
88
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
89
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#character-data
90
+ __ https://docs.python.org/3/library/datetime.html#datetime-objects
91
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
92
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
93
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#character-data
94
+
95
+ .. NOTE::
96
+
97
+ The type that ``date`` and ``datetime`` objects are mapped depends on the
98
+ CrateDB column type.
99
+
100
+ .. _data-types-sqlalchemy:
101
+
102
+ SQLAlchemy
103
+ ==========
104
+
105
+ This section documents data types for the CrateDB :ref:`SQLAlchemy dialect
106
+ <using-sqlalchemy>`.
107
+
108
+ .. _sqlalchemy-type-map:
109
+
110
+ Type map
111
+ --------
112
+
113
+ The CrateDB dialect maps between data types like so:
114
+
115
+ ================= =========================================
116
+ CrateDB SQLAlchemy
117
+ ================= =========================================
118
+ `boolean`__ `Boolean`__
119
+ `byte`__ `SmallInteger`__
120
+ `short`__ `SmallInteger`__
121
+ `integer`__ `Integer`__
122
+ `long`__ `NUMERIC`__
123
+ `float`__ `Float`__
124
+ `double`__ `DECIMAL`__
125
+ `timestamp`__ `TIMESTAMP`__
126
+ `string`__ `String`__
127
+ `array`__ `ARRAY`__
128
+ `object`__ :ref:`object` |nbsp| (extension type)
129
+ `array(object)`__ :ref:`objectarray` |nbsp| (extension type)
130
+ `geo_point`__ :ref:`geopoint` |nbsp| (extension type)
131
+ `geo_shape`__ :ref:`geoshape` |nbsp| (extension type)
132
+ ================= =========================================
133
+
134
+
135
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#boolean
136
+ __ http://docs.sqlalchemy.org/en/latest/core/type_basics.html#sqlalchemy.types.Boolean
137
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
138
+ __ http://docs.sqlalchemy.org/en/latest/core/type_basics.html#sqlalchemy.types.SmallInteger
139
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
140
+ __ http://docs.sqlalchemy.org/en/latest/core/type_basics.html#sqlalchemy.types.SmallInteger
141
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
142
+ __ http://docs.sqlalchemy.org/en/latest/core/type_basics.html#sqlalchemy.types.Integer
143
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
144
+ __ http://docs.sqlalchemy.org/en/latest/core/type_basics.html#sqlalchemy.types.NUMERIC
145
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
146
+ __ http://docs.sqlalchemy.org/en/latest/core/type_basics.html#sqlalchemy.types.Float
147
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#numeric-data
148
+ __ http://docs.sqlalchemy.org/en/latest/core/type_basics.html#sqlalchemy.types.DECIMAL
149
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#dates-and-times
150
+ __ http://docs.sqlalchemy.org/en/latest/core/type_basics.html#sqlalchemy.types.TIMESTAMP
151
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#character-data
152
+ __ http://docs.sqlalchemy.org/en/latest/core/type_basics.html#sqlalchemy.types.String
153
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#array
154
+ __ http://docs.sqlalchemy.org/en/latest/core/type_basics.html#sqlalchemy.types.ARRAY
155
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#object
156
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#array
157
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#geo-point
158
+ __ https://crate.io/docs/crate/reference/en/latest/general/ddl/data-types.html#geo-shape
@@ -0,0 +1,14 @@
1
+ .. _appendices:
2
+
3
+ ==========
4
+ Appendices
5
+ ==========
6
+
7
+ Supplementary information for the CrateDB Python client library.
8
+
9
+ .. rubric:: Table of contents
10
+
11
+ .. toctree::
12
+ :maxdepth: 2
13
+
14
+ data-types
@@ -0,0 +1,6 @@
1
+ :orphan:
2
+
3
+ - Docs: Jupyter Notebook Example?
4
+ - crate+pyodbc?
5
+ - Add PyPy to CI
6
+ - Check IronPython and JPython?
@@ -0,0 +1,162 @@
1
+ .. _blobs:
2
+
3
+ =====
4
+ Blobs
5
+ =====
6
+
7
+ The CrateDB Python client library provides full access to the powerful
8
+ :ref:`blob storage capabilities <crate-reference:blob_support>` of your
9
+ CrateDB cluster.
10
+
11
+ .. rubric:: Table of contents
12
+
13
+ .. contents::
14
+ :local:
15
+
16
+ Get a blob container
17
+ ====================
18
+
19
+ The first thing you will need to do is connect to CrateDB. Follow the
20
+ instructions in the :ref:`connection document <connect>` for more detailed
21
+ information.
22
+
23
+ For the sake of this example, we will do the following:
24
+
25
+ >>> from crate import client
26
+ >>> connection = client.connect("http://localhost:4200/")
27
+
28
+ This is a simple connection that connects to a CrateDB node running on
29
+ the local host with the :ref:`crate-reference:interface-http` listening
30
+ on port 4200 (the default).
31
+
32
+ To work with blobs in CrateDB, you must specifically create
33
+ :ref:`blob tables <crate-reference:blob_support>`.
34
+
35
+ The CrateDB Python client allows you to interact with these blob tables via a
36
+ blob container, which you can create like this:
37
+
38
+ >>> blob_container = connection.get_blob_container('my_blobs')
39
+ >>> blob_container
40
+ <BlobContainer 'my_blobs'>
41
+
42
+ Here, we have created a ``BlobContainer`` for the ``my_blobs`` table, using
43
+ ``connection`` object.
44
+
45
+ Now we can start working with our blob container.
46
+
47
+ Working with the blob container
48
+ ===============================
49
+
50
+ Upload blobs
51
+ ------------
52
+
53
+ The blob container can work with files or *file-like objects*, as long as
54
+ produce bytes when read.
55
+
56
+ What is a file-like object? Well, to put it simply, any object that provides a
57
+ ``read()`` method.
58
+
59
+ The stream objects provided by the Python standard library :mod:`py:io` and
60
+ :mod:`py:tempfile` modules are the most commonly used file-like objects.
61
+
62
+ The :class:`py:io.StringIO` class is not suitable, as it produces Unicode strings when
63
+ read. But you can easily encode a Unicode string and feed it to a :class:`py:io.BytesIO`
64
+ object.
65
+
66
+ Here's a trivial example:
67
+
68
+ >>> import io
69
+ >>> bytestream = "An example sentence.".encode("utf8")
70
+ >>> file = io.BytesIO(bytestream)
71
+
72
+ This file can then be uploaded to the blob table using the ``put`` method:
73
+
74
+ >>> blob_container.put(file)
75
+ '6f10281ad07d4a35c6ec2f993e6376032b77181d'
76
+
77
+ Notice that this method computes and returns an `SHA-1 digest`_. This is
78
+ necessary for attempting to save the blob to CrateDB.
79
+
80
+ If you already have the SHA-1 digest computed, or are able to compute it as part
81
+ of an existing read, this may improve the performance of your application.
82
+
83
+ If you pass in a SHA-1 digest, it will not be recomputed:
84
+
85
+ >>> file.seek(0) # seek to the beginning before attempting to re-upload
86
+
87
+ >>> digest = "6f10281ad07d4a35c6ec2f993e6376032b77181d"
88
+ >>> blob_container.put(file, digest=digest)
89
+ False
90
+
91
+ Notice that the method returned ``False`` this time. If you specify a digest,
92
+ the return value of the ``put`` method is a boolean indicating whether the
93
+ object was written or not. In this instance, it was not written, because the
94
+ digest is the same as an existing object.
95
+
96
+ Let's make a new object:
97
+
98
+ >>> bytestream = "Another example sentence.".encode("utf8")
99
+ >>> digest = hashlib.sha1(bytestream).hexdigest()
100
+ >>> another_file = io.BytesIO(bytestream)
101
+
102
+ And upload it:
103
+
104
+ >>> blob_container.put(another_file, digest)
105
+ True
106
+
107
+ The ``put`` method returns ``True``, indicating that the object has been
108
+ written to the blob container.
109
+
110
+ Retrieve blobs
111
+ --------------
112
+
113
+ To retrieve a blob, you need to know its digest.
114
+
115
+ Let's use the ``digest`` variable we created before to check whether that object
116
+ exists with the ``exists`` method:
117
+
118
+ >>> blob_container.exists(digest)
119
+ True
120
+
121
+ This method returns a boolean value. And in this instance, ``True`` indicates
122
+ that the blob we're interested in is contained within the blob container.
123
+
124
+ You can get the blob, with the ``get`` method, like so:
125
+
126
+ >>> blob_generator = blob_container.get(digest)
127
+
128
+ Blobs are read in chunks. The default size of these chunks is 128 kilobytes,
129
+ but this can be changed by supplying the desired chunk size to the ``get``
130
+ method, like so:
131
+
132
+ >>> res = blob_container.get(digest, 1024 * 128)
133
+
134
+ The ``blob`` object is a Python :term:`py:generator`, meaning that you can call
135
+ ``next(blob)`` for each new chunk you want to read, until you encounter a
136
+ ``StopIteration`` exception.
137
+
138
+ Instead of calling ``next()`` manually, the idiomatic way to iterate over a
139
+ generator is like so:
140
+
141
+ >>> blob_content = b''
142
+ >>> for chunk in blob_container.get(digest):
143
+ ... blob_content += chunk
144
+
145
+
146
+ Delete blobs
147
+ ------------
148
+
149
+ You can delete a blob with the ``delete`` method and the blob digest, like so:
150
+
151
+ >>> blob_container.delete(digest)
152
+ True
153
+
154
+ This method returns a boolean status value. In this instance, ``True``
155
+ indicates that the blob was deleted.
156
+
157
+ We can verify that, like so:
158
+
159
+ >>> blob_container.exists(digest)
160
+ False
161
+
162
+ .. _SHA-1 digest: https://en.wikipedia.org/wiki/SHA-1
@@ -0,0 +1,100 @@
1
+ ==================
2
+ Blob container API
3
+ ==================
4
+
5
+ The connection object provides a convenience API for easy access to
6
+ :ref:`blob tables <crate-reference:blob_support>`.
7
+
8
+
9
+ Get blob container handle
10
+ =========================
11
+
12
+ Create a connection:
13
+
14
+ >>> from crate.client import connect
15
+ >>> client = connect([crate_host])
16
+
17
+ Get a blob container:
18
+
19
+ >>> container = client.get_blob_container('myfiles')
20
+
21
+
22
+ Store blobs
23
+ ===========
24
+
25
+ The container allows to store a blob without explicitly providing the hash
26
+ for the blob. This feature is possible if the blob is provided as a seekable
27
+ stream like object.
28
+
29
+ Store a ``StringIO`` stream:
30
+
31
+ >>> from io import BytesIO
32
+ >>> f = BytesIO(b'StringIO data')
33
+ >>> stringio_bob = container.put(f)
34
+ >>> stringio_bob
35
+ '0cd4511d696823779692484029f234471cd21f28'
36
+
37
+ Store from a file:
38
+
39
+ >>> from tempfile import TemporaryFile
40
+ >>> f = TemporaryFile()
41
+ >>> _ = f.write(b'File data')
42
+ >>> _ = f.seek(0)
43
+ >>> file_blob = container.put(f)
44
+ >>> file_blob
45
+ 'ea6e03a4a4ee8a2366fe5a88af2bde61797973ea'
46
+ >>> f.close()
47
+
48
+ If the blob data is not provided as a seekable stream the hash must be
49
+ provided explicitly:
50
+
51
+ >>> import hashlib
52
+ >>> string_data = b'String data'
53
+ >>> string_blob = hashlib.sha1(string_data).hexdigest()
54
+ >>> container.put(string_data, string_blob)
55
+ True
56
+
57
+
58
+ Check for existence
59
+ ===================
60
+
61
+ >>> container.exists(string_blob)
62
+ True
63
+ >>> container.exists('unknown')
64
+ False
65
+
66
+
67
+ Retrieve blobs
68
+ ==============
69
+
70
+ Blobs can be retrieved using its hash:
71
+
72
+ >>> blob_stream = container.get(string_blob)
73
+ >>> blob_stream
74
+ <generator ...>
75
+ >>> data = next(blob_stream)
76
+ >>> data == string_data
77
+ True
78
+
79
+
80
+ Delete blobs
81
+ ============
82
+
83
+ Blobs can be deleted using its hash:
84
+
85
+ >>> container.delete(string_blob)
86
+ True
87
+ >>> container.exists(string_blob)
88
+ False
89
+
90
+ Trying to delete a not existing blob:
91
+
92
+ >>> container.delete(string_blob)
93
+ False
94
+
95
+ Close connection
96
+ ================
97
+
98
+ Close the connection to clear the connection pool:
99
+
100
+ >>> client.close()