Skip to main content

Fast in-process OLAP engine for Python — query Parquet, CSV, JSON, Arrow and SQLite with SQL. 1.1–8.6× faster than DuckDB.

Project description

SlothDB

SlothDB is a fast, in-process SQL database for your local data files.

A drop-in alternative to DuckDB with built-in readers for Parquet, CSV, JSON, Avro, Arrow and SQLite — 1.1×–8.6× faster on every benchmark query.

PyPI Downloads 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.4, ~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.1.5.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

slothdb-0.1.5-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for slothdb-0.1.5.tar.gz
Algorithm Hash digest
SHA256 dc6bf5c39daa3d34bf056f56a0cb87db59eb1a53a98119c941036d22607aa521
MD5 9248f7d152f1eadb8adff903a09860e6
BLAKE2b-256 ea01d6124f7b70a5482ee7869caced2a86978038d9917bd7e33d067afee340e8

See more details on using hashes here.

File details

Details for the file slothdb-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: slothdb-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for slothdb-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c8510e7bc502ee1811d2351b771601bdff58310d26977f1e30df3d3cec07b57f
MD5 9465574ec3ec43c85a13d2c4ad4c7704
BLAKE2b-256 af54e4e5d7d47258f5a15c7e5a500c913fd647931b0346da63008c7f3cdddc9e

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