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.8.4-cp312-cp312-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3728a293d057d7fa748b7ad2525fed8d7f77a71ff9c8c3a1828a95c4b4300a21 |
|
MD5 | b9231dfa7bc0e7990d5383c03bdfaf4a |
|
BLAKE2b-256 | 8d70441cd978af3880353de2108dbfcd1684a38878bf4d23c89564600ab2d90c |
Hashes for sqlean.py-0.21.8.4-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf344167831db05e820ce51bde61da1fc87717bf20c3370271dd9a05f84e479e |
|
MD5 | e96444bad2075a6b3131d0a009e280b5 |
|
BLAKE2b-256 | 69ef83f3bd878a5a01de5705f5894d3d21f6059f75da2204baed6b6f28b00b28 |
Hashes for sqlean.py-0.21.8.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ffebf3d23df1d12ae046231c23894345cbddf586a2df4802906a47c16f9053c |
|
MD5 | e102a9f1bac6f360162e0413f1ca525e |
|
BLAKE2b-256 | 915356f3cb894b106c5d29d33b6c751e057581f35cd6e3b9e195b88b5651ae61 |
Hashes for sqlean.py-0.21.8.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 755d0bf25dad640a2f03ad22c568a0ebaeab43ff26e1007f939cc473c9109603 |
|
MD5 | 760f352ba5d6e0e7679bdcfe9ae36a53 |
|
BLAKE2b-256 | 12f831a076190da73ee1b92b65bbde97263abe844d560c05ac5f33622c817c29 |
Hashes for sqlean.py-0.21.8.4-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 109a05fc732bd3b4b2346c2be07f164c0469b704a85075baa62996749ca153d2 |
|
MD5 | 19b94b870210b5e9bb2698fd6388da5c |
|
BLAKE2b-256 | 6c68c1d75f506aa44bfbdfa767cdb93a71781ccb21e26087171cc44bdaf802e9 |
Hashes for sqlean.py-0.21.8.4-cp311-cp311-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8d001aa07eb7ef141637429127d9537aa1c9a85756dd475b2b215e8fafdacda |
|
MD5 | 38237f43d889d72c0d8dea5194927e4b |
|
BLAKE2b-256 | 6d61081f8facd8092755c62960f932003a29838be6f3d28ee97b3b0a4436fcbc |
Hashes for sqlean.py-0.21.8.4-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9592e29d2d758f15f75de3116bb81ed2027f79fac5ef240f4a970c7a39a9252e |
|
MD5 | 7c1abbe4bba3f86ef6762824808cdd08 |
|
BLAKE2b-256 | 59280e45cc1d50665f73cce98fd79c04cf4cc8c526bd2b443fd9e49848388f9e |
Hashes for sqlean.py-0.21.8.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26e19dc536d216ea827d1d7fa3eb8dff87d356526b6ebd32b36c271e81774247 |
|
MD5 | e24dbb8db914bf5118483255da759cd4 |
|
BLAKE2b-256 | 3fdfcdf2c01fc205d512e78b071f4619553b3239747e5b45304c8b498e6757cc |
Hashes for sqlean.py-0.21.8.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 187b1c5095ac7f9be1b845b7fa79a27285021bf6bba8bf6a8079bcc22572ad8c |
|
MD5 | 1c93bfe2e1fae5823881a10fc731a4e9 |
|
BLAKE2b-256 | 472812b6f495e8f874fd6a33fc5f276589ae9a46f1b372db14552b81c984d94c |
Hashes for sqlean.py-0.21.8.4-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc619fab4169d172181752321416d9685ca0d1f4be25559ef80b96d456df37cf |
|
MD5 | b9116ecb33eccbc93bdb223372b5453c |
|
BLAKE2b-256 | 985953588b80bef20b441567653aedc8dbdf3ac95d4919fafc5a083a9b5a0657 |
Hashes for sqlean.py-0.21.8.4-cp310-cp310-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 317a7707a6f3074a2a09c9aac659aaf4ed2441c3fda72c1f8335f47d5bdc810e |
|
MD5 | 9042e7bb729b906a8fc73cc45958680c |
|
BLAKE2b-256 | 8cc3da4279a245be66568c2a43338e4878b2b8f8a7815202d96fc86f8198e59a |
Hashes for sqlean.py-0.21.8.4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43fc96018a16f055426bf982469b2ed4e8278f7d98527a1d62368a88480f1877 |
|
MD5 | 36f6925ed219973fc3dde8775004639f |
|
BLAKE2b-256 | 28b79f929026fab2254bf82e287945b05bb82dab30e846b28d01473153cde8fb |
Hashes for sqlean.py-0.21.8.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dca60b2f16a739c27950a0c20f903ca1101ca136081098072ef871027ba5478 |
|
MD5 | 3968e143489a523b7d7bf04895627328 |
|
BLAKE2b-256 | ab99e42ba598ddcbd7847ad615da39b0d448d4595857b6b244bb4c2874aa04b5 |
Hashes for sqlean.py-0.21.8.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f909e05c2434e54c553f45b9e46b8716c6ad66def160a5336c262c50797a82f |
|
MD5 | 169b65fc69a166283a17a7fc23635de1 |
|
BLAKE2b-256 | 07257d05e677d198f1dfd7845b218b60d0faca33e52948f182b5ab3caa402d0b |
Hashes for sqlean.py-0.21.8.4-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20398ddf96e9fd62b57340b433a711907cbe0ed68462afb024343a222f79bb5c |
|
MD5 | 8fec6182b04985f27e2af6f5e1d2f41c |
|
BLAKE2b-256 | 26e2fbe00854833cbe38943336d36c5b1282782aa82e8db08f96ea2f1a33ff6c |
Hashes for sqlean.py-0.21.8.4-cp39-cp39-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1c5a7cdb549fed3ccc0b986c0961862638118f6648924526700ffc2a141549a |
|
MD5 | b9afdd09e1653efc199619ce90ce6c77 |
|
BLAKE2b-256 | 7812bdfc6775770bf35b435542d2022055ef3dddcb3b81abe3403bd2d1c697b7 |
Hashes for sqlean.py-0.21.8.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3feed41b4b11cf9c39ce96d006b46bda02c52592695f221b3a1a892006869ee |
|
MD5 | a6c302fe2beccb149b4f7647caa08003 |
|
BLAKE2b-256 | 7fe158de56adc974398555ab57dbbd524fef81af4027518d224c4cd5c2175119 |
Hashes for sqlean.py-0.21.8.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe7b888bf112b7258a753eb55fe0953099ad84b46cfcb9fbe4cc5ad3a8d00017 |
|
MD5 | c54a96a45da9c96b00b2a78bfdad0ad0 |
|
BLAKE2b-256 | 9f9070d37e09baa8759a38e9252ed6959762531060fa345fdedf211be651b239 |
Hashes for sqlean.py-0.21.8.4-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 282996599ab53cf84e89a0ec96e7edac5b31e585ec28c61f7153f9bd3de0fc5d |
|
MD5 | 1b773b0f59b945c797060bcf9b1f5a79 |
|
BLAKE2b-256 | 5b3d9b4feba4b1deb9467cd103b854c22718596cf3789d4ae923dad9102d4251 |
Hashes for sqlean.py-0.21.8.4-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e0c253a3f06c95e3b37412ae17424d6428ee3890ebb44b2ab792e8be7064b19 |
|
MD5 | 7dbc0eb1c1275b8034b971263b29e373 |
|
BLAKE2b-256 | d3579c2d807dcecf7fc305def04358d600ade912046db8cfe375e7f9d562e7dd |
Hashes for sqlean.py-0.21.8.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4366186b4fddb5dfa20eecbf50af62880aa3912529b6758e295d5319c197d15d |
|
MD5 | 71b7cb597ce3877ac0df3c25c15cbea2 |
|
BLAKE2b-256 | 2010cb3ec0fd9be15ba84dd6104c6c6bce8795c60da0ccc53777aa27b1c0ef38 |
Hashes for sqlean.py-0.21.8.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3065ae0211008ca3023069f0f03c609aa1552a5ae370d36e4cb0b2494e7e81a2 |
|
MD5 | 2b537faa7966b49d85dfb99fdb469317 |
|
BLAKE2b-256 | cd6180ad90deb4ff27ee7aebbc847aabfc183cfc13a25a327d06093e60f0ae33 |
Hashes for sqlean.py-0.21.8.4-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 319a908df98d1557a3898e69c3c0aac071e7e8e4e13969b563b9a4b212bb70c1 |
|
MD5 | 69923ec1a94a4dede753c9d82c5e3149 |
|
BLAKE2b-256 | ce758c1abfb7eb74b2adff5a4a0ed27f639473637bcfd0ecaceefd0839ce6af5 |
Hashes for sqlean.py-0.21.8.4-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dc49731e088f8f6f87dbf8208c0ee45d91256f6602b95284b2a7f5c9083f6bc |
|
MD5 | 22077fea340db48edd820b117d460601 |
|
BLAKE2b-256 | 6daf0bd11b57dca6a64bac642943ca8bcf770ce18aaa54d4e35fb08467264c04 |
Hashes for sqlean.py-0.21.8.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5748d3e90f7c984a3ed79867f5349832b94846ddd95870dea33174c350e6204 |
|
MD5 | 3b91c7a0c980681077b6ceee6f7a0871 |
|
BLAKE2b-256 | 860a1ceb7bc899e8dac7bc14f6cf8f261b58df52e0a0a28fed4c58c523d010fb |
Hashes for sqlean.py-0.21.8.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a18b03bca905407ad7e6e5a02a72f9ee5d8a10309bd7bf592da203b573c8db7 |
|
MD5 | d9eb7264fcc9ac9556ecfaecc3aafafd |
|
BLAKE2b-256 | 40a4088bb9c9527700c4bd4ac46c6ebf513b25998fb3e27d865426382c1ef049 |
Hashes for sqlean.py-0.21.8.4-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 138e334431555ce6051e966c2acb360ea73b90c296246e01018f837605230aed |
|
MD5 | 3e09ad1e7b85719be183d4d0fa2f6c2b |
|
BLAKE2b-256 | 2892cbf95d20c56ae88157d4ea9a3fa796b470443ddea58956212b77fc834f16 |
Hashes for sqlean.py-0.21.8.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11a0e5a8bfc269aac6bd17e9c552117cc99a8e3796086eb57fdc5fc62e631a11 |
|
MD5 | 33050a8b1e240b250c9539bf92399ac2 |
|
BLAKE2b-256 | 4af5d1b06eacfdbcffea1098946c09aefe04ae681e496fb7035ef0db3cd39285 |
Hashes for sqlean.py-0.21.8.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b51270eaefdf7443f773c25235e8b6fdb5a71dd207f44ba8855438762b3d798 |
|
MD5 | a8b785d0a4781d76e2d4763782179fd6 |
|
BLAKE2b-256 | 62a3680ab3183493bee6e7cc4e075791395dc50265c240c6658d30a2abd659ab |
Hashes for sqlean.py-0.21.8.4-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e121984e3238f579a96cbbdf8d398b90274c7681e850b7b3e9e1b6e16ad91d3 |
|
MD5 | b2ca8f50e82f079cba1f1e5c50dac32e |
|
BLAKE2b-256 | 94e1a64490b84832c674f517d9ab436ae3bb2d3ff1328414ec490389431e2b90 |