sqlite2duckdb
A tool for converting a sqlite database into a duckdb database
Description
Sqlite is an embedded online database designed for transactional reading and writing. Duckdb is also an embedded database, but column-oriented, designed for analytical process with a very high reading efficiency.
For more details Medium post
Installation
With uv, no installation is required. uvx downloads and runs the tool in one go:
uvx sqlite2duckdb source.db target.db
To keep it around:
uv tool install sqlite2duckdb
Or with pip:
pip install sqlite2duckdb
Usage
As a command line
usage: sqlite2duckdb [-f] <sqlite_path> <duckdb_path>
Convert Sqlite database to Duckdb database
positional arguments:
sqlite_path sqlite file path
duckdb_path duckdb file path
options:
-h, --help show this help message and exit
-f, --force overwrite the duckdb file if it already exists
-q, --quiet only report errors
--verbose report every step
-v, --version show program's version number and exit
Examples
uvx sqlite2duckdb source.db target.db
uvx sqlite2duckdb --force source.db target.db # overwrite target.db without asking
From python
from sqlite2duckdb import sqlite_to_duckdb
result = sqlite_to_duckdb("source.sqlite", "target.duckdb")
print(result.tables, result.views, result.elapsed)
What is converted
| Tables and data | ✅ |
| Primary keys, NOT NULL and UNIQUE constraints | ✅ |
| Indexes | ✅ |
| Views | ✅ best effort |
| FOREIGN KEY and CHECK constraints | ❌ |
A view whose SQL uses something duckdb has no equivalent for (MATCH, julianday()) is
skipped with a warning instead of failing the conversion.
FOREIGN KEY and CHECK are not copied, though not for lack of support: duckdb accepts and
enforces both in CREATE TABLE. It checks foreign keys row by row, so a self-referencing
table cannot be bulk loaded, and there is no ALTER TABLE ADD CONSTRAINT to add them once
the data is in.
Contributing
The project uses uv for everything:
make dev # uv sync — installs duckdb plus the test deps (pytest, faker, ruff)
make test # uv run pytest
make lint # uv run ruff check . && uv run ruff format --check .
make build # uv build
make publish # uv publish (PyPI trusted publishing, also run on tags by CI)
See also
- Harlequin: A nice duckdb IDE for your terminal
Metadata
Release files for sqlite2duckdb 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sqlite2duckdb-0.5.0.tar.gz | 13.9 kB | Without provenance | Details for sqlite2duckdb-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sqlite2duckdb-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for sqlite2duckdb-0.5.0-py3-none-any.whl |
Total release size: 22.1 kB
Release files / sqlite2duckdb-0.5.0.tar.gz
| Download URL | sqlite2duckdb-0.5.0.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ad934a0cf9b64abbac397267832c8ebf6ce1e511b4e312034f7d0f1b9d395ff
|
|
BLAKE2b-256 checksum How to use checksums |
4403971c924197dced3b83818ff9091244711fc0b0b856ea82dffaea90ead5e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / sqlite2duckdb-0.5.0-py3-none-any.whl
| Download URL | sqlite2duckdb-0.5.0-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0d0f5573dce51ef0f3a039d9865f49d8bcd691228704978a9dab0603a5209ffd
|
|
BLAKE2b-256 checksum How to use checksums |
e64efa30827026f5bc9d917d663ce5d34c309e39bfb9b0b343e654ec0a4be3fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for sqlite2duckdb 0.5.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.