sqlite3 with extensions
Project description
sqlean.py
This package provides an SQLite Python wrapper bundled with sqlean
extensions. It's a drop-in replacement for the standard library's sqlite3
module.
pip install sqlean.py
import sqlean
# enable all extensions
sqlean.extensions.enable_all()
# has the same API as the default `sqlite3` module
conn = sqlean.connect(":memory:")
conn.execute("create table employees(id, name)")
# and comes with the `sqlean` extensions
cur = conn.execute("select median(value) from generate_series(1, 99)")
print(cur.fetchone())
# (50.0,)
conn.close()
Extensions
sqlean.py
contains 12 essential SQLite extensions:
- crypto: Hashing, encoding and decoding data
- define: User-defined functions and dynamic SQL
- fileio: Reading and writing files
- fuzzy: Fuzzy string matching and phonetics
- ipaddr: IP address manipulation
- math: Math functions
- regexp: Regular expressions
- stats: Math statistics
- text: String functions
- unicode: Unicode support
- uuid: Universally Unique IDentifiers
- vsv: CSV files as virtual tables
Installation
A binary package (wheel) is available for the following operating systems:
- Windows (64-bit)
- Linux (64-bit)
- macOS (both Intel and Apple processors)
pip install sqlean.py
Note that the package name is sqlean.py
, while the code imports are just sqlean
. The sqlean
package name was taken by some zomby project and the author seemed to be unavailable, so I had to add the .py
suffix.
Usage
All extensions are disabled by default. You can still use sqlean
as a drop-in replacement for sqlite3
:
import sqlean as sqlite3
conn = sqlite3.connect(":memory:")
cur = conn.execute("select 'sql is awesome'")
print(cur.fetchone())
conn.close()
To enable all extensions, call sqlean.extensions.enable_all()
before calling connect()
:
import sqlean
sqlean.extensions.enable_all()
conn = sqlean.connect(":memory:")
cur = conn.execute("select median(value) from generate_series(1, 99)")
print(cur.fetchone())
conn.close()
To enable specific extensions, call sqlean.extensions.enable()
:
import sqlean
sqlean.extensions.enable("stats", "text")
conn = sqlean.connect(":memory:")
cur = conn.execute("select median(value) from generate_series(1, 99)")
print(cur.fetchone())
conn.close()
Building from source
For development purposes only.
Prepare source files:
make prepare-src
make download-sqlite
make download-sqlean
Build and test the package:
make clean
python setup.py build_ext -i
python -m test
python -m pip wheel . -w dist
Credits
Based on the pysqlite3 project. Available under the Zlib license.
Stay tuned
Subscribe to stay on top of new features 🚀
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for sqlean.py-0.21.5.3-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db2fdd0237f082b699094b95dce052a811f2280fc3cf51909d65ad18bd6b04cd |
|
MD5 | fd7bfae178cd2fe4867af2026fb90006 |
|
BLAKE2b-256 | ad0068ba6b923fb1827bf3124a1ca99a636ff171ea1d4837562880538c706236 |
Hashes for sqlean.py-0.21.5.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e85feabfb2806b025fded79f9d1315555e0fbee06a90bd4d10acd6d6a4b2b92 |
|
MD5 | 62c560a53b6f7857aa23bfe351f6aa23 |
|
BLAKE2b-256 | fea73d2dbdf2e954dfb773ed4e505a725a0cc6ba9b71f6a9e572ddee9852fbbe |
Hashes for sqlean.py-0.21.5.3-cp312-cp312-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c36deabcf59e18a8e5a67bf8b82cf8a73db0b942cf3f02cc44f787af7636d8b4 |
|
MD5 | b5cef0220e548c42521d81d510df5984 |
|
BLAKE2b-256 | 5cfec7461312cb8926bb4c3f2655c533ba8f07165b66a82cda1fa5b73e9357d1 |
Hashes for sqlean.py-0.21.5.3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6facce17d6a35b50e5be5fa3afb73c549239fb7653401ef01f42c319d2c24023 |
|
MD5 | 9d58a8319e2f507efbbb6bcfe64a15a7 |
|
BLAKE2b-256 | 19b71c067aebe84d750dfae91e3866d411b3adc904494c67df9f0c6eafac8758 |
Hashes for sqlean.py-0.21.5.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba82d621b9ab55090da9c3f582ee8c6049cbbfd5ace0245736c2470515896eae |
|
MD5 | 3282a887675c2e3a658433739dc4a03a |
|
BLAKE2b-256 | a0459be5ea9463106170e650c810c8299bb9f21acc411c4b3ecc804c8993b01d |
Hashes for sqlean.py-0.21.5.3-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a34abb6ce66d09181ce8490485c7c32564796df1fa51c49909dd7164592dfad |
|
MD5 | 0dbc6b0b4975b9d6bbb4ae6ae9eeed0f |
|
BLAKE2b-256 | 1b014d140c63b0f8c806c3058025492f468668b9014dfe1ff5825ccf9a1021d8 |
Hashes for sqlean.py-0.21.5.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | baeca0d87b6c64b7c2eb41b4c103fd2f0220996e6293c0a53b3fa8aa0e8188d9 |
|
MD5 | 7336b1d0228a9bb03ee60912f9b2c592 |
|
BLAKE2b-256 | 5b7a4e0c6cfa1b88204240cddcd65708bf8854de3cf3971828e99a23395eedfb |
Hashes for sqlean.py-0.21.5.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e16a8317e7125bec4c22a033a971c68fb0e29e4bc014f9efe81a4a66c27011c8 |
|
MD5 | 5fc887817416c2ac7f5daf272dcbd147 |
|
BLAKE2b-256 | fa7b7ba3a88643aa97f67cae4258abccda6f8e4a45c67ed10fa2c7243291231d |
Hashes for sqlean.py-0.21.5.3-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85f7c13c38db401db41b278bfb98037291f1e7775b5433773c021bd54ebc1bb5 |
|
MD5 | dc1d1ccba084a0f36a76df3673edcbc0 |
|
BLAKE2b-256 | c5b780d6b0089ae93e85151f260e1b970d139ed616a07d0ca41c8dd3847fa32b |
Hashes for sqlean.py-0.21.5.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a6d4db8c5e603727a787231fc267ccd7267bd9ded6e0b780351b96f080c8f5e |
|
MD5 | ce176add5ff8fe1298379bf0f436e17e |
|
BLAKE2b-256 | aa20921ced696163607b8f41842b49f600e2e3549676b547031d8ff4bfea44ac |
Hashes for sqlean.py-0.21.5.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cd5fe8e6691a62c376e6fbc772d7668c71eae490c712d73771b6c3f345739d8 |
|
MD5 | 3b08c2b84bdeeef8b2e9922f6862f369 |
|
BLAKE2b-256 | 1660c1d581e9587e25759ad0f907e874c8f4a74a8289bee4a99da9a6c7164352 |
Hashes for sqlean.py-0.21.5.3-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe6b5ecf3ca00c448a5d6fd754e258e3b803f22ed375d944df93f7a3fe5a1b55 |
|
MD5 | 8bbce27b8e789ca051bde5588db85ceb |
|
BLAKE2b-256 | 415f52e569c6bf24e9627033b816898e484952e0c9069b682955a1599c9005f7 |
Hashes for sqlean.py-0.21.5.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bb75059bb43c79ac2032f786d5d9cc9e510db2c070ff854faa3b4c81ade58de |
|
MD5 | 4d426e66da855f9d669fa4e6316f8c76 |
|
BLAKE2b-256 | f1933a3e523374b00e20756b690ad163e2fedb0ef5029d74cc2f9a8aee566f42 |
Hashes for sqlean.py-0.21.5.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67537acefc4bdd4208a14403a79b1757029d020645fd3150fadc4806b7b23edd |
|
MD5 | 1b62f1dc8348ac1677f6ef9deabbbb03 |
|
BLAKE2b-256 | f01df5ef8a348acbbdb4246b1e9dda3bf5371e1308478281c4db822470628c11 |
Hashes for sqlean.py-0.21.5.3-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1c3cc2d824a4d16f7a7ffa488109f10f18a12d3c3e8f6f07f051389c34c9fa7 |
|
MD5 | 3a7e656e546d02bfa1b66642a7269c60 |
|
BLAKE2b-256 | 29f5e6803c3a66c68432fc04afc26a3641e3f5f9f1dde66af3aa83dc174d0b29 |
Hashes for sqlean.py-0.21.5.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe544a46f24b8e20537bb7f37104c50d811fc6bc276162d20e862d9abdbab06b |
|
MD5 | 3f00d0fcff9f5906eb2732f24b5a571a |
|
BLAKE2b-256 | ff4ba3eb52d3681c6fc1401f4b00a96622ea3c684026393df986c3e02b3f0ad1 |
Hashes for sqlean.py-0.21.5.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0324d82a2a841cc25803eccc246dad0aa77ba7427018571e3b97ab5408085245 |
|
MD5 | b53aaac3ffb4bf2d58af6ec14bed672a |
|
BLAKE2b-256 | 86faf145b32e21dd142da3ed65ceb325ad74079a665adcbf25362acb4491c6f3 |
Hashes for sqlean.py-0.21.5.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fef7f9bd046f2cf6378dd7e9c483cc2480cdcaf97605ac9cf72b04aacca7b4ee |
|
MD5 | 1f6dba8a2bccfde050701f2810b728bf |
|
BLAKE2b-256 | 9f3148fe24a80cd5d76618e14734cda05b1279246062dbfb94c9bf1d6b3695a5 |
Hashes for sqlean.py-0.21.5.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81790eed0503cb8f6ac51e3d55a2d76c7e2091859d934eae7c597d285d867d22 |
|
MD5 | d5ed0b62befb4ebbcfd28c56beda865b |
|
BLAKE2b-256 | 8b5c95bb4663bba2710b278f17984927286b933311c7b6d3dcec47b53f171379 |