# Installation

In this section, you will learn how to install the Python SDK in your project.

In this section, you will learn how to install the Python SDK in your project.

## Install the SDK

Install the [SurrealDB SDK](https://pypi.org/project/surrealdb/) from PyPI:

```bash
pip install surrealdb
```

If you want [pydantic](https://docs.pydantic.dev/) validation and serialisation support for `RecordID`, install the optional extra:

```bash
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.

```python
from surrealdb import Surreal
```

For asynchronous applications using `asyncio`:

```python
from surrealdb import AsyncSurreal
```

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

- [Getting started](/docs/languages/python.md) for a complete working example
- [Connecting to SurrealDB](/docs/reference/python/concepts/connecting-to-surrealdb.md) for connection options and protocols
- [Authentication](/docs/reference/python/concepts/authentication.md) for signing in and managing credentials
