In this section, you will learn how to install the Python SDK in your project.
Install the SDK
Install the SurrealDB SDK from PyPI:
pip install surrealdbIf you want pydantic validation and serialization support for RecordID, install the optional extra:
pip install surrealdb[pydantic]Import the SDK into your project
The SDK provides two entry points depending on whether you need synchronous or asynchronous access.
from surrealdb import SurrealFor asynchronous applications using asyncio:
from surrealdb import AsyncSurrealBoth Surreal and AsyncSurreal are factory functions that accept a connection URL and return the appropriate connection class based on the protocol scheme.
Next steps
Quickstart for a complete working example
Connecting to SurrealDB for connection options and protocols
Authentication for signing in and managing credentials