@@ -11,12 +11,13 @@ SQLAlchemy dialect for CrateDB
1111 :depth: 1
1212
1313
14- ************
15- Introduction
16- ************
14+ *****
15+ About
16+ *****
1717
1818The :ref: `CrateDB dialect <using-sqlalchemy >` for `SQLAlchemy `_ provides adapters
1919for `CrateDB `_ and SQLAlchemy. The supported versions are 1.3, 1.4, and 2.0.
20+ The package is available from `PyPI `_ at `sqlalchemy-cratedb `_.
2021
2122The connector can be used to connect to both `CrateDB `_ and `CrateDB
2223Cloud `_, and is verified to work on Linux, macOS, and Windows. It is used by
@@ -25,29 +26,40 @@ CrateDB from the Python ecosystem. It is verified to work with CPython, but
2526it has also been tested successfully with `PyPy `_.
2627
2728
28- *************
29- Documentation
30- *************
29+ ************
30+ Introduction
31+ ************
3132
3233Please consult the `SQLAlchemy tutorial `_, and the general `SQLAlchemy
3334documentation `_.
34- For more detailed information about how to install the client driver , how to
35+ For more detailed information about how to install the dialect package , how to
3536connect to a CrateDB cluster, and how to run queries, consult the resources
3637referenced below.
3738
39+
40+ ************
41+ Installation
42+ ************
43+
44+ Install package from PyPI.
45+
46+ .. code-block :: shell
47+
48+ pip install --upgrade sqlalchemy-cratedb
49+
50+ More installation details can be found over here.
51+
3852.. toctree ::
3953 :titlesonly:
4054
4155 install
4256
43- SQLAlchemy
44- ==========
4557
46- Install package from PyPI.
58+ .. _ features :
4759
48- .. code-block :: shell
49-
50- pip install sqlalchemy-cratedb
60+ ********
61+ Features
62+ ********
5163
5264The CrateDB dialect for `SQLAlchemy `_ offers convenient ORM access and supports
5365CrateDB's container data types ``OBJECT `` and ``ARRAY ``, its vector data type
@@ -59,23 +71,20 @@ kinds of `GeoJSON geometry objects`_.
5971
6072 overview
6173
62- Install package from PyPI with DB API and SQLAlchemy support.
6374
64- .. code-block :: shell
75+ .. _ synopsis :
6576
66- pip install sqlalchemy-cratedb pandas
77+ Synopsis
78+ ========
6779
6880Connect to CrateDB instance running on ``localhost ``.
6981
7082.. code-block :: python
7183
7284 # Connect using SQLAlchemy Core.
73- import pkg_resources
7485 import sqlalchemy as sa
7586 from pprint import pp
7687
77- pkg_resources.require(" sqlalchemy>=2.0" )
78-
7988 dburi = " crate://localhost:4200"
8089 query = " SELECT country, mountain, coordinates, height FROM sys.summits ORDER BY country;"
8190
@@ -95,6 +104,10 @@ Connect to `CrateDB Cloud`_.
95104
96105 Load results into `pandas `_ DataFrame.
97106
107+ .. code-block :: shell
108+
109+ pip install pandas
110+
98111 .. code-block :: python
99112
100113 # Connect using SQLAlchemy Core and pandas.
@@ -114,13 +127,15 @@ Load results into `pandas`_ DataFrame.
114127 Data types
115128==========
116129
117- The DB API driver and the SQLAlchemy dialect support :ref: `CrateDB's data types
118- <crate-reference:data-types>` to different degrees. For more information,
119- please consult the :ref: `data-types ` and :ref: `SQLAlchemy extension types
120- <using-extension-types>` documentation pages.
130+ The :ref: `DB API driver <crate-python:index >` and the SQLAlchemy dialect
131+ support :ref: `CrateDB's data types <crate-reference:data-types >` to different
132+ degrees.
133+ For more information, please consult the :ref: `data-types ` and :ref: `SQLAlchemy
134+ extension types <using-extension-types>` documentation pages.
121135
122136.. toctree ::
123137 :maxdepth: 2
138+ :hidden:
124139
125140 data-types
126141
@@ -129,8 +144,9 @@ please consult the :ref:`data-types` and :ref:`SQLAlchemy extension types
129144.. _by-example :
130145.. _sqlalchemy-by-example :
131146
147+ ********
132148Examples
133- ========
149+ ********
134150
135151This section enumerates concise examples demonstrating the
136152use of the SQLAlchemy dialect.
@@ -145,15 +161,12 @@ use of the SQLAlchemy dialect.
145161 inspection-reflection
146162 dataframe
147163
164+ .. rubric :: See also
148165
149- See also
150- --------
151166- Executable code examples are maintained within the `cratedb-examples repository `_.
152- - The `sample application `_ and the corresponding `sample application
153- documentation `_ demonstrate the use of the driver on behalf of an example
154- "guestbook" application.
155- - `Use CrateDB with pandas `_ has corresponding code snippets about how to
156- connect to CrateDB using `pandas `_, and how to load and export data.
167+ - `Using CrateDB with pandas, Dask, and Polars `_ has corresponding code snippets
168+ about how to connect to CrateDB using popular data frame libraries, and how to
169+ load and export data.
157170- The `Apache Superset `_ and `FIWARE QuantumLeap data historian `_ projects.
158171
159172
@@ -164,13 +177,13 @@ Project information
164177
165178Resources
166179=========
167- - `Source code <https://github.com/crate/crate-python >`_
168- - `Documentation <https://crate.io/docs/python/ >`_
169- - `Python Package Index (PyPI) <https://pypi.org/project/crate / >`_
180+ - `Source code <https://github.com/crate-workbench/sqlalchemy-cratedb >`_
181+ - `Documentation <https://github.com/crate-workbench/sqlalchemy-cratedb >`_
182+ - `Python Package Index (PyPI) <https://pypi.org/project/sqlalchemy-cratedb / >`_
170183
171184Contributions
172185=============
173- The CrateDB Python client library is an open source project, and is `managed on
186+ The SQLAlchemy dialect for CrateDB is an open source project, and is `managed on
174187GitHub `_.
175188Every kind of contribution, feedback, or patch, is much welcome. `Create an
176189issue `_ or submit a patch if you think we should include a new feature, or to
@@ -193,24 +206,23 @@ The project is licensed under the terms of the Apache 2.0 license, like
193206
194207
195208.. _Apache Superset : https://github.com/apache/superset
196- .. _Crash CLI : https://crate.io/docs/crate/crash/
197209.. _CrateDB : https://crate.io/products/cratedb
198210.. _CrateDB Cloud : https://console.cratedb.cloud/
199211.. _CrateDB source : https://github.com/crate/crate
200- .. _Create an issue : https://github.com/crate/crate-python /issues
201- .. _development sandbox : https://github.com/crate/crate-python /blob/master /DEVELOP.rst
212+ .. _Create an issue : https://github.com/crate-workbench/sqlalchemy-cratedb /issues
213+ .. _development sandbox : https://github.com/crate-workbench/sqlalchemy-cratedb /blob/main /DEVELOP.md
202214.. _cratedb-examples repository : https://github.com/crate/cratedb-examples/tree/main/by-language
203215.. _FIWARE QuantumLeap data historian : https://github.com/orchestracities/ngsi-timeseries-api
204216.. _GeoJSON : https://geojson.org/
205217.. _GeoJSON geometry objects : https://tools.ietf.org/html/rfc7946#section-3.1
206- .. _LICENSE : https://github.com/crate/crate-python /blob/master /LICENSE
207- .. _managed on GitHub : https://github.com/crate/crate-python
218+ .. _LICENSE : https://github.com/crate-workbench/sqlalchemy-cratedb /blob/main /LICENSE
219+ .. _managed on GitHub : https://github.com/crate-workbench/sqlalchemy-cratedb
208220.. _pandas : https://pandas.pydata.org/
209221.. _PEP 249 : https://peps.python.org/pep-0249/
222+ .. _PyPI : https://pypi.org/
210223.. _PyPy : https://www.pypy.org/
211- .. _sample application : https://github.com/crate/crate-sample-apps/tree/main/python-flask
212- .. _sample application documentation : https://github.com/crate/crate-sample-apps/blob/main/python-flask/documentation.md
213224.. _SQLAlchemy : https://www.sqlalchemy.org/
214225.. _SQLAlchemy documentation : https://docs.sqlalchemy.org/
215226.. _SQLAlchemy tutorial : https://docs.sqlalchemy.org/en/latest/tutorial/
216- .. _Use CrateDB with pandas : https://github.com/crate/crate-qa/pull/246
227+ .. _sqlalchemy-cratedb : https://pypi.org/project/sqlalchemy-cratedb/
228+ .. _Using CrateDB with pandas, Dask, and Polars : https://github.com/crate/cratedb-examples/tree/main/by-dataframe
0 commit comments