diff --git a/developer-documentation b/developer-documentation new file mode 160000 index 0000000..2fa3e19 --- /dev/null +++ b/developer-documentation @@ -0,0 +1 @@ +Subproject commit 2fa3e1906dc2892567cbcc1f4041395890064f8c diff --git a/doc/data_ingestion.rst b/doc/data_ingestion.rst index 73a42f9..3454e8d 100644 --- a/doc/data_ingestion.rst +++ b/doc/data_ingestion.rst @@ -133,7 +133,6 @@ Here is an example of how to load data from a CSV file stored on an HTTP server: conn.execute(""" IMPORT INTO your_schema.your_table FROM CSV AT 'https://your_https_server/path/to/your/file.csv' - FILE OPTIONS 'DELIMITER=; ENCODING=UTF-8 SKIP_ROWS=1 NULL=NULL' """) For more detailed information on loading data from external sources, please refer to the Exasol documentation: diff --git a/doc/environments.rst b/doc/environments.rst index a41a60c..0b6d591 100644 --- a/doc/environments.rst +++ b/doc/environments.rst @@ -1,11 +1,63 @@ Environments ============ -Jupyter Notebooks ------------------ +.. _jupyterlab: -VSCode ------- +JupyterLab and JupySQL +---------------------- + +Install SQLAlchemy and JupySQL + +.. code-block:: python + + pip install sqlalchemy-exasol + pip install jupysql + +Connect to Exasol database using SQLAlchemy + +.. code-block:: python + + import sqlalchemy + from sqlalchemy.engine.url import URL + import getpass + + db_host = 'my_exasol_host' + db_port = 8563 + db_username = input('User Name:') + db_password = getpass.getpass('Password:') + + websocket_url = URL.create( + 'exa+websocket', + host=db_host, + port=db_port, + username=db_username, + password=db_password + ) + + db_engine = sqlalchemy.create_engine(websocket_url) + +Enable the Jupyter SQL Extension + +.. code-block:: python + + %load_ext sql + %sql db_engine + + + +Run queries against Exasol + +.. code-block:: python + + %%sql + SELECT * FROM "FLIGHTS"."AIRLINE" LIMIT 10 Positron --------- \ No newline at end of file +-------- + +You can either connect to Exasol with pyexasol as described in :doc:`getting_started` or using JupySQL as described in :ref:`jupyterlab`. + +pyCharm +------- + +Please follow the instructions of the official documentation of `pyCharm `_. \ No newline at end of file diff --git a/doc/integrations.rst b/doc/integrations.rst index a4f52de..9922dd5 100644 --- a/doc/integrations.rst +++ b/doc/integrations.rst @@ -1,14 +1,63 @@ Integrations ============ +SQLAlchemy +---------- + +Install SQLAlchemy + +.. code-block:: python + + pip install sqlalchemy-exasol + + +Connect to Exasol database using SQLAlchemy + +.. code-block:: python + + from sqlalchemy import create_engine + url = "exa+websocket://:@:/?CONNECTIONLCALL=en_US.UTF-8" + e = create_engine(url) + r = e.execute("select 42 from dual").fetchall() + +Please also refer to `sqlalchemy exasol documentation `_. + JupySQL ------- +How to work with JupySQL in JupyterLab is described in :doc:`environments`. + Pandas ------ +Importing Data into Pandas +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +You can fetch data from Exasol into a Pandas DataFrame using pyexasol. + +.. code-block:: python + + import pandas as pd + + # Execute a query and fetch data into a Pandas DataFrame, Conn is an existing pyexasol connection. + df = conn.export_to_pandas('SELECT * FROM ') + + # Display the DataFrame + print(df) + +Exporting Data from Pandas to Exasol +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +You can also export data from a Pandas DataFrame to an Exasol table. + +.. code-block:: python + + # Assume you have a Pandas DataFrame `df` you wish to export + conn.import_from_pandas(df, '') + Ibis ---- -SQLAlchemy ----------- +Please refer to the `IBIS documentation `_. + +