Skip to main content

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.

import sqlean as sqlite3

# has the same API as the default `sqlite3` module
conn = sqlite3.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()

Installation

A binary package (wheel) is available for the following operating systems:

  • Windows (64-bit)
  • Ubuntu (and other Debian-based distributions)
  • 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

import sqlean as sqlite3

conn = sqlite3.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.

python setup.py build_ext -i
python -m test
python -m pip wheel . -w dist

License

Based on the pysqlite3 project. Available under the Zlib license.

Stay tuned

Follow @ohmypy on Twitter to keep up with new features 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

sqlean.py-0.21.5-cp311-cp311-win_amd64.whl (759.0 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

sqlean.py-0.21.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

sqlean.py-0.21.5-cp311-cp311-macosx_10_9_universal2.whl (1.8 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

sqlean.py-0.21.5-cp310-cp310-win_amd64.whl (759.0 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

sqlean.py-0.21.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

sqlean.py-0.21.5-cp310-cp310-macosx_10_9_universal2.whl (1.8 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

sqlean.py-0.21.5-cp39-cp39-win_amd64.whl (759.2 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

sqlean.py-0.21.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

sqlean.py-0.21.5-cp39-cp39-macosx_10_9_universal2.whl (1.8 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

sqlean.py-0.21.5-cp38-cp38-win_amd64.whl (759.2 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

sqlean.py-0.21.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

sqlean.py-0.21.5-cp38-cp38-macosx_10_9_universal2.whl (1.8 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64)

sqlean.py-0.21.5-cp37-cp37m-win_amd64.whl (759.0 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

sqlean.py-0.21.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

sqlean.py-0.21.5-cp36-cp36m-win_amd64.whl (759.3 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

sqlean.py-0.21.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page