sqlxtralite
An embedded SQL database for Python — a single file, no server, no setup. It speaks
the familiar DB-API 2.0 interface and returns native Python types
(int, float, str, bytes, None).
Install
pip install sqlxtralite
Quick start
import sqlxtralite
con = sqlxtralite.connect("shop.db") # opens (or creates) one file
cur = con.cursor()
cur.execute("CREATE TABLE items (id INTEGER PRIMARY KEY, name TEXT, price REAL)")
cur.execute("INSERT INTO items VALUES (1, 'basil', 2.95)")
cur.execute("SELECT name, price FROM items")
print(cur.fetchall()) # [('basil', 2.95)]
con.close()
Parameters & bulk insert
# qmark (?) placeholders; None -> NULL
cur.execute("INSERT INTO items VALUES (?, ?, ?)", (2, "mint", None))
# insert many rows at once
cur.executemany(
"INSERT INTO items VALUES (?, ?, ?)",
[(3, "sage", 4.20), (4, "thyme", 1.50)],
)
cur.execute("SELECT name FROM items WHERE price > ?", (2.0,))
print([row[0] for row in cur.fetchall()]) # ['basil', 'sage']
Fetching results
cur.execute("SELECT id, name FROM items ORDER BY id")
cur.fetchone() # (1, 'basil') — next row, or None at the end
cur.fetchmany(2) # [(2, 'mint'), (3, 'sage')]
cur.fetchall() # the rest
print([d[0] for d in cur.description]) # column names: ['id', 'name']
print(cur.rowcount, cur.lastrowid)
Queries it supports
# joins, aggregates, grouping
cur.execute("""
SELECT name, SUM(price) AS total
FROM items
GROUP BY name
HAVING total > 1
ORDER BY total DESC
""")
# CASE, UNION, subqueries, REPLACE, INSERT ... ON DUPLICATE KEY UPDATE, …
cur.execute("INSERT INTO items VALUES (1, 'basil', 9.99) "
"ON DUPLICATE KEY UPDATE price = VALUES(price)")
API
connect(path) → Connection. Module flags: apilevel = "2.0",
paramstyle = "qmark", threadsafety = 1. Errors raise sqlxtralite.Error.
| Object | Methods / attributes |
|---|---|
Connection |
cursor(), execute(sql, params=None), commit(), rollback(), close(), with support |
Cursor |
execute(sql, params=None), executemany(sql, rows), fetchone(), fetchmany(size=1), fetchall(), description, rowcount, lastrowid, close() |
Notes
- Use one connection per thread.
- Each statement auto-commits; for multi-statement transactions issue explicit
BEGIN/COMMITwithexecute.
Metadata
Release files for sqlxtralite 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| sqlxtralite-0.1.2-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details for sqlxtralite-0.1.2-cp38-abi3-win_amd64.whl |
| sqlxtralite-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64 | Details for sqlxtralite-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| sqlxtralite-0.1.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ ARM64 | Details for sqlxtralite-0.1.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| sqlxtralite-0.1.2-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details for sqlxtralite-0.1.2-cp38-abi3-macosx_11_0_arm64.whl |
Total release size: 3.3 MB
Release files / sqlxtralite-0.1.2-cp38-abi3-win_amd64.whl
| Download URL | sqlxtralite-0.1.2-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 748.0 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2ad9dd1f9d7d89be2bc5ddcc9f06d6a349fbfe77ab0fec51a2e1c048f3b84d5b
|
|
BLAKE2b-256 checksum How to use checksums |
5dd9865f9eead4e4ffe267cd64e753740927a8d264975a70abda8ebf0b3c187a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2026.
Transparency logRelease files / sqlxtralite-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | sqlxtralite-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 911.9 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2df8ba7c06785d5b8452844a09ed5effb9d061d2cebe486b5138241cdee0efc8
|
|
BLAKE2b-256 checksum How to use checksums |
d98dcbf41a2b17f253d23c87a41b1903a7325e5ac9a487d3a7a24a3532246d78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2026.
Transparency logRelease files / sqlxtralite-0.1.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | sqlxtralite-0.1.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 866.9 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
ac667c95497edc1943f0bc145876769090af939fb4b0d6ee2916198c46e57ce2
|
|
BLAKE2b-256 checksum How to use checksums |
c7b414fd8615afd5a2d71c43bfe51d13a00f0c09166668671cd2f4c2ca33c90c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2026.
Transparency logRelease files / sqlxtralite-0.1.2-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | sqlxtralite-0.1.2-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 812.1 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
fae99aefab3d7e515146ec775f7fe3c3fb2bedfc71ec9a5f284fc88d5908393e
|
|
BLAKE2b-256 checksum How to use checksums |
beaf4f8867a8609fc2073ed943717258879d82f5da364bff9d54d55e0989a778
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2026.
Transparency logSecurity for sqlxtralite 0.1.2
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.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for sqlxtralite-0.1.2-cp38-abi3-win_amd64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2026.
Transparency logA 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.