Skip to main content

Embedded SQL OLAP engine for Python — query Parquet, CSV, JSON, Arrow, Avro, Excel, and SQLite files directly with SQL, in-process. Zero server, no import step.

Project description

SlothDB

Run analytics faster.

SlothDB is an embedded SQL database that runs everywhere: on your laptop, on a server, and in the browser. Built from scratch as a DuckDB alternative. Up to 5x faster on real workloads (138 ms vs 540 ms on a 5-query warm JOIN batch; 5.43x peak on Avro SUM; 16-query suite median 1.70x). Built-in readers for Parquet, CSV, JSON, Avro, Arrow, Excel, and SQLite.

PyPI Downloads Downloads/month Python versions CI License

SlothDB 60-second demo


Try it in 60 seconds

pip install slothdb
python -c "import slothdb; slothdb.demo()"

Generates a 100 000-row CSV, runs three queries, and prints the side-by-side with DuckDB shown above. No files to find, no setup.

Using your own files

import slothdb
db = slothdb.connect()
df = db.sql("SELECT region, SUM(revenue) FROM 'sales.parquet' GROUP BY region").fetchdf()

No server. No import step. No CREATE TABLE. Point SQL at files on disk.

Why SlothDB?

Same embedded model as DuckDB and SQLite — link it into your process, point SQL at files. Different defaults:

  • 7 file formats built in — Parquet, CSV, JSON, Avro, Arrow, SQLite, Excel. DuckDB needs extensions for Avro and SQLite.
  • 1.1–8.6× faster than DuckDB on a 1M-row benchmark across 15 queries. JSON parse is 8.6×, Avro SUM is 5.4×, CSV COUNT(*) is 5.1×. Full numbers on GitHub →
  • Stable C ABI — extensions don't break across releases.
  • ~8 MB single binary, fully self-contained.

Quickstart

import slothdb

# In-memory
db = slothdb.connect()

# Query files directly
db.sql("SELECT * FROM 'data.csv' WHERE score > 90").show()
db.sql("SELECT COUNT(*) FROM 'logs.parquet'").show()
db.sql("SELECT * FROM read_json('events.json') LIMIT 5").show()
db.sql("SELECT * FROM sqlite_scan('app.db', 'users')").show()

# Persistent database
db = slothdb.connect("analytics.slothdb")

# DataFrame integration
df = db.sql("SELECT region, SUM(revenue) FROM 'sales.csv' GROUP BY region").fetchdf()

What's not production-ready yet

  • No multi-writer transactions (single-writer, crash-safe checkpoint).
  • No distributed execution — single-node embedded engine.
  • Some SQL corners still surprise you (open an issue).
  • v0.1.5, ~6 months old. Treat as beta.

Performance

Format Query SlothDB DuckDB Speedup
Parquet COUNT(*) 12 ms 34 ms 2.83×
CSV COUNT(*) 33 ms 170 ms 5.08×
CSV GROUP BY region 100 ms 191 ms 1.91×
JSON SUM(revenue) 242 ms 314 ms 1.30×
Avro SUM(revenue) 140 ms 760 ms 5.43×
Avro GROUP BY region 170 ms 800 ms 4.71×

1M-row dataset, warm cache, 5-run median. Full 15-query table + methodology →

Links

License

MIT

Project details


Download files

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

Source Distribution

slothdb-0.2.3.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

slothdb-0.2.3-py3-none-win_amd64.whl (1.2 MB view details)

Uploaded Python 3Windows x86-64

slothdb-0.2.3-py3-none-manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded Python 3

slothdb-0.2.3-py3-none-macosx_11_0_universal2.whl (1.8 MB view details)

Uploaded Python 3macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file slothdb-0.2.3.tar.gz.

File metadata

  • Download URL: slothdb-0.2.3.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for slothdb-0.2.3.tar.gz
Algorithm Hash digest
SHA256 5444a1a8ff897b90828e43478a59346de78685d8ae167dba113f0f9b96c65408
MD5 e70cc5e30395111d45298a15d9dd410f
BLAKE2b-256 c0d0455de1b2fdabf46bf1bb106e1b970679ccc3a80d3983b1f91f132f3a1dc6

See more details on using hashes here.

File details

Details for the file slothdb-0.2.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: slothdb-0.2.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for slothdb-0.2.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 225a61dae698b6ad46a92b824769d9ee5972a01ec3a7b029de3d7a46610e6c00
MD5 41afd3f9f85036c0fc03d1b5fbc7d068
BLAKE2b-256 099f9ddbfbc25ab7f1b7ffd9bc6f5dbff654a54dd094c0ffe257d094b67f26a4

See more details on using hashes here.

File details

Details for the file slothdb-0.2.3-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for slothdb-0.2.3-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1d83bbc18a4a7f6ff7402998171c09976cd5803295595ac3b7c45983701a0bc4
MD5 269547acdab7b41e64ff453c6817f6c0
BLAKE2b-256 dc209eae589c2d30d18184d2597204ec653b8b91028f25cceb6d1f2ddb32cb5a

See more details on using hashes here.

File details

Details for the file slothdb-0.2.3-py3-none-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for slothdb-0.2.3-py3-none-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 9e05d91ce980ab30274d30bed9dcd7d5f4f7d8dbc6a5961c121d08cd0c405565
MD5 0aae1e2be5d8f5f6a3b5e7f8bcc7ebcd
BLAKE2b-256 71c77daa0c0ce398b547230b0b1c787227e3bc0129c31030dc30f96e81a6dd00

See more details on using hashes here.

Supported by

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