skillfed

surrealdb

SurrealDB python client

surrealdb v2.0.0 151.4K downloads/30d#10,933 on PyPI265
License unclear Active released

What it is and what it does

surrealdb is the official Python SDK for SurrealDB, a multi-model database that can run as a remote server or embedded directly in your application. It provides both synchronous (Surreal) and asynchronous (AsyncSurreal) APIs for connecting to SurrealDB instances via WebSocket, HTTP, or embedded modes (in-memory or file-based). The package handles authentication, namespace/database selection, and CRUD operations through methods like create(), select(), update(), delete(), and query() for raw SurrealQL.

The SDK depends on aiohttp, requests, websockets, pydantic-core, and typing-extensions to manage network communication and data validation. It supports sessions and transactions on WebSocket connections, and integrates with Pydantic Logfire for observability. Embedded mode is useful for development, testing, and single-application deployments, while remote connections suit multi-application or distributed scenarios.

Use it for:

  • Build a Python desktop or CLI application with local data storage using embedded in-memory or file-based SurrealDB.
  • Develop an async web service that connects to a remote SurrealDB instance via WebSocket for real-time data operations.
  • Write integration tests that use in-memory SurrealDB to avoid external dependencies and run tests quickly.
  • Implement multi-session transactions on a WebSocket connection for complex, coordinated database operations.
  • Add observability to database interactions by instrumenting SurrealDB operations with Pydantic Logfire.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Official Python client for SurrealDB, supporting both remote (WebSocket/HTTP) and embedded (in-memory or file-based) database connections with synchronous and asynchronous APIs.

Yes, with conditions. The package is actively maintained, supports current Python versions (3.10–3.13), and offers both embedded and remote modes for flexibility. However, verify the license terms before use—the metadata does not specify a license, which is a blocker for some projects. No known security vulnerabilities. Install if you are committed to SurrealDB and need a Python client; avoid if license ambiguity is a dealbreaker.

Install

surrealdb on PyPI

pip

pip install surrealdb

uv

uv add surrealdb

poetry

poetry add surrealdb

Installing surrealdb

Before you install

Medium install friction due to compiled wheels for multiple platforms (cp39-abi3 across macOS, Linux, Windows). Active maintenance with recent release (113 days old) and ongoing commits. Requires Python 3.10 or later.

License in practice

License status is unclear—no SPDX identifier or raw license text provided in package metadata. Verify the actual license terms before adopting in proprietary or restricted contexts.

Quickstart

pip install surrealdb

from surrealdb import Surreal

with Surreal("ws://localhost:8000/rpc") as db:
    db.signin({"username": "root", "password": "root"})
    db.use("namespace", "database")
    db.create("person", {"name": "Alice"})
    print(db.select("person"))

Requires a running SurrealDB instance (local or remote) or use embedded mode with "memory" or "file://" URIs. Python 3.10+ required.

Verify before relying

  • Whether the package's license is compatible with your project's license requirements (license metadata missing).
  • Performance characteristics and scalability limits for embedded vs. remote connections under production load.
  • Support status and backward compatibility guarantees for the 2.0.0 release.

Package facts

License not declared (unclear)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 5 — aiohttp, pydantic-core, requests, typing-extensions, websockets
Maintenance actively maintained — 113 days since the last release
Last repo commit
First released
Downloads 151,436/month — #10,933 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: surrealdb-2.0.0-cp39-abi3-macosx_10_12_x86_64.whl; surrealdb-2.0.0-cp39-abi3-macosx_11_0_arm64.whl; surrealdb-2.0.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; surrealdb-2.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; surrealdb-2.0.0-cp39-abi3-musllinux_1_2_aarch64.whl; surrealdb-2.0.0-cp39-abi3-musllinux_1_2_x86_64.whl; surrealdb-2.0.0-cp39-abi3-win_amd64.whl

Keywords: SurrealDB, Database

Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: DatabaseTopic :: Database :: Database Engines/ServersTopic :: Database :: Front-EndsTopic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python Modules

Tags

surrealdb python clientembedded database pythonasync database sdkwebsocket database connectionmulti-model database python
multi-model-databaseembedded-databaseasync-support

More Software Development packages