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 tests
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 Distribution
Built Distributions
Hashes for sqlean.py-3.47.0-cp313-cp313-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a8ad8f8c0b68075c38b0d1a757e3d9f21c67920cac8ee0e5f8f09f349aeaaa3 |
|
MD5 | 1a9804867e1bbad5a23eafcfe195a9ba |
|
BLAKE2b-256 | e33675f71870cef59c48e39fb2901a5bdb8ff24d6eac2eda1e9840dd1dd9ba8f |
Hashes for sqlean.py-3.47.0-cp313-cp313-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b538b1548e3edaa009d218f9923830d6b793e5a2ee608b872efa354951fd98de |
|
MD5 | 1c2805f47770391b9acf689085e7ee70 |
|
BLAKE2b-256 | 4c8af8be68ca9b9dfcef191ba5e1388df3f3640af2e73ccb0d21db6a876258e9 |
Hashes for sqlean.py-3.47.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd5617e36374e8e5a1ce251246d5cf681f41fccaf8a146b21d9ee485d59349e7 |
|
MD5 | d592a6d9a0f8d14c47574fbb63e95e80 |
|
BLAKE2b-256 | 96d6d508db91631034e4b9a83bd24295077c12701b86bd6390309db6ec47194d |
Hashes for sqlean.py-3.47.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10439eb85bdcae30227b6a73fe05c354820fa073e6fdd2eda46f8fa805de313b |
|
MD5 | 12f6342adc4322226e522bc586128063 |
|
BLAKE2b-256 | c6dd9fea3ba5ecaae5c7ac233dd765ab404d4ceb7079417e943c867909dd797b |
Hashes for sqlean.py-3.47.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c80d588f88e5fdcc7552c2cb462d2053f14a9b95fc2e0aa1e23a7c2dee3dd471 |
|
MD5 | beee9a4a4ccda9f945c45f2aa7df7900 |
|
BLAKE2b-256 | 17d672c473265d1dffe25ec288a3d33fd5c640d3da34263f9a2898a67c8d0f7c |
Hashes for sqlean.py-3.47.0-cp313-cp313-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d58e6940b89ed56949df4814f39cd54675d3b3a973f9a558b226d1f1b6fd974f |
|
MD5 | fbc78957197aed363670b602cd265180 |
|
BLAKE2b-256 | 33a25961388857c7988e5e440cd0eae96a112668c8ecb193f790fe5340aec7e7 |
Hashes for sqlean.py-3.47.0-cp312-cp312-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f8365ad002fc114f19133e1404370fcffcd3cec6213cb3096da52d4b3c3d9d0 |
|
MD5 | ab2197013a47d68a571d3dc2efdc1bb8 |
|
BLAKE2b-256 | 8d58f8f60b45ea042a5fa052e5918985b511fd891b79d591a9eb32c65e675f93 |
Hashes for sqlean.py-3.47.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ffdf1ba913e032db863909b15d2af72f06dd0fef5456fbba11d914c2dd4a0ca |
|
MD5 | 060d7ae6966cbfbe6b9be228349d8754 |
|
BLAKE2b-256 | 56b1551af75a98f343f96ffdeb40fbd90c3f1878fac166544e6b4a980831ee52 |
Hashes for sqlean.py-3.47.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3113ec7a68ebf618b4f2f9a5001b9bd4bb90b7565fe3a3405f0b5c15f9cd392d |
|
MD5 | b0f1152ab87a9d6a04abc4143224e4b0 |
|
BLAKE2b-256 | 88cb3b39e761660cab5579a2c12ff0c56c6930ef30da3d6180a85d0198dedb8d |
Hashes for sqlean.py-3.47.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14f9e9616023e29b3248805bab3d8248d905d4e0bb779aeea211a55b2df87652 |
|
MD5 | 38ca3deee3d0c224dd6c7dea12516f0c |
|
BLAKE2b-256 | d651f9f5b766ace1b183d7865219a7622be66922b7c255b58bd18c076da672ce |
Hashes for sqlean.py-3.47.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8330b3acf47e581f437f30db3d1e0bdc30200ef41a28c1d31e7f0918b542cabe |
|
MD5 | d799f0cd4cf034102e066cad4aa2726a |
|
BLAKE2b-256 | 57f5438d7c26af4dba270ac9933774aabf87d5f624d83ee664b09203181b35d4 |
Hashes for sqlean.py-3.47.0-cp312-cp312-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3800f0aeb9a5055199ed82d08c8f457dd9b4b59018902bfdb2f777fd285cb5cc |
|
MD5 | d3ccfc71a43166d4691d4ed92c12027e |
|
BLAKE2b-256 | d755383af2d4623f9eaeaf8a711ed0571bd817731f84190bb3547ff23e9dfbb7 |
Hashes for sqlean.py-3.47.0-cp311-cp311-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f179ab18e905aa0b9bba27383471fbb700d17819e1f2c5f95dc388481cf78c67 |
|
MD5 | 0b91a5788d3a7e1461d298fa8c05b30e |
|
BLAKE2b-256 | 2ffa9ecb3063d480bb8bfdfe53900ab82d6d4c914f71f61e4ee3ecfb62db1f66 |
Hashes for sqlean.py-3.47.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bea1bb0a04a8ac48ff36bc5e2295ed0b71020edfe061c19529e82b1b32184195 |
|
MD5 | 3846526e5aadd86e4c6302110e07b0a7 |
|
BLAKE2b-256 | bad83530c54a5bb9df8d7c7664b3e092072c811961089f4675e4a3080cd788dd |
Hashes for sqlean.py-3.47.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dafe411368358de16126dd642146b41a245bad198dcc87fc7d34faaef7bc0db9 |
|
MD5 | 4119f3be1d68e2f0474a417c1276053a |
|
BLAKE2b-256 | 6ae557223f6c4a5c6722176a042bdf6248bdbf841bb2adbc40527a71cb85a6de |
Hashes for sqlean.py-3.47.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 187c9a41e3e3281542aa76ac7c0b312ac6206238e2dcb7277d1b7a3bc8387098 |
|
MD5 | ee56335a695bc747222d9b86fde35ca2 |
|
BLAKE2b-256 | 125317f13b9ed5ed82d08f91583b39d727d3b6d68adea9e85b746bbba2da9cc3 |
Hashes for sqlean.py-3.47.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f1c9a0321e304cdbc3d375ad1878216e5d93cafdb0fe080ec1c347ca4bcaea3 |
|
MD5 | 6fe0de35a25264282ec0b35b7f8e75af |
|
BLAKE2b-256 | aa496475f7ee86f85cc5be1742ff38cf69ffaa433ffba1e7f298e8b091447e37 |
Hashes for sqlean.py-3.47.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbda96e6f02ff749dea8f5878788fd30ba6cc0fece4d144fa24c4b2def77b85c |
|
MD5 | bb7486e439f30851d5f25226a2773bbc |
|
BLAKE2b-256 | 70d449342693a116edc6be89c084e2181506ad54a1bc879f3cc6905dbfbaa9e3 |
Hashes for sqlean.py-3.47.0-cp310-cp310-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf60e2af902a97d2a07781e6e4ec94f3e07d11518d5446ab288620c06f6bf4a8 |
|
MD5 | b30d4ffe8e157f6ae30027d5fa3aa948 |
|
BLAKE2b-256 | cebb44c05074d2a879b12486d9a0eccefa566010981e9a56c3258b6c6fc65c61 |
Hashes for sqlean.py-3.47.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80b5cdf48a4c402fbf1b6bbbb9191ca42b6dbb0cd8c520dd67e5faa99017e31c |
|
MD5 | 5edb89f38b6e2ce727451a5330fb258c |
|
BLAKE2b-256 | 997bfa8796b30d08bbd2fe1a4a6dee96f328f46fd859a2120f36af30c98af6d8 |
Hashes for sqlean.py-3.47.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5498edc825facb8f6f1a1b30ce454a5a323f49f39dbe5d2369a78856b778f2fc |
|
MD5 | fbed497d15de47657c31cc327b680b1e |
|
BLAKE2b-256 | b5db94afbf4ac0e77fbe5811773d155541753f76f13604a0802bbc07e24222d3 |
Hashes for sqlean.py-3.47.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb7ab546feb994f730db8be07f5effe9545279bf7b4f2bfa0ac4d9492dea80c9 |
|
MD5 | 1cf073388e73d1f25cbf966b5dfeb2f3 |
|
BLAKE2b-256 | 1ce5ef152a5f0ec95455f5d1267566214ab5a284f023291328586a57241e3ca1 |
Hashes for sqlean.py-3.47.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f300081208ab131af5fb40d5b57df8b44daba3c381c90caf177d3912cf5d9d9f |
|
MD5 | d9d1d5e253226639cc38563ef45ab3d8 |
|
BLAKE2b-256 | f270fcd6520f7d4f6f5923a8cf61b33bc8c9b358c1c55bba28e6b0a912053ad6 |
Hashes for sqlean.py-3.47.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 199e3c2e8976971acb189619df5c0ad1d2d5f2113433d5bcc13f63443ccbff97 |
|
MD5 | b74f553f2a66866cc9315278f8aae68d |
|
BLAKE2b-256 | 8a6f52e2a3fec2bc7fbe2920daaa6d459933aa6320334f957abeeddcb2e29e81 |
Hashes for sqlean.py-3.47.0-cp39-cp39-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 761dc254e7962d19449569ad43f44702229708ca9775c6d30562257b053811f9 |
|
MD5 | 81d0b57b9bdc74c50a8ad2ff1daaca7a |
|
BLAKE2b-256 | 5d1f4e1ccb7f9bda6a02530248b6fd8b0999ea651b164da563a5407f63d3c11f |
Hashes for sqlean.py-3.47.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9069e1c80820622cf6ac51372f80dbadacb4f5492abf912b28b6e93bd8ec315 |
|
MD5 | d50c416680c0010b703c89828ce86a31 |
|
BLAKE2b-256 | cda0f5abd2faeff694d380fc7bbd7f9b2ff7cc4270d6d96a85d8f21c7a387684 |
Hashes for sqlean.py-3.47.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86064ceacd6fafdbe1d119c9e2260ee803010cfc30b13b5a9397ff9cc7e6a503 |
|
MD5 | 27cce50959441ccaf0c3103d7b26f3a7 |
|
BLAKE2b-256 | dc9c239b1ab58894d7340cbd554de111aecaec4ae70153cec8f4c158121b1aa4 |
Hashes for sqlean.py-3.47.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 871fdb4026a4a02a563eee260b46daf0d4b2dedcc7447c91ef6b6a97a4e4d2fa |
|
MD5 | 31f00e9a3f0d7ba7453ed1181918b5f9 |
|
BLAKE2b-256 | 5ce35d0c84ccf87d34a92064b365553f9fed5beaec37fe0bde855c51d49a617a |
Hashes for sqlean.py-3.47.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 729110009bcf04b7c81c1f73608b3827d0c9e32dc720db1e7b22947bc138b660 |
|
MD5 | 9c5f3b6f012024bb92ee419ce5028a5d |
|
BLAKE2b-256 | 1e21cda48c840ab60736aefbd0ea835fe61855a892cf468f2d0e044899755cd1 |
Hashes for sqlean.py-3.47.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4201931ef9842caa5587d40519bc286a48ad0eb064864359db3c34ea96821b9c |
|
MD5 | 523986181652729148ee54b574cfee42 |
|
BLAKE2b-256 | eba47e7beb15d8bae39efa9ea82b79079dd2576b196d0fcbfe4e3a944b16ba98 |