Skip to content

Commit d9e858b

Browse files
committed
Driver/Python: Add Conecta
1 parent b5063f4 commit d9e858b

File tree

1 file changed

+33
-2
lines changed

1 file changed

+33
-2
lines changed

docs/connect/python.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,36 @@ frameworks, are using SQLAlchemy as database adapter library when connecting to
6363
- [SQLAlchemy Code Examples]
6464

6565

66-
(python-drivers-community)=
67-
## Community drivers
66+
(python-drivers-more)=
67+
## Special purpose drivers
68+
69+
(conecta-intro)=
70+
71+
### Conecta
72+
73+
{ref}`conecta` is a library designed to load data from SQL databases into
74+
Arrow with maximum speed and memory efficiency by leveraging zero-copy and
75+
true concurrency in Python.
76+
77+
```python
78+
from pprint import pprint
79+
from conecta import read_sql
80+
81+
table = read_sql(
82+
"postgres://crate:crate@localhost:5432/doc",
83+
queries=["SELECT country, region, mountain, height, latitude(coordinates), longitude(coordinates) FROM sys.summits ORDER BY height DESC LIMIT 3"],
84+
)
85+
86+
# Display in Python format.
87+
pprint(table.to_pylist())
88+
89+
# Optionally convert to pandas dataframe.
90+
print(table.to_pandas())
91+
92+
# Optionally convert to Polars dataframe.
93+
import polars as pl
94+
print(pl.from_arrow(table))
95+
```
6896

6997
(cratedb-async)=
7098

@@ -112,6 +140,9 @@ response = crate.execute(
112140
print(response)
113141
```
114142

143+
(python-drivers-community)=
144+
## Community drivers
145+
115146
(psycopg2)=
116147

117148
### psycopg2

0 commit comments

Comments
 (0)