pyexasol is the officially supported Python connector for Exasol, designed for high-performance data handling with low overhead, fast HTTP transport, and compression. It provides an API for parallel data stream processing, offering significant performance improvements over ODBC/JDBC solutions, especially with `pandas`, `parquet`, and `polars`. The library is actively maintained with a regular release cadence, often seeing monthly or bi-monthly updates.
pip install pyexasolVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to establish a connection to an Exasol database, execute DDL and DML statements, and fetch results. It highlights the use of `ExaConnection` and basic SQL operations. For local testing without valid SSL certificates, you might need to adjust `websocket_sslopt` as noted in the code comments. Credentials should ideally be managed via environment variables or a secure configuration.
Upgrade your Python environment to 3.10 or newer.
Ensure `export_params['with_column_names']` is explicitly set to `True` or `False`.
For production, provide valid SSL certificates via `websocket_sslopt={'ca_certs': 'path/to/cert.pem'}` or use server fingerprints. For development/testing on untrusted networks, consider `websocket_sslopt={'check_hostname': False, 'verify_mode': 0}` (use with caution and never in production).Ensure the `dst` directory is empty, doesn't exist, or explicitly set `callback_params={'existing_data_behavior': 'overwrite_or_ignore'}` (or 'delete_matching') when calling `export_to_parquet`.For critical data type preservation, inspect column types after import. Use `callback_params` to pass custom `dtype` arguments to `pandas.read_csv` if necessary, or use `stmt.fetchall()` and manually construct a DataFrame with explicit dtypes.
Upgrade to v2.1.0 or later for enhanced error diagnostics in import/export operations involving callbacks. For older versions, examine logs from HTTP and SQL threads for more context.
pip install pyexasol
Verify the DSN (host and port), check network connectivity (e.g., using 'telnet <host> 8563'), ensure the Exasol database is running, and confirm the client's IP address is allow-listed if connecting to Exasol SaaS.
Explicitly set `encryption=True` in the `pyexasol.connect()` call: `pyexasol.connect(dsn='...', user='...', password='...', encryption=True)`.
Update OpenSSL on the client machine, ensure proper TLS/SSL certificate setup (e.g., using trusted CA certificates or fingerprint verification), or, for testing purposes, disable certificate verification (though this is not recommended for production).
Upgrade the `pyexasol` package to version `0.3.23` or higher using `pip install --upgrade pyexasol`.