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 Distribution
Built Distributions
Hashes for sqlean.py-0.21.8.5-cp312-cp312-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 350dd22de76a2ab44f3ba89582e99aa089ae90e1644b51f1aeaf897634b6d3c7 |
|
MD5 | 360725433fa656bd4d5661a2a5da20e2 |
|
BLAKE2b-256 | 2ddb02c6a1821338b14a0bc5efe344bfd03d5f86e478eedb43b7748a12fdae2b |
Hashes for sqlean.py-0.21.8.5-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b632486718e3866867a409af367043e6b6c4922a21ffde70734ffe6cb6d446ab |
|
MD5 | 8144214346ce1b0d8127584bce77ec2c |
|
BLAKE2b-256 | ee98d117fe8e4095632c79b3b5425de77281d835abc6f4fb0a7851aecd3c26a0 |
Hashes for sqlean.py-0.21.8.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33c1d614af0ffbbd781c56ba975dfb03cdb4f560400a3948608aca87c6b49126 |
|
MD5 | 1bb4de99d4fc6cb92d338cdfa10efdc4 |
|
BLAKE2b-256 | 1a15df41768343b257b5e5e77fcc1d5cd0927567afd2554c41486f414087ba3d |
Hashes for sqlean.py-0.21.8.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5e101bb54f267e07bc9a0a276c8ad4c939309b0d4ab2f62f56b6b6ff7d0124a |
|
MD5 | 32d2ecfa26c0aec9e7844b148d936685 |
|
BLAKE2b-256 | c19ff6ac8cde2acac9b521190975599c2b0a7a3fbcf61ee2b5165fe2d2a99147 |
Hashes for sqlean.py-0.21.8.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 655c51f43b92ef035510a96bcd9365a7afbad7aabc099ba03aa08b7b260966d6 |
|
MD5 | cf21da938cc796610783b279ecfd3acc |
|
BLAKE2b-256 | 387e6020fd23d43eb60729e81d1eba62a69997b28dc9f7ce45880e5d273e30af |
Hashes for sqlean.py-0.21.8.5-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c81aec740da911d54e89bd9b6918da5926d98ae9f87cdc972a9a2745c49fd73e |
|
MD5 | 9c6aa97cf3ebcaf20200f1eaf67db023 |
|
BLAKE2b-256 | fb0bb767c1888407c152fbfa5865624e1ecdc8832292cfe408200125a561849b |
Hashes for sqlean.py-0.21.8.5-cp311-cp311-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1368f77ce4f665f858f09cf1f77b48ff1de747ec52e7b5939c7a8caec0d3a1ed |
|
MD5 | 64051dbfe10f278ce3f0395f4c13b1db |
|
BLAKE2b-256 | 69d1168d506946a2fb0730c9878d602d5a68ee2be6c34416d9c20cf803233259 |
Hashes for sqlean.py-0.21.8.5-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71f836aee785aa583c7b66b14678ab3f2deaeb3d537a20bac2669f1ecd956904 |
|
MD5 | 7da4daf57893f4da463e2fe3732ff37d |
|
BLAKE2b-256 | 0de60ca4593dcacab9ba437c6c32f033eba6f7f70ab7131caeb95dfec43f053e |
Hashes for sqlean.py-0.21.8.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 692b0664d4f43d622917ca698d47511211f06d1497e041e613df5bceab511273 |
|
MD5 | 2523fe888a13bac724da0b9a99b9fc44 |
|
BLAKE2b-256 | c091d87816f453aba1435359d95a9236bcaac44d2f751a633d0076228132da1e |
Hashes for sqlean.py-0.21.8.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acf9178519354e11db5634d8f591f934d15c73d4502c73122546ec2512505084 |
|
MD5 | 1550b0047b1584eed96e2ac6f4e16eda |
|
BLAKE2b-256 | ed81da971c1dedd7cffe77704bc30ec4bc47bd65d2a72e37d61e58566fe45806 |
Hashes for sqlean.py-0.21.8.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0985e78f8f1c9c6e6dd0df0f6899b9a51fbf2b19fff1852885f8751b949d3308 |
|
MD5 | a9b738cc4168f32172f8207f3d280b39 |
|
BLAKE2b-256 | a09065bbf3df775ee37b4af30da672dc8985c3a38f03374c8b6ec5c762fe9427 |
Hashes for sqlean.py-0.21.8.5-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca49a20fdcca110518a6900ab462ae2072b2e5e78fa4453bb542262a46bd510e |
|
MD5 | 13aee6b5769cfcf186913851b5e2b17c |
|
BLAKE2b-256 | f088c3323968f90e6a622b478e44ef1d813f19de18380eb84fb1fc377a921b39 |
Hashes for sqlean.py-0.21.8.5-cp310-cp310-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b432865c2ca29574b89b42eeeae01a3fc8527359f4c66766a7659b59fcf6789 |
|
MD5 | 96985db6e9590b7688b28f09e833d343 |
|
BLAKE2b-256 | f8332572c739d7a431757860d79f8c296b26b4efa8bb43313265eb913d9a3865 |
Hashes for sqlean.py-0.21.8.5-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e12be5422c7c0aaab6795452fa1b9bfb809718874007a6d3f06527142cefde1b |
|
MD5 | 70cd631b77e5a5014feaf3467d6ee565 |
|
BLAKE2b-256 | 9068d863d99ab6baa62f6ef9cb8e62df106abd1ea07de0c4519e1966eb419398 |
Hashes for sqlean.py-0.21.8.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99d051243fa38c3a4c17c32817780cb6319afc8ab86a34e21953d96e7b3823d4 |
|
MD5 | 04ea5b0ed57aab1467457b8d8a315368 |
|
BLAKE2b-256 | 4aa9903e7df36918f1ccbd8f34ab8528a67b2803fcd077c11d42000dd316a414 |
Hashes for sqlean.py-0.21.8.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c12a2f519328ccebeedc4ecdcfe722c95b0adcb4ecb5d46235c9ab36e32afba |
|
MD5 | 786d021aa2f0bb6a18b0d58f6c5e4c17 |
|
BLAKE2b-256 | 71d45a3cd27bc71dd95902224c4d0418cb4ba3156f09a813d119715285633675 |
Hashes for sqlean.py-0.21.8.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c87c5e06f12e511945e44dbcf750d1278c4b8895beb286d47fa6c8ec473e432f |
|
MD5 | 4eb0be91c08ed866a68b806d99c105d5 |
|
BLAKE2b-256 | abc22ddb6dfbd193e8304ba5399714cf61d89172cc6be7f3952ca446724f6844 |
Hashes for sqlean.py-0.21.8.5-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf5f546be1de81d3b27f2ee2ddc18ba8d228d6faadef261cdb15c792ba49e7b6 |
|
MD5 | 26c691085dfe493ddfa5ebd278d9169a |
|
BLAKE2b-256 | 7c254b0ee86b481e0ed5429579cd05ed8cd32d6f322c6d8fa853da34656ea8de |
Hashes for sqlean.py-0.21.8.5-cp39-cp39-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75f049c68067e7fe8a64538559cc084d29c0ba363ffdc6ec794fc35ed1564a02 |
|
MD5 | ce1de6335a41b944bf2d8ee175abe71a |
|
BLAKE2b-256 | b337577efdcf27f34945c1da2c50e9e908b14a24c89020b3b236bb548b0a7956 |
Hashes for sqlean.py-0.21.8.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a1b729e57628aa7cf5f7d738b792788bac2f566459dcd16f9aea1ffc7f296b5 |
|
MD5 | bf0c593b9da3626738bc8085095fdf73 |
|
BLAKE2b-256 | 94d1f1c4192e86580bd7c27b91fedc1105a3c55070949d4ec74ff49d998cc2aa |
Hashes for sqlean.py-0.21.8.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b49891876176e3b3092acf1fd4ae4d6147367341f5cf58501fd2d8cfbc5427f0 |
|
MD5 | e2660ea40a9846f781bc8d6d041a57ea |
|
BLAKE2b-256 | 4fc639d39edb0a08a64982fc5db8e8aa7853e1cac4d352f78f82bc52dd3c950a |
Hashes for sqlean.py-0.21.8.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77bd0e4f105074237b72190d63d6bc0576a8f5fc085f8b1959335454dfa3003b |
|
MD5 | d8c72dd67bbe11a9c2fb5d14f8249c81 |
|
BLAKE2b-256 | 4e683c6f47fe95fcde08ec2344609a7b123024778e4e7149065547bc02f226fd |
Hashes for sqlean.py-0.21.8.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fd03218bc2b9af800b716a1208bd66b1eddc604ece4654cb5d1488c3bb2e69f |
|
MD5 | d9f9c5b47dafad698e3c7b514247d839 |
|
BLAKE2b-256 | 3b62ddd866080a7b71cbcc65a1b7eac3c0197244cda4481fa503684a70108766 |
Hashes for sqlean.py-0.21.8.5-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96cb39fbeb1d89121b08e2d49edcad0c7f4d3dc4c6d370459162b8fb6b25755b |
|
MD5 | a6d3099094f9e03bae7064500eea19b6 |
|
BLAKE2b-256 | fe090d0ac4d110585b55aae3001aec4ed3d9c2b35654ecad6a02366931ab7f82 |
Hashes for sqlean.py-0.21.8.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 256ae2c8215def61651495d56cb6408d7657620319c5af6555d62159ad0bea06 |
|
MD5 | b69e01f627853cdcb9ecf8bca24eb4a4 |
|
BLAKE2b-256 | efb7de4539d25418356549d020ad12484ea54d3c925d9084634a0f8509c868ca |
Hashes for sqlean.py-0.21.8.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c254dfbfa69d13ebf6c257ac8f1f075e4e9a81f459110ff37de3b420c453f8af |
|
MD5 | edb3e6c86b5d2d6a82b2e584499becbb |
|
BLAKE2b-256 | 1379c64610de2ffab251db908778e9ab87a01b181d1c26caed13309c0ed71e9f |
Hashes for sqlean.py-0.21.8.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0190a4dbaaab40b2bed1786edb8df8e477757671eed63921f2fe90b3f4f42a14 |
|
MD5 | 4ad0bf3139943be03cc99404dc997f7c |
|
BLAKE2b-256 | b9249af46ec000c12e4445d11370b3efed22029c9d910e0affbf80dc0bed3760 |
Hashes for sqlean.py-0.21.8.5-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05d1c21fdb3d4059401ba4980b2f0599a23aea0a39c79d07b803bb20e33522fe |
|
MD5 | c7c9e576e3c6b82308aa4b3b77a9a84b |
|
BLAKE2b-256 | 51eeb616acf3848946d1a690dbf9e5963fc75600e8b208bc1fb7937fb15e95c9 |
Hashes for sqlean.py-0.21.8.5-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b6633514a18d3dffe576a70d02ba8949b63f378953cdf61cd34d9918c067f2f |
|
MD5 | d2ed8c0a2b2632e9922dbbdc709f05fc |
|
BLAKE2b-256 | dd1cb9d197c4ef60cdc925f752218a3d14b22eb5a7edb5fc00fd0e8e841033e9 |