Skip to main content

sqlean-driver

PyPI - Version PyPI - Python Version

A SQLAlchemy driver for sqlean.py.


Table of Contents

Installation

pip install sqlean-driver

Usage

from sqlalchemy import create_engine, func, select

engine = create_engine("sqlite+sqlean:///:memory:?extensions=all")

with engine.connect() as conn:
    result = conn.execute(select(func.ipfamily("192.168.1.1")))
    print(result.scalar())  # 4

Extensions

By default, sqlean.py disables all SQLite extensions. To enable all of them, pass extensions=all as a query parameter to the connection string. Or use a comma-separated list of extensions to enable only some of them, e.g. extensions=ipaddr,crypto.

Alternatives

Note that you don't strictly need this driver to use sqlean.py with SQLAlchemy. You can supply sqlean as the module parameter to create_engine:

import sqlean
from sqlalchemy import create_engine, func, select

sqlean.extensions.enable_all()
engine = create_engine("sqlite:///:memory:", module=sqlean)

with engine.connect() as conn:
    result = conn.execute(select(func.ipfamily("192.168.1.1")))
    print(result.scalar())  # 4

Development

This project uses Hatch to manage the development environment, so make sure you have it installed.

Run tests and coverage

Run tests and compute coverage for all supported Python and SQLAlchemy versions:

hatch run test:cov

Combine coverage output into a single report:

hatch run coverage:report

Run linter

hatch run lint:style

Run type checker

hatch run typing:check

License

sqlean-driver is distributed under the terms of the MIT license.

Acknowledgements

Metadata

Release files for sqlean-driver 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlean-driver 0.2.0
File Size Uploaded Provenance Actions
sqlean_driver-0.2.0.tar.gz 12.5 kB Without provenance Details for sqlean_driver-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sqlean-driver 0.2.0
File Interpreter ABI Platform Actions
sqlean_driver-0.2.0-py3-none-any.whl Python 3 none any Details for sqlean_driver-0.2.0-py3-none-any.whl

Total release size: 17.8 kB

Release files / sqlean_driver-0.2.0.tar.gz

Download URL sqlean_driver-0.2.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e85d5070bd0469bce14a9dd2e501a097b067df927b0fb91ca15211af7279709a
BLAKE2b-256 checksum
How to use checksums
e2fc222ba4dbbb1ca21263d7f2100e7befdd15a7aab3bf9d1ba00d6941c08af3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / sqlean_driver-0.2.0-py3-none-any.whl

Download URL sqlean_driver-0.2.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d4467404f8525ab53285f98d7aa462afa05e9786b6897fb005cf979314b5d3b
BLAKE2b-256 checksum
How to use checksums
802f67dca21580e3b6009af61ce33c47dc7b81550bf8bb8c4c84d9500ec94b6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Security for sqlean-driver 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page