Skip to main content

BumbleBee DL

A high-performance Datalog-based analytics engine — with SQL support — from Python.

BumbleBee DL is a lightweight, in-memory analytics engine powered by Datalog — a declarative logic language that makes recursive queries, graph analysis, and complex joins natural to express. It also supports SQL as an alternative query language, so you can mix and match both in the same session. Query CSV files, Parquet files, and pandas DataFrames through a simple Python API. Built in C++ with push-based execution, columnar storage, and multithreading, it delivers serious performance on a single machine.

Quick Start

Install

pip install bumbledl

Platform support: Pre-built wheels are available for Linux x86_64 and macOS ARM (Apple Silicon). If your platform is not supported, you can still use BumbleBee (DL) in Google Colab.

Your first query

import bumbledl as bb

db = bb.db()

# Query a CSV file with SQL — alias names the output predicate
db.sql("""
    SELECT DEPARTMENT_ID, COUNT(*) AS CNT, SUM(SALARY) AS TOTAL
    FROM "examples/data/employees.csv"
    GROUP BY DEPARTMENT_ID
""", alias="dept_stats")

# Get results as a pandas DataFrame
# 3 is the arity (number of columns) of the dept_stats predicate
df = db.get_table("dept_stats", 3).to_df(
    col_names=["dept_id", "count", "total_salary"]
)
print(df)

Recursive Datalog — something SQL can't easily do

BumbleBee supports recursive Datalog rules, enabling graph analysis, transitive closure, and hierarchical queries with a clean, declarative syntax:

import bumbledl as bb
import pandas as pd

hierarchy = pd.DataFrame({
    "manager": ["alice", "alice", "bob", "bob", "carol", "dave"],
    "report":  ["bob",   "carol", "dave", "eve", "frank", "grace"],
})

db = bb.db()

# Load a pandas DataFrame as a predicate that can be queried
db.load_df(hierarchy, "manages")

# Recursive Datalog: compute all direct and indirect reports
db.run("""
    reports_to(M, R) :- manages(M, R).
    reports_to(M, R) :- manages(M, X), reports_to(X, R).
    reports_to(X, Y)?
""")

df = db.get_table("reports_to", 2).to_df(col_names=["manager", "report"])
print("reports_to:")
print(df.sort_values(["manager", "report"]).to_string(index=False))
print()

# You can also run SQL on top of Datalog results — count reports per manager
db.sql("""
    SELECT COL_0, COUNT(*) AS CNT
    FROM reports_to
    GROUP BY COL_0
""", alias="report_count")

df2 = db.get_table("report_count", 2).to_df(col_names=["manager", "num_reports"])
print("num_reports:")
print(df2.sort_values("num_reports", ascending=False).to_string(index=False))
print()

Features

  • Python client library — pip install bumbledl, query and get DataFrames back
  • Dual query languages — SQL and Datalog, including recursive Datalog
  • High-performance engine — push-based execution, columnar storage, multithreading
  • Read and write CSV and Parquet — import data from and export results to CSV and Parquet files
  • Native NULL support — NULL across all operators: IS NULL/IS NOT NULL, NULL-aware aggregates, three-valued comparisons, and CSV/Parquet/pandas (None/pd.NA) round-trip
  • DataFrame interop — load any pandas DataFrame as input via db.load_df(), meaning you can connect to virtually any data source (databases, APIs, Excel, in-memory structures) before handing it off for analysis
  • Command-line interface — run queries directly from the terminal

Python API

Method Description
db = bb.db(args={}) Create a new engine instance (only one per session). Optional args dict for CLI flags, e.g. {"-t": "4", "-d": ""}
db.run(program) Run a Datalog program
db.sql(query, alias="", overwrite=True) Run a SQL query. If alias is provided, wraps the query as (query) AS alias. If overwrite is True (default), any existing predicate with the same alias is replaced
db.run_file(filepath) Run a program from a file
db.load_df(df, alias) Load a pandas DataFrame as a predicate. Alias must start with a lowercase letter
db.explain(program) Return the generated Datalog rules as a string without executing
db.get_output_predicates() List all output predicates as (name, arity) tuples
db.get_table(name, arity=-1) Get a result table. Arity is optional
table.tuples() Get results as a list of tuples
table.to_df(col_names=[]) Get results as a pandas DataFrame. Column names are optional
db.remove_table(name, arity) Remove a predicate from the engine

Examples

Check out the examples/ folder for a collection of ready-to-use examples in Python, SQL, and Datalog, covering data imports, aggregations, joins, recursion, exports, and more.

CLI Quick Start

BumbleBee is also available as a standalone command-line tool.

Prerequisites

  • CMake 3.20+
  • C++20-compatible compiler (GCC 13+ or Clang 18+ with libc++)

Build

cmake -S . -B cmake-build-release -DCMAKE_BUILD_TYPE=Release
cmake --build cmake-build-release --target BumbleBee -j 8
./cmake-build-release/BumbleBee --help

Run a query

cd examples

# SQL
../cmake-build-release/BumbleBee -i sql/01_import/basic_csv_import.sql

# Datalog
../cmake-build-release/BumbleBee -i dl/01_import/basic_csv_import.dl -a
Flag Description
-a Print all predicates
-t N Use N threads (default: all cores)
-r Print profiling data
--print-program Print the generated Datalog program and exit

Optimizer

BumbleBee DL includes a rule-based query optimizer that applies logical rewrites such as filter push-down and column pruning. The current optimizer does not reorder joins — the execution order follows the join sequence as written in the query. A cost-based join reordering optimizer is planned as a future enhancement.

Roadmap

  • Code generation: cover complex AND and OR clause combinations in filter expressions
  • Predicate table types: allow users to explicitly declare column types for predicates (currently auto-deduced at runtime)
  • Left and right joins: support for LEFT JOIN and RIGHT JOIN
  • Cost-based join optimizer: reorder joins based on cardinality estimates

Metadata

Release files for bumbledl 0.4.0

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

Built distributions (wheels)

Table of built distributions (wheels) for bumbledl 0.4.0
File Actions
bumbledl-0.4.0-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details for bumbledl-0.4.0-cp313-cp313-manylinux_2_34_x86_64.whl
bumbledl-0.4.0-cp313-cp313-macosx_14_0_arm64.whl CPython 3.13 CPython 3.13 macOS 14.0+ ARM64 Details for bumbledl-0.4.0-cp313-cp313-macosx_14_0_arm64.whl
bumbledl-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details for bumbledl-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl
bumbledl-0.4.0-cp312-cp312-macosx_14_0_arm64.whl CPython 3.12 CPython 3.12 macOS 14.0+ ARM64 Details for bumbledl-0.4.0-cp312-cp312-macosx_14_0_arm64.whl
bumbledl-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64 Details for bumbledl-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl
bumbledl-0.4.0-cp311-cp311-macosx_14_0_arm64.whl CPython 3.11 CPython 3.11 macOS 14.0+ ARM64 Details for bumbledl-0.4.0-cp311-cp311-macosx_14_0_arm64.whl
bumbledl-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.34+ x86-64 Details for bumbledl-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl
bumbledl-0.4.0-cp310-cp310-macosx_14_0_arm64.whl CPython 3.10 CPython 3.10 macOS 14.0+ ARM64 Details for bumbledl-0.4.0-cp310-cp310-macosx_14_0_arm64.whl

Total release size: 54.0 MB

Release files / bumbledl-0.4.0-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL bumbledl-0.4.0-cp313-cp313-manylinux_2_34_x86_64.whl
Size 7.7 MB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
e4d66f02ef686e60abbfc7e47f328b7a92fc7803b6333c6cbbb7935fed56922d
BLAKE2b-256 checksum
How to use checksums
d302281fb7fdb1a79b50445e8e7d17285cff1c76028e7452dbe7acd0ebb80b70
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 Jul 7, 2026.

Transparency log

Release files / bumbledl-0.4.0-cp313-cp313-macosx_14_0_arm64.whl

Download URL bumbledl-0.4.0-cp313-cp313-macosx_14_0_arm64.whl
Size 5.8 MB
Tags CPython 3.13 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
13bba5bec70260a8bab88c61460db4b59573fca7ebff808ebd9c37d705e1a7d5
BLAKE2b-256 checksum
How to use checksums
03732d21b4d6483e57b440342f796e864c99d9df4743e7b41bb1ecb6d7c949c3
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 Jul 7, 2026.

Transparency log

Release files / bumbledl-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL bumbledl-0.4.0-cp312-cp312-manylinux_2_34_x86_64.whl
Size 7.7 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
f45100137a9629001e6d5bb415462270f6ac0f259f46743765edcb5cf147c848
BLAKE2b-256 checksum
How to use checksums
eee99611d8108b1840db5b6193064c0554420c8fc5ffd5241c1dc0b5abefec4d
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 Jul 7, 2026.

Transparency log

Release files / bumbledl-0.4.0-cp312-cp312-macosx_14_0_arm64.whl

Download URL bumbledl-0.4.0-cp312-cp312-macosx_14_0_arm64.whl
Size 5.8 MB
Tags CPython 3.12 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
bc3c508fa23f44833c8d06b238990b0b2b176f3d971d65c0e2085224bb7c7bf4
BLAKE2b-256 checksum
How to use checksums
31dddf2379c74a9e4de8345bf2fb383fbe0921691043f11e74dc5802dced5c05
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 Jul 7, 2026.

Transparency log

Release files / bumbledl-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL bumbledl-0.4.0-cp311-cp311-manylinux_2_34_x86_64.whl
Size 7.7 MB
Tags CPython 3.11 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
eff5a46aeeca3c1c71f8625cf5b6fa1400ad3dfafe58df70f7bcb33401df6295
BLAKE2b-256 checksum
How to use checksums
33ac86d1ec46a4f83a0ad28372725ae5666093a2d6af14b439befec94b082e47
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 Jul 7, 2026.

Transparency log

Release files / bumbledl-0.4.0-cp311-cp311-macosx_14_0_arm64.whl

Download URL bumbledl-0.4.0-cp311-cp311-macosx_14_0_arm64.whl
Size 5.8 MB
Tags CPython 3.11 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
aafca4cd092de3ef1d976d60dc9f22026291d11c92cddce110cc95aebdb2c1a1
BLAKE2b-256 checksum
How to use checksums
f13a80f93e361e8d7f22dd688cc4ab2aeb9ccdfb482766276f48623333343ec3
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 Jul 7, 2026.

Transparency log

Release files / bumbledl-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl

Download URL bumbledl-0.4.0-cp310-cp310-manylinux_2_34_x86_64.whl
Size 7.7 MB
Tags CPython 3.10 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
d97fa9e9fb8c9063f9b2dc297b153699aeda7ad1ed49631188b072b69deedb55
BLAKE2b-256 checksum
How to use checksums
1ad08a58af05be2bed0f1d06ee4323f05ea7ab818ea347738be41eaee4ecc0a0
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 Jul 7, 2026.

Transparency log

Release files / bumbledl-0.4.0-cp310-cp310-macosx_14_0_arm64.whl

Download URL bumbledl-0.4.0-cp310-cp310-macosx_14_0_arm64.whl
Size 5.8 MB
Tags CPython 3.10 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
bbe8609009aa4610f1cc3128e94a182f64381984bb81130454f2585fdf815d60
BLAKE2b-256 checksum
How to use checksums
f95156d7b68c1a7fe7c2cbece13272af51ea75d928db276b3ddb53df628a1079
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 Jul 7, 2026.

Transparency log

Security for bumbledl 0.4.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.

Full provenance

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for bumbledl-0.4.0-cp313-cp313-manylinux_2_34_x86_64.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 Jul 7, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.4.0 This release

8 release files Full provenance

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