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-3.45.0-cp312-cp312-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 274423f82c6cc1358bf89944019746aa38fe9bf65b3added1cd81a474e61f90d |
|
MD5 | de3d753f7864e17d02103bba2315eaa3 |
|
BLAKE2b-256 | f205ac5445c97cf5b1473382ee8be053f5d2413403e17403ce6b92aeef438313 |
Hashes for sqlean.py-3.45.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52b113c172e7b43e0e784e610b1186c6fff811f5c58c1ec9ba51e15de9eb7b9b |
|
MD5 | c6823c50933d5753bdf9ad1b848becdc |
|
BLAKE2b-256 | 651614c6ef0f0ad40b21e5d69bcfeeb359630b802fc8f2ff7e624cec0886598b |
Hashes for sqlean.py-3.45.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 484a83fe472e8eac2b3b81889ebcee547cda2a8efcfbd54d7ae007c208297f61 |
|
MD5 | d1135af586ee936730531288e85b4834 |
|
BLAKE2b-256 | 2c6e621a135f04e01c485d24f4302eede46bf04b287e0ead4d6f2cafc1a354c2 |
Hashes for sqlean.py-3.45.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5a94be979fdbeb231db28e4ffdcc1924c8b806979729eadb71f9dd356aabd70 |
|
MD5 | 9688ab3d2e6a3b0ef040a8b4071d7a60 |
|
BLAKE2b-256 | 70f1373cfc290d6d2ead9c9c1a6dfea30fdd48430bca1d21750e2d99a3d15262 |
Hashes for sqlean.py-3.45.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 655ad50cac324cd2395c9b34e9d29981a5da5a61782bca2d8e2d3319094fc6bf |
|
MD5 | 0c9a6a0e79591c97e5277b3f8cc5dd40 |
|
BLAKE2b-256 | 900b66898e674b94862be58965d5a8c1e4c2c89287060c321e09bd4e2f20e971 |
Hashes for sqlean.py-3.45.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26471ceaa36e4c477956f6a004d8376e948fdd4603dba606660ec64216630d7e |
|
MD5 | 372ed61a8ebaba5cffa47838ce46fbb8 |
|
BLAKE2b-256 | 61d71d009808673f6c39d535eeb6faef364fdddc941e104bb206d4f993ec32d4 |
Hashes for sqlean.py-3.45.0-cp311-cp311-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c986852bbae5a67ccec4fe8ef20967d8ed50839670d8f2b32f999621dfedc97 |
|
MD5 | dfd2bdcb1d4d928c732315eb79919bec |
|
BLAKE2b-256 | 30c6c61879dabd0ebcdac9e0fa8a8c8ae9222344d7cd163720f4eeaed6937490 |
Hashes for sqlean.py-3.45.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b46e8c1889db6aefd79696cc9801c7b41969cf4ddf91dc6b4e203430b625452 |
|
MD5 | cd80e64a1ee97305345a9e76e6b3eb43 |
|
BLAKE2b-256 | fbbcdf8fd73e11222c55f8e2c1af97bcc65038df2cf80c2fe7d2102154a66dcc |
Hashes for sqlean.py-3.45.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f1283db3c1393dee2b1e7eeb5a754c4d8a56e4418296379f09cd44c61bea801 |
|
MD5 | 2090f8e2c406c4d41658a31a0cdb5a05 |
|
BLAKE2b-256 | ad17e78d3b6f69ed2e643d076c4d2a57abb7d9c62f756e2a2dcf52f88b6b739f |
Hashes for sqlean.py-3.45.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78bcaba0c135172357b2be83733247e37cdeb67ca1d045e42a02a34d4451be63 |
|
MD5 | ce69e6bd3c4282ac39d5f333c6c8163a |
|
BLAKE2b-256 | 60ba76ea676ea397b221eb623f38379987427133b9f1db8579abe7dcc8c2bd6b |
Hashes for sqlean.py-3.45.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52f6c77ccceff2a702372bd3ebd38094f2c2eb60210f4ada50100f2e665545a9 |
|
MD5 | 42bc38a390ecb50b1ceb82e5bfc33e0c |
|
BLAKE2b-256 | 23bb239778085bc7b2a67e9740275769ead41db3fdda646f4e6b235f38b46987 |
Hashes for sqlean.py-3.45.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b173d363bf83c8fe3cd3d40b6b52164b97ddedab9d3ba90e2863f78e58501af |
|
MD5 | c683f6ad9c4cb20c3a7772f594580e12 |
|
BLAKE2b-256 | 71bb2ff08047381229ca2adde5ed8cdf23d12c2ba3149b74807212dd0561829d |
Hashes for sqlean.py-3.45.0-cp310-cp310-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 478f25a2663c16c08232adcef1cf7745cca0c74eff2e84bf15fd94b05c12482f |
|
MD5 | 27ad035c32e0dc4465fbcc2d972ebd54 |
|
BLAKE2b-256 | e769a7d7cde06211de97a8cfa6f336e8c31299b0d00c90f7abc242278f94ee03 |
Hashes for sqlean.py-3.45.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9afdb298336f7929d9e3a96eed2b6e5c9978d5a408aeaa6a1052b8d31c47a5d |
|
MD5 | 33320a7f56e5c74f24e3970f3fa5bbdd |
|
BLAKE2b-256 | 3399c8514568413680401676412930aee8c0053e7b6f8f2e4de8878fe393d23e |
Hashes for sqlean.py-3.45.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cffdde58a2ee64fc3507044366f559ae7d1d9349d234054661ee9af89a99b75 |
|
MD5 | 5e0d7af3e7072c7d51aa9f9d1c66f060 |
|
BLAKE2b-256 | 963b54085959ff3466a01cc7af87c893e96b49e658bed2d3efed47b926d32c99 |
Hashes for sqlean.py-3.45.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e632d84be7ee6a37152e00b28dea47dea23bddd81feda1ef29a326c746e3861c |
|
MD5 | 84714ea3550da24bd44d180e2d3357dc |
|
BLAKE2b-256 | 86b324bd580e11fc2bd3f63cb016fa4cc4094379588fe5f747b95c54acb5e0f3 |
Hashes for sqlean.py-3.45.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d43e5729a8e4376194bd620c4c30686f7e110328fc1bf7bf9b157d3aef6e1278 |
|
MD5 | 1b1888c81d646cd232e7a96543e8d06f |
|
BLAKE2b-256 | f204ea11e5c75463b147e71e71319b055841544747600b55bba7bb75d588dddd |
Hashes for sqlean.py-3.45.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fe56490a7e448dddeed7ac648f9575066ebf0919d52d59a03f38e98b30bfe87 |
|
MD5 | 078444f464d4cc8d86b354b3d5867848 |
|
BLAKE2b-256 | 21697fb626ccf3b4e3c560b3e263e3379a37ea6abcb75fcdce8835ffcef23ef3 |
Hashes for sqlean.py-3.45.0-cp39-cp39-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9171fbcacb9d533d1b3feea793df21e8cbaddc75023fb87c99279a75f80abd8b |
|
MD5 | a1f56fab556feafb8c1501f1d281d3e7 |
|
BLAKE2b-256 | e69df1a809fc1d448dbf0f9370ad9d4e51eba77632db2c70b7bb24b27942f185 |
Hashes for sqlean.py-3.45.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 976088939ba54003f1803b0b22d9a92f000b7b8c2f3ba6260fa9df9e2fc0b41e |
|
MD5 | 4f42feb8871f1fa7efdb9e46a9ab1606 |
|
BLAKE2b-256 | 4094d00a8b5a8795fcd65d66680457daf133eb9dab87bbfe3fc005f57511b88b |
Hashes for sqlean.py-3.45.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9bac784ae505a4e51d5c673f1bd6a84a0db032e6f8520c5d1b48893020d208d |
|
MD5 | 041d123b9124f00dafc5007324b988bc |
|
BLAKE2b-256 | 0f2d137eec636c68d3fd5186daf07e20ac6e1852b4b924f395422833aaeefd6c |
Hashes for sqlean.py-3.45.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae964bd5398452f0315c40a2bc32a347d63f10654e1f5cbe69dae7b48fa0a0e2 |
|
MD5 | 90347581797fccf309a9f76ef640a9ac |
|
BLAKE2b-256 | 0b331bf0f2206a30fb0f86378b43fc8a4acf1345af4b63ca69d9c9065bcc27ee |
Hashes for sqlean.py-3.45.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aaffe871288445cdb610652194ce808ac6f12624ea70604779dde32e05bd83cf |
|
MD5 | cf56789a27804ec4c4474334d49a17c3 |
|
BLAKE2b-256 | 56121d791358dcb8dc183d74a3668a7d8a1fa2a1c577dbca24f7ceb00cdcd823 |
Hashes for sqlean.py-3.45.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e21b09303170135a7476f2a696445d6f01f223e454c33afd47a5caa3e079179 |
|
MD5 | 114577dd727923e43c83dca346e1587d |
|
BLAKE2b-256 | 39d492ca222ec877019a3e7d04cfe50567e0797c511f8cef4db5261b78c2b582 |
Hashes for sqlean.py-3.45.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25b11e30fb63da8c2d688ef5eb2b6ed73aee5e9b1e94fe8528a252ca1840cd1c |
|
MD5 | f31548bea372c17f1251a0c17763d95a |
|
BLAKE2b-256 | 6231c9c669d36ee09edc06f95215acbf0e1d5cb81dc47560de7164a21e0ba47e |
Hashes for sqlean.py-3.45.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3c93b2391c048949f853115e3b77ce2d0e4963d90cd0549600ac22bf9ae4bb8 |
|
MD5 | b127fc995a9dc85e4a16db29c88244c0 |
|
BLAKE2b-256 | ea6aaf7786e9de73fa5f9b3a480989b90ad8d9b09e21eefb0a546cfffbe53a00 |
Hashes for sqlean.py-3.45.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83365878c0fd0d07f3db8119a690206a0b177cc36282316731c000f85905d2ec |
|
MD5 | 8f2f7345ed7f34acb2da20763d16ad69 |
|
BLAKE2b-256 | e0ca87df82c62ef826e1c6e3cb4e9b8d5a7cfb1d52b11a708c2435c1f35ebbfb |
Hashes for sqlean.py-3.45.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af028964ed19e3bc44bf0064160cb849febb86bc217a65f8971af5596d4d8b73 |
|
MD5 | 9c6cf26905a1f5009a380499f8abfde1 |
|
BLAKE2b-256 | 02af982d023971ee94d163c9bd202385a4fb369b00e1ac3a5bcf50d8e7199a70 |
Hashes for sqlean.py-3.45.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a667af4a37089e2819019526bcb0757c7ebb08f5579118b6eaba3a5c4f9b2f38 |
|
MD5 | c5616d18655593711bd9112cd272b9a2 |
|
BLAKE2b-256 | 24b886b1c3859384b5a7ada70bd5d2544378296ac2f83a134dc8cf632daf24f4 |