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.1-cp312-cp312-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1caeb418399cd9ed4bcf3a43b1a191e4e9a91591efee14f915c54f21d845a28 |
|
MD5 | 53249a4a7e4dff7d2a6ad8c766ca7d87 |
|
BLAKE2b-256 | b7bf0081680bb960a4e00f99dcf22df983da6340f1f1d7ab22434c8c921c49af |
Hashes for sqlean.py-3.45.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb4efe1676bd12562d103afdccd38c25a61fabdd7e6848a6c7c3a3539892d1c6 |
|
MD5 | 4d287f5dc68fe5d95c6b6de7414208ed |
|
BLAKE2b-256 | 1506aac1cfbeb06e49e1f62de20980ff56a107df5f6dd84f80ddbafcb1f7f700 |
Hashes for sqlean.py-3.45.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a0f6dab515db60bac3cebd3a570e1139584ee5013bc2195c1ff035fa4579647 |
|
MD5 | 5d48b6ae698a077337f15be7df895d62 |
|
BLAKE2b-256 | 822f1222977147cea87581fe0b420a7ec2a58ac42e969d7c6990541371b54f1f |
Hashes for sqlean.py-3.45.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d6ed2cb09fd3412c29e8be0fa30fea4adc592e20cb78685bdf1022db2e7cb19 |
|
MD5 | 2c7175526f864d7cf478a1e3711bb52e |
|
BLAKE2b-256 | e70be9dff11fbec932057fed53cfb8f218a85859c09ac3a4d56c1171c4dc8e87 |
Hashes for sqlean.py-3.45.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5382245b65c985163fadeb71e9acd0ea91c943a66822a3d29613da35ed9696d0 |
|
MD5 | 88d9093155ea0863896deeda4cf4feac |
|
BLAKE2b-256 | 1e8fea7e51ae4b9b65ebf5b7e7f43f012020ddace6c481d4c3711b3eb2166f9a |
Hashes for sqlean.py-3.45.1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c137e6e27c184e1ecf6ca64a02a4ebf65b2c49c91e276da0af01662ef2066b2 |
|
MD5 | b2d26dbbc011263dcf7028386f85bfec |
|
BLAKE2b-256 | ab372505245801d3b4602605577e8c842de2be401d84ff257c34fa03acd49d4c |
Hashes for sqlean.py-3.45.1-cp311-cp311-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 960e2a0abf52a377b7c9397c58ef532407691990a3315a86480b1a2cf8c357e6 |
|
MD5 | 82d77b33d202271f7eaf5ff038088f14 |
|
BLAKE2b-256 | 069aee57d91abf333cffd177beecf1414291fedbbca089b7ceae1c166ec86e32 |
Hashes for sqlean.py-3.45.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cec2b75b5abcfd015b9497a064eb8084499f40a3df68b649fdc99998f9349d9 |
|
MD5 | 7cfccd6e5232233c0b63a1ca400b036a |
|
BLAKE2b-256 | 7d5268b1eef46513d775ed2100faa131952f280bd5d8709b817470ebe55ce7a5 |
Hashes for sqlean.py-3.45.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b0deb276d66c5e9377f70c1f8f4fad8fdf4957f632e73a248bd88479f0a8cb5 |
|
MD5 | 4361d921afb207e2010470474cbaac03 |
|
BLAKE2b-256 | fcc0992d94ea03a2c59cdc15d808f2a218309ea0beea493aa88b6b25ddcfb80a |
Hashes for sqlean.py-3.45.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a1e79990ed800a91db2eb3880fd18bba78e633418bab51f76117e2416664b0e |
|
MD5 | 7e6b42f0a0b9d03b88194c858ac6bd3d |
|
BLAKE2b-256 | 2cd63459c40b42ea3635fca24ba41a37ebb2792424f531193560e1ebce06067d |
Hashes for sqlean.py-3.45.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bf57ae5b16bbad14064683a7934c32c361f13e4f2336bc261ac464cc279ae2a |
|
MD5 | 2ab5e287e88bacc3546f75a07a66b8b2 |
|
BLAKE2b-256 | 34f07aa8f12697566740700a0b4aee93a9ab9c1fc09d9c485b31a197297359e8 |
Hashes for sqlean.py-3.45.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39d737475a18ecf7ed2226bd111311b5c36208aef961b590f52ded3cdb21ee6b |
|
MD5 | 1f8a4906873e9b88f8b1d182652c6fc6 |
|
BLAKE2b-256 | 225051b3621acdc9aa1405360d60636d386dbd497d3bf0d4bacec55da96bf4a6 |
Hashes for sqlean.py-3.45.1-cp310-cp310-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1caf8ab0a70fb17895f75acc2600b12cb476511f3b15cee70247178003a7f2c |
|
MD5 | 179cf4431f0907a4070a8a694e25db55 |
|
BLAKE2b-256 | 68e53f4750eeb26d6cd0953f8d77eca8fddd07b8589fdafd5ba32708b92138bb |
Hashes for sqlean.py-3.45.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d053f2550cf2d1a140e0fc9adf6a4349c8e5579c3e377d44c20be90082805f85 |
|
MD5 | 7d3564edba71e9522b5fda202c64d7a9 |
|
BLAKE2b-256 | a4af3cf0e169a2da25516d73bea949682fd24b81176e7c90237a50fb39847873 |
Hashes for sqlean.py-3.45.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 779e6b09979e90ee1efb1ff6bfb148318332c763584725dddc48d590cdb583d2 |
|
MD5 | 3a98b4232969df1f7b45dd7578a8ba86 |
|
BLAKE2b-256 | bc1260985ca1c04fdb9ddc502ec808d8eda5d8f528eec0c87193ecf528203468 |
Hashes for sqlean.py-3.45.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfa709b6be8bef0f98290f48326622d99f6f816824dc9d93ec33a387857609e5 |
|
MD5 | 1c3568641056d67314bbcc5332d76859 |
|
BLAKE2b-256 | 721806dfe73ee6967195b9b83e90ceb13c899e4e192979f219b6f411f262ec0f |
Hashes for sqlean.py-3.45.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7be7d2b2a0a6909c2621160208578450a569518324e7e174337066cf4922e4b3 |
|
MD5 | f7e9797e15406c791d5e57d7a310d0e0 |
|
BLAKE2b-256 | 83aca230b20323b5b33996c6c982e554a5173b6b98c6f28668dae0f8822de789 |
Hashes for sqlean.py-3.45.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24f01e1aaec8db4b6e9d05aeb28701fd30666ad8b388c276006e0e7b5f1db236 |
|
MD5 | d382b27d3445eb66ef873c6e0b105346 |
|
BLAKE2b-256 | 31721be1b56b8b4919e086fdfdcd70302daa497ebaae56e2203d6e902aa56586 |
Hashes for sqlean.py-3.45.1-cp39-cp39-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e35e9e250fba29c934414c2319f80ee662cbf480860e79500329aaae8483f35 |
|
MD5 | 0384e8b4d04251b8cac0536deba44891 |
|
BLAKE2b-256 | 4feac6bfcefacc1f3e2a79ed3f5bf5cae634f92539e8b8689c3dfcce6e729b0e |
Hashes for sqlean.py-3.45.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 758a1068a63ebfb940cf1667a319c21fd0f4d29c416ed515098372528a0a84d1 |
|
MD5 | cc579a3999b0bcd39ba91962e53bcfe7 |
|
BLAKE2b-256 | e4ea9386d51a7ed2d9e535da76048ee88bc0f6b6f7b57fe7c21f3e65bfc0ab87 |
Hashes for sqlean.py-3.45.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9df116c82fdc0c17799763f7d5ddfc00e076553d6889eea3eb282974a484e8f9 |
|
MD5 | 3d2de9d8d5645c4788feb65dc414985e |
|
BLAKE2b-256 | d01dc74edbcec552adbd91510d29942a3cd32c690499db30dfc8e7a08c46530f |
Hashes for sqlean.py-3.45.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b80ddf0006aaaf0067a538d311840cdc79371b8fb9be313eca2a1119c62fb3a |
|
MD5 | 09d47efd31c6e0dff3d40ef1f2c87e11 |
|
BLAKE2b-256 | 20adadf612b94db66f811a58c9b13b05879733f2a15aaea0064f22d1836726ac |
Hashes for sqlean.py-3.45.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e11f9571efbde1c94177ab363ec465d005cf02be4a325b4cc21d96c15754e72 |
|
MD5 | c4fa8dd560cd4699d10b2be9d9ffcb85 |
|
BLAKE2b-256 | 7854598709daf3dc04597d43dda1b3c1ceabbd33241a1f56e7036957c29085df |
Hashes for sqlean.py-3.45.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca355f1ecfc64749cbfba18c4766d02cc416e96f369eac0fdf1c982f1658e9e2 |
|
MD5 | c9227d33f22212e45cbd25ea141340a2 |
|
BLAKE2b-256 | 53208b27c5901059733421b0ab0aefd67b42c028e94096c5df2d2c907f228c13 |
Hashes for sqlean.py-3.45.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdd57c080a55fb43c93c3d6fd6a2f1c37f8338acb8d603a1d701c0d9a113c9bc |
|
MD5 | 6baffdc45db5f1fce3ebaed6ebc3cb34 |
|
BLAKE2b-256 | ac7e0216f5805e49ebb46252c9092345cd9923306a8d6de598ed8e92895edff6 |
Hashes for sqlean.py-3.45.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5599b61db1f2775d28ce1ea47a9bc8a3f7205536fae9a54d51aa55421f9368e0 |
|
MD5 | 99b1e5dd2545fefc5a792f7fc6e5374a |
|
BLAKE2b-256 | de9c2c499c6c7ede1daf46671f72655fca70103cbdc370b7e412ed39bb7f86e1 |
Hashes for sqlean.py-3.45.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e9bb153f818f4639e6c4a3905dfd26d6c5d8f2c9e7828a91ef2c17a22dd11c1 |
|
MD5 | c5791a7af85632e177540eedead1631e |
|
BLAKE2b-256 | cb49f258b2bae59d95a69f96eeac9b71e8b5ed829e7001ef80cc72e65fd7a472 |
Hashes for sqlean.py-3.45.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 892fbd9bdcbeb7f4b755304d87efbde91c1a181b4614d6ef145a1aa932d08ebf |
|
MD5 | 75f962db2e073a7d6b36740a1256717d |
|
BLAKE2b-256 | f78b13317da241c047ff3d08b6caee94b9f498785c8d5f9e5b9902685850644e |
Hashes for sqlean.py-3.45.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2cb3a7e732551d95a7bb58e52f70b7f0db2b1614d1446b6991ef0580c92c401 |
|
MD5 | e825252607c946939e527bb22ce7c86b |
|
BLAKE2b-256 | 25ba98dae6796773626eb5b11d3f3871bb957be5bf3630421a04ee38363ccde0 |