Skip to content

Requirements

execsql requires Python 3.10 or later.

execsql uses third-party Python libraries to communicate with different database and spreadsheet software. Only those libraries that are needed, based on the database type and metacommands in use, must be installed.

The easiest way to install the required libraries is to use the optional dependency extras provided by the execsql2 package:

# Database drivers
pip install "execsql2[postgres]"    # PostgreSQL
pip install "execsql2[mysql]"       # MySQL / MariaDB
pip install "execsql2[mssql]"       # MS SQL Server (pyodbc)
pip install "execsql2[duckdb]"      # DuckDB
pip install "execsql2[firebird]"    # Firebird
pip install "execsql2[oracle]"      # Oracle
pip install "execsql2[odbc]"        # ODBC DSN (pyodbc)

# Feature bundles
pip install "execsql2[formats]"     # ODS, Excel, Jinja2, Feather, Parquet, HDF5
pip install "execsql2[formatter]"   # SQL pass for execsql-format (sqlglot)
pip install "execsql2[upsert]"      # PG_UPSERT metacommand (pg-upsert)
pip install "execsql2[map]"         # PROMPT MAP widget (tkintermapview)
pip install "execsql2[auth]"        # OS keyring integration (desktop / native)
pip install "execsql2[auth-plaintext]"  # Headless keyring (plaintext file backend)
pip install "execsql2[auth-encrypted]"  # Headless keyring (encrypted file backend)

# Convenience
pip install "execsql2[all-db]"      # All database drivers
pip install "execsql2[all]"         # Everything (all-db + formats + formatter + auth + upsert + map)

Multiple extras can be combined: pip install "execsql2[postgres,duckdb,formats]".

Libraries by Database/Format

The specific libraries installed by each extra are:

Database drivers

Database / Format Extra Library
PostgreSQL postgres psycopg2-binary
MySQL / MariaDB mysql pymysql
MS SQL Server mssql pyodbc
DuckDB duckdb duckdb
Firebird firebird firebird-driver
Oracle oracle oracledb
ODBC DSN odbc pyodbc
SQLite Built-in (sqlite3 standard library)

formats bundle

Format Library
OpenDocument spreadsheets odfpy
Excel spreadsheets (read only) xlrd (.xls) and openpyxl (.xlsx)
Jinja2 templates Jinja2
Feather files polars
Parquet files polars
HDF5 files tables

formatter extra

Required for the SQL-formatting pass of the execsql-format CLI. Without this extra, execsql-format still normalizes metacommand indentation and keyword casing (use --no-sql or import scripts without SQL); the SQL pretty-printing pass calls sqlglot and raises ModuleNotFoundError if it isn't installed.

Feature Library
SQL reformatting via execsql-format sqlglot

upsert extra

Feature Library
PG_UPSERT PostgreSQL upsert metacommand pg-upsert

map extra

Feature Library
PROMPT MAP lat/lon selection widget tkintermapview

auth bundle

Feature Library
OS keyring / secrets keyring

The auth-plaintext and auth-encrypted variants add a fallback keyring backend for headless Linux: auth-plaintext adds keyrings.alt (plaintext file storage — secrets are not encrypted at rest), and auth-encrypted adds keyrings.alt plus pycryptodome for an encrypted file backend. See Keyring Platform Setup.

Connections to SQLite databases use Python's standard library and require no additional packages.

Additional System Requirements

To use MS Access, SQL Server, or an ODBC DSN, an appropriate ODBC driver must be installed on the system (e.g., the Microsoft Access Database Engine for MS Access, or the ODBC Driver for SQL Server).