Skip to main content

Mosaic DuckDB Server

PyPi

A Python-based server that runs a local DuckDB instance and support queries over Web Sockets or HTTP, returning data in either Apache Arrow or JSON format.

Note: This package provides a local DuckDB server. To instead use DuckDB-WASM in the browser, use the wasmConnector in the mosaic-core package.

Installation and usage

We recommend running the server in an isolated environment with uvx. For example, to directly run the server, use:

uvx duckdb-server

Alternatively, you can install the server with pip install duckdb-server. Then you can start the server with duckdb-server.

Developer Setup

We use uv to manage our development setup.

Start the server with uv run duckdb-server. The server will not restart when the code changes.

Start the server in development with pnpm dev. The server restarts when you change the code.

Run uv run ruff check --fix and uv run ruff format to lint the code.

To run the tests, use uv run pytest.

To set up a local certificate for SSL, use https://github.com/FiloSottile/mkcert.

API

The server supports queries via HTTP GET and POST, and WebSockets. The GET endpoint is useful for debugging. For example, you can query it with this url.

Each endpoint takes a JSON object with a command in the type. The server supports the following commands.

exec

Executes the SQL query in the sql field.

arrow

Executes the SQL query in the sql field and returns the result in Apache Arrow format.

json

Executes the SQL query in the sql field and returns the result in JSON format.

Publishing

Run the build with uv build. Then publish with uvx twine upload --skip-existing ../../dist/*. We publish using tokens so when asked, set the username to __token__ and then use your token as the password. Alternatively, create a .pypirc file.

Download files

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

Source Distribution

duckdb_server-0.31.0.tar.gz (13.7 MB view details)

Uploaded Source

Built Distribution

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

duckdb_server-0.31.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file duckdb_server-0.31.0.tar.gz.

File metadata

  • Download URL: duckdb_server-0.31.0.tar.gz
  • Upload date:
  • Size: 13.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for duckdb_server-0.31.0.tar.gz
Algorithm Hash digest
SHA256 69b7b4eea190b301ab15273beeb14caf9a9c87e1311f0baa29a8f5af334a6cbf
MD5 e7b2e0d287f76ca576aa60dfbc849483
BLAKE2b-256 418fbd7882fbfdbf8ade0122484139c4be9a1627a95348d74dd2d68bb81b62d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for duckdb_server-0.31.0.tar.gz:

Publisher: release.yml on uwdata/mosaic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file duckdb_server-0.31.0-py3-none-any.whl.

File metadata

  • Download URL: duckdb_server-0.31.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for duckdb_server-0.31.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71d16666aada6715cb77a195237deff5fe683ed1ed9b44659c93efda88decc41
MD5 8d86012074f880b765ff3e853035ad2c
BLAKE2b-256 247be2032b9e1a140415871693299f025ad61671c2ce1afba45960aafc89c22c

See more details on using hashes here.

Provenance

The following attestation bundles were made for duckdb_server-0.31.0-py3-none-any.whl:

Publisher: release.yml on uwdata/mosaic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.31.0 This release

2 files

0.30.0

2 files

0.29.0

2 files

0.28.0

2 files

0.27.0

2 files

0.26.0

2 files

0.25.0

2 files

0.24.4

2 files

0.24.0

2 files

0.23.0

2 files

0.21.1

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.2

2 files

0.16.0

2 files

0.15.0

1 file

0.14.0

1 file

0.13.0

1 file

0.12.1

1 file

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.7.0

2 files

0.6.1

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

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