Skip to content

Commit 9e34495

Browse files
Added Chapters environments and integrations
1 parent 2fa3e19 commit 9e34495

File tree

4 files changed

+109
-8
lines changed

4 files changed

+109
-8
lines changed

developer-documentation

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 2fa3e1906dc2892567cbcc1f4041395890064f8c

doc/data_ingestion.rst

-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ Here is an example of how to load data from a CSV file stored on an HTTP server:
133133
conn.execute("""
134134
IMPORT INTO your_schema.your_table
135135
FROM CSV AT 'https://your_https_server/path/to/your/file.csv'
136-
FILE OPTIONS 'DELIMITER=; ENCODING=UTF-8 SKIP_ROWS=1 NULL=NULL'
137136
""")
138137
139138
For more detailed information on loading data from external sources, please refer to the Exasol documentation:

doc/environments.rst

+57-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,63 @@
11
Environments
22
============
33

4-
Jupyter Notebooks
5-
-----------------
4+
.. _jupyterlab:
65

7-
VSCode
8-
------
6+
JupyterLab and JupySQL
7+
----------------------
8+
9+
Install SQLAlchemy and JupySQL
10+
11+
.. code-block:: python
12+
13+
pip install sqlalchemy-exasol
14+
pip install jupysql
15+
16+
Connect to Exasol database using SQLAlchemy
17+
18+
.. code-block:: python
19+
20+
import sqlalchemy
21+
from sqlalchemy.engine.url import URL
22+
import getpass
23+
24+
db_host = 'my_exasol_host'
25+
db_port = 8563
26+
db_username = input('User Name:')
27+
db_password = getpass.getpass('Password:')
28+
29+
websocket_url = URL.create(
30+
'exa+websocket',
31+
host=db_host,
32+
port=db_port,
33+
username=db_username,
34+
password=db_password
35+
)
36+
37+
db_engine = sqlalchemy.create_engine(websocket_url)
38+
39+
Enable the Jupyter SQL Extension
40+
41+
.. code-block:: python
42+
43+
%load_ext sql
44+
%sql db_engine
45+
46+
47+
48+
Run queries against Exasol
49+
50+
.. code-block:: python
51+
52+
%%sql
53+
SELECT * FROM "FLIGHTS"."AIRLINE" LIMIT 10
954
1055
Positron
11-
--------
56+
--------
57+
58+
You can either connect to exasol with pyexasol as described in :doc:`getting_started` or use JupySQL as described in :ref:`jupyterlab`.
59+
60+
pyCharm
61+
-------
62+
63+
Please follow the instructions of the official documentation of `pyCharm <https://www.jetbrains.com/help/pycharm/exasol.html>`_.

doc/integrations.rst

+51-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,63 @@
11
Integrations
22
============
33

4+
SQLAlchemy
5+
----------
6+
7+
Install SQLAlchemy
8+
9+
.. code-block:: python
10+
11+
pip install sqlalchemy-exasol
12+
13+
14+
Connect to Exasol database using SQLAlchemy
15+
16+
.. code-block:: python
17+
18+
from sqlalchemy import create_engine
19+
url = "exa+websocket://A_USER:[email protected]:1234/my_schema?CONNECTIONLCALL=en_US.UTF-8"
20+
e = create_engine(url)
21+
r = e.execute("select 42 from dual").fetchall()
22+
23+
Please also refer to `sqlalchemy exasol documentation <https://exasol.github.io/sqlalchemy-exasol/master/user_guide.html#user-guide>`_.
24+
425
JupySQL
526
-------
627

28+
How to work with JupySQL in JupyterLab is described in :doc:`environments`.
29+
730
Pandas
831
------
932

33+
Importing Data into Pandas
34+
^^^^^^^^^^^^^^^^^^^^^^^^^^
35+
36+
You can fetch data from Exasol into a Pandas DataFrame using pyexasol.
37+
38+
.. code-block:: python
39+
40+
import pandas as pd
41+
42+
# Execute a query and fetch data into a Pandas DataFrame, Conn is an existing pyexasol connection.
43+
df = conn.export_to_pandas('SELECT * FROM <your_table_name>')
44+
45+
# Display the DataFrame
46+
print(df)
47+
48+
Exporting Data from Pandas to Exasol
49+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50+
51+
You can also export data from a Pandas DataFrame to an Exasol table.
52+
53+
.. code-block:: python
54+
55+
# Assume you have a Pandas DataFrame `df` you wish to export
56+
conn.import_from_pandas(df, '<your_target_table_name>')
57+
1058
Ibis
1159
----
1260

13-
SQLAlchemy
14-
----------
61+
Please refer to the `IBIS documentation <https://ibis-project.org/backends/exasol>`_.
62+
63+

0 commit comments

Comments
 (0)