-
Notifications
You must be signed in to change notification settings - Fork 1
Driver: Improve section about Python #403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughReplaces the single Changes
Sequence Diagram(s)Documentation-only changes; no runtime control-flow changes, so no sequence diagram included. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
e00bae2
to
b5fd235
Compare
micropython-cratedb
, and turbodbc(crate-python)= | ||
# crate-python | ||
|
||
:::{div} .float-right .text-right | ||
[](https://github.com/crate/cratedb-examples/actions/workflows/lang-python-dbapi.yml) | ||
::: | ||
:::{div} .clearfix | ||
::: | ||
|
||
The `crate` Python package offers a database client implementation compatible | ||
with the Python Database API 2.0 specification, and also includes the CrateDB | ||
SQLAlchemy dialect. See the full documentation {ref}`here <crate-python:index>`. | ||
The package can be installed using `pip install crate`. | ||
|
||
```python | ||
from crate import client | ||
|
||
conn = client.connect("https://<name-of-your-cluster>.cratedb.net:4200", username="admin", password="<PASSWORD>", verify_ssl_cert=True) | ||
|
||
with conn: | ||
cursor = conn.cursor() | ||
cursor.execute("SELECT * FROM sys.summits") | ||
result = cursor.fetchone() | ||
print(result) | ||
``` | ||
|
||
- [Connect to CrateDB using the Python DB API] | ||
|
||
|
||
[Connect to CrateDB using the Python DB API]: https://github.com/crate/cratedb-examples/tree/main/by-language/python-dbapi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provide a runnable example for each item, e.g. by adding inline dependencies (PEP 723) implemented by uv
, or by just adding a simple pip install ...
incantation to the docs, followed up by an incantation how to invoke the program.
This has been conducted for all the other clients, so the Python area should not be left behind.
(python-dataframe)= | ||
(df)= | ||
(dataframe)= | ||
(dataframes)= | ||
(dataframe-examples)= | ||
## Dataframe libraries | ||
|
||
Use CrateDB together with popular open-source dataframe libraries. | ||
Each of them is using the CrateDB SQLAlchemy dialect for database | ||
communications. | ||
|
||
:::::{grid} 2 3 4 4 | ||
:gutter: 3 3 4 5 | ||
:padding: 0 | ||
|
||
::::{grid-item-card} Dask | ||
:link: dask | ||
:link-type: ref | ||
:link-alt: Connect to CrateDB using Dask | ||
:text-align: center | ||
:class-card: sd-pt-3 | ||
:class-body: sd-fs-1 | ||
:class-title: sd-fs-6 | ||
{height=40px} | ||
:::: | ||
|
||
::::{grid-item-card} pandas | ||
:link: pandas | ||
:link-type: ref | ||
:link-alt: Connect to CrateDB using pandas | ||
:text-align: center | ||
:class-card: sd-pt-3 | ||
:class-body: sd-fs-1 | ||
:class-title: sd-fs-6 | ||
{height=40px} | ||
:::: | ||
|
||
::::{grid-item-card} Polars | ||
:link: polars | ||
:link-type: ref | ||
:link-alt: Connect to CrateDB using Polars | ||
:text-align: center | ||
:class-card: sd-pt-3 | ||
:class-body: sd-fs-1 | ||
:class-title: sd-fs-6 | ||
{height=40px} | ||
:::: | ||
|
||
::::: | ||
|
||
:::{tip} | ||
The `insert_bulk` utility function from `sqlalchemy-cratedb` unlocks | ||
a performance path, see also {ref}`sqlalchemy-cratedb:support-insert-bulk`. | ||
About optimally configuring pandas and Dask for efficient insert operations, | ||
see also {ref}`sqlalchemy-cratedb:dataframe`. | ||
::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few requests here.
- Expand dataframe libraries into individual pages.
- Absorb content from "integrations" section.
- Absorb content from SQLAlchemy dialect's DataFrame operations.
About
Preview
https://cratedb-guide--403.org.readthedocs.build/connect/python/
/cc @matriv, @seut