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.3-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d38f179eb947ff9b35d017ab56496dabf21cf43bb1b838e86f2eb36c5ff73f12 |
|
MD5 | db3a7a4b49c545195b347b1c3ef4854b |
|
BLAKE2b-256 | af4b4f4ffdb27444213b9abfd258502bb9b5eb8209ae69f5e4c1dfa853c52f08 |
Hashes for sqlean.py-0.21.8.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a6636ad454c54959c71d2a795277c43dc0e1334766316b2796b60042a12197d |
|
MD5 | 10ce40229bdd325bffea352e716b67a1 |
|
BLAKE2b-256 | c60105cf5550d692d2a7fbbeb8b9a7714f14963cf2c6e23b0416a7250d6bfd6f |
Hashes for sqlean.py-0.21.8.3-cp312-cp312-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 385a3dcae3fd39a6b5cfcbb6209e23a2bc06875dbaf38f587ea8f7cabc9b9d81 |
|
MD5 | b34d274231ab63ffc9fa248e4b77ddd4 |
|
BLAKE2b-256 | 3aca684001d8e5fca4a6a122fc808e808f3e03b0c52214d9c11a13c94e8eb4d5 |
Hashes for sqlean.py-0.21.8.3-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2282b4665bc3f8b624e87f8a1cbd7c9f1fe75e69cc7f6dbb5ab363600225c31c |
|
MD5 | 6a6548cb81931e7860cb652d84eda0c9 |
|
BLAKE2b-256 | 892b634a19ff9fa94791af31c1f267029c9f8b2660ff02321fe91d466e8eeddc |
Hashes for sqlean.py-0.21.8.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9a955f061d91fb32324ccf568bc405f777b41ed8bddd0e556e02069fd523792 |
|
MD5 | c978953416a1df445b5b0ffc43e4e6b5 |
|
BLAKE2b-256 | 931f037cb18384631235812eb4a436fa2be3a967fc7312ba85d0e3d50d6c1ad2 |
Hashes for sqlean.py-0.21.8.3-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb8712feedf39e56eba080adf6cf52bd2f2b15cf8355a6b9c84f3ebb75371bbe |
|
MD5 | c5270a81b8b28a007b60a31cec156464 |
|
BLAKE2b-256 | 1606bc3ab8a54d0bd7038cae9b555a86b3d66de7eca1596cf812391e992c28a7 |
Hashes for sqlean.py-0.21.8.3-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35a564626acc3dce792cb7cf601e4db8deaf6d2db3159c3f4436c12a64d5974f |
|
MD5 | e1ed3d679660887e370cef397539cabc |
|
BLAKE2b-256 | 246168a7246ab8e50eb28d5fb8a32bfc55d8e13dfe5af96fe7d3a56b838082ad |
Hashes for sqlean.py-0.21.8.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 740aee63a0c0b9cdff12e7017da0610f5d006d83fd2c66b82a0615eeb4a12347 |
|
MD5 | bbc0a0f371a5b886118c211bf144822d |
|
BLAKE2b-256 | 23acf5282b65802e4f85e9d1d70af40afa8d3a62d57861604d224f768426a7e7 |
Hashes for sqlean.py-0.21.8.3-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b586ec34dec8a75754862ee1ea2147324748223b7b8199de7630976930998a75 |
|
MD5 | 8885626b34581e9643fda358c91eb945 |
|
BLAKE2b-256 | 9de8efd32fca20064814018f227feab132881d62400221cd4c703bcf5dad1c46 |
Hashes for sqlean.py-0.21.8.3-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0511366a1c03ad7fdf1fdea21ea482322c8079923b18c17aaf47f2420e85b151 |
|
MD5 | f36d90196b6621dff460be326e1444c2 |
|
BLAKE2b-256 | a0a9c9ae1e5992e2ecd8f4174bf32b165c914ecaba2e4fe4f6a26536a7f0301a |
Hashes for sqlean.py-0.21.8.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aea106857261ada09e9cae65614417464007780c176fd4f54ae5360efdda1a02 |
|
MD5 | 95d4898e2b942bba1900dfe86e8049d3 |
|
BLAKE2b-256 | d45d798de4e7979be57123e0716f4af3b225f368617b1508d2c878afc19ef47c |
Hashes for sqlean.py-0.21.8.3-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f6ca9a996cf3800d4554fb063226863bf6700fdcc14276bd1e5897e172a071a |
|
MD5 | 8c84291a7fd2c2226a40c39b9e95003b |
|
BLAKE2b-256 | b5a0f64b5b38905f49148faa706ea4dd229a3840754bb0314868d0480b0cf460 |
Hashes for sqlean.py-0.21.8.3-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 657b569671dc2856d528c7394b73ecf3ab296bd169a3d43d2d83fbc3088fb3c4 |
|
MD5 | 2e068095dd4667be6a05e1cdbad441ba |
|
BLAKE2b-256 | a4668861987a2981ed185c67d1cbfab7669b5b9d16608479e4a2ddcfa394a89e |
Hashes for sqlean.py-0.21.8.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d69040c4d381744f12a14d6b3905fd52dad4af4462bf4c1217c232fbdd665548 |
|
MD5 | 6150a8fd151d3e06434a98d7cb1b4843 |
|
BLAKE2b-256 | 369ba8a5e45039f977dec843d448318266b9efdbd07f7c8933e30c4a48469768 |
Hashes for sqlean.py-0.21.8.3-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 615f6259f892a230c2a61cdd7e816a275e9096d73012d42d1e97b578202edeb2 |
|
MD5 | ced2bf0d5250db4158a4dd178b7e4ae3 |
|
BLAKE2b-256 | 2589305fa3863e672fc388ad9020cd7ddf2f63ad72c8fc6a081c493f77375586 |
Hashes for sqlean.py-0.21.8.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8363de18a7d5046860c2fb6140013735993efdc87d195ed22ee0b0039175ceb |
|
MD5 | ed9b6a1e8a60995eec0160710dc6ffbe |
|
BLAKE2b-256 | 1a2bf74c5f6210d7f9d60809b9dba2f716338f9110fad64763e1fa29dc51aea4 |
Hashes for sqlean.py-0.21.8.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bf4966f43d8f3564e271f092dd785e86d285e0e339f8156827ae8ff7341f944 |
|
MD5 | 425fb5d59c1f82676fb9b1becd0448bd |
|
BLAKE2b-256 | 271da2272dc36b0cc7b7f22d6de29011be1ce464f3f7b5a7698befbcc480256e |
Hashes for sqlean.py-0.21.8.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4710ee796b511a2cae1fbb55c0de9c67871f39764ea4a32b37b16e9b5c8f9834 |
|
MD5 | cf8d36013f522bf2d594a27ac48c9e12 |
|
BLAKE2b-256 | d7eefcfd493f6c93fa37773403fca9160b685ba933e7233f9139e1daee710a69 |
Hashes for sqlean.py-0.21.8.3-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a0d2df00d6a9359a3c1b1a2cd9fe6dce00f15d36650042cabdfdc8e79235b9e |
|
MD5 | 14c6150df00cc5ba176e1c92c0bd4a67 |
|
BLAKE2b-256 | 535fc8e17eecde1baf158a28681933cae13677da589445d09eee8aacb790466f |