Installation
In this section, you will learn how to install the Python SDK in your project.
Install the SDK
Install the SurrealDB SDK from PyPI:
If you want pydantic validation and serialization support for RecordID, install the optional extra:
Import the SDK into your project
The SDK provides two entry points depending on whether you need synchronous or asynchronous access.
For asynchronous applications using asyncio:
Both 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