{"id":2782,"library":"sqlean.py","title":"Sqlean.py","description":"Sqlean.py bundles SQLite with a collection of useful extensions (e.g., crypto, fuzzy, ipaddr, math, stats, text, uuid). It provides a drop-in replacement for the built-in `sqlite3` module, offering enhanced functionality. The current version is 3.50.4.5, and it closely follows SQLite's release cycle for major versions, integrating Sqlean extensions.","status":"active","version":"3.50.4.5","language":"python","source_language":"en","source_url":"https://github.com/nalgeon/sqlean.py","tags":["database","sqlite","extensions","data-processing"],"install":[{"cmd":"pip install sqlean.py","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"sqlean","correct":"import sqlean"}],"quickstart":{"code":"import sqlean\n\n# Enable all Sqlean extensions. This must be called before connect().\nsqlean.extensions.enable_all()\n\nconn = sqlean.connect(\":memory:\")\ncur = conn.execute(\"select median(value) from generate_series(1, 99)\")\nresult = cur.fetchone()\nprint(f\"Median: {result[0]}\")\nconn.close()","lang":"python","description":"Demonstrates connecting to an in-memory database, enabling all Sqlean extensions, and executing a query that uses an extension function (median)."},"warnings":[{"fix":"Call `sqlean.extensions.enable_all()` before `sqlean.connect()` to enable all extensions, or `sqlean.extensions.enable(name)` for specific ones.","message":"Since version 0.21.5.1, all Sqlean extensions are disabled by default. Simply importing `sqlean` will behave like the standard `sqlite3` module without additional functionality.","severity":"breaking","affected_versions":">=0.21.5.1"},{"fix":"Be aware that version updates primarily reflect SQLite updates. Check the release notes for the integrated Sqlean extension version.","message":"Starting with version 3.45.0, `sqlean.py`'s major version now aligns with the underlying SQLite library version (e.g., 3.45.0 for SQLite 3.45.0), rather than its own internal versioning scheme.","severity":"gotcha","affected_versions":">=3.45.0"},{"fix":"Upgrade your Python environment to version 3.9 or a newer compatible version.","message":"Support for Python 3.6 and 3.7 was removed in version 0.21.8.5. `sqlean.py` now requires Python 3.9 or newer.","severity":"breaking","affected_versions":">=0.21.8.5"}],"env_vars":null,"search_vec":"'3.50.4.5':40 'built':29 'built-in':28 'bundl':3 'close':43 'collect':7 'crypto':12 'current':37 'cycl':48 'data':59 'data-process':58 'databas':55 'drop':23 'drop-in':22 'e.g':11 'enhanc':34 'extens':10,54,57 'follow':44 'function':35 'fuzzi':13 'integr':52 'ipaddr':14 'major':50 'math':15 'modul':32 'offer':33 'process':60 'provid':20 'releas':47 'replac':25 'sqlean':53 'sqlean.py':1,2 'sqlite':4,45,56 'sqlite3':31 'stat':16 'text':17 'use':9 'uuid':18 'version':38,51","created_at":"2026-04-11T01:42:34.427284+00:00","updated_at":"2026-04-16T22:14:20.111823+00:00","problems":[{"fix":"Run `pip install sqlean.py` in your terminal to install the package.","cause":"The `sqlean.py` package is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'sqlean'"},{"fix":"Replace `import sqlite3` with `import sqlean` and use `sqlean.connect()` to ensure the enhanced SQLite module with Sqlean extensions is used.","cause":"The `sqlean.py` library was installed, but the code is either importing the standard `sqlite3` module directly, or `import sqlean` was not called to patch `sqlite3` before the database connection was established.","error":"sqlite3.OperationalError: no such function: hex"},{"fix":"Connect to the database using `sqlean.connect()` and execute the function as part of a SQL query. For example, `conn.execute(\"SELECT jaro_winkler('apple', 'aple');\")`.","cause":"Sqlean extensions provide SQL functions that are callable within SQL queries executed on a database connection, not directly as Python functions from the `sqlean` module.","error":"AttributeError: module 'sqlean' has no attribute 'fuzzy'"},{"fix":"Consult the Sqlean documentation or reference the expected arguments for the specific function and provide them correctly in the SQL query. For `text_similarity`, two arguments are typically required, like `conn.execute(\"SELECT text_similarity('hello world', 'world hello');\")`.","cause":"An Sqlean extension function was called within a SQL query with an incorrect number of arguments.","error":"sqlite3.OperationalError: text_similarity: wrong number of arguments: expected 2, got 1"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"3.50.4.5","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/nalgeon/sqlean.py","docs":null,"changelog":null,"pypi":"https://pypi.org/project/sqlean.py/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-28","next_check":"2026-07-28","install_tag":null}}