-
Notifications
You must be signed in to change notification settings - Fork 2
Added Chapters environments and integrations #11
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule developer-documentation
added at
2fa3e1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
-------- | ||
-------- | ||
|
||
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 <https://www.jetbrains.com/help/pycharm/exasol.html>`_. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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://<user>:<password>@<host>:<port>/<schema>?CONNECTIONLCALL=en_US.UTF-8" | ||
e = create_engine(url) | ||
r = e.execute("select 42 from dual").fetchall() | ||
|
||
Please also refer to `sqlalchemy exasol documentation <https://exasol.github.io/sqlalchemy-exasol/master/user_guide.html#user-guide>`_. | ||
|
||
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 <your_table_name>') | ||
|
||
# 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, '<your_target_table_name>') | ||
|
||
Ibis | ||
---- | ||
|
||
SQLAlchemy | ||
---------- | ||
Please refer to the `IBIS documentation <https://ibis-project.org/backends/exasol>`_. | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.