Skip to main content

A Python library for interacting with SurrealDB via RPC.

Project description

SurrealDB RPC Python Client

Example Usage

from surrealdb_rpc.client.websocket import SurrealDBWebsocketClient
from surrealdb_rpc.data_model import Thing

with SurrealDBWebsocketClient(
    host="localhost",
    port=8000,
    ns="test",
    db="test",
    user="root",
    password="root",
) as db:
    response = db.create(
        "example:123",
        text="Some value",
        reference=Thing("other", {"foo": {"bar": "baz"}}),
        array=[1, 2, 3],
        object={"key": "value"},
    )
    print(response)

This should create this record in the database:

{
  array: [
    1,
    2,
    3
  ],
  id: example:123,
  object: {
    key: 'value'
  },
  reference: other:{
  foo: {
    bar: 'baz'
  }
  },
  text: 'Some value'
}

Project details


Download files

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

Source Distribution

surrealdb_rpc-0.3.1.tar.gz (50.2 kB view details)

Uploaded Source

Built Distribution

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

surrealdb_rpc-0.3.1-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file surrealdb_rpc-0.3.1.tar.gz.

File metadata

  • Download URL: surrealdb_rpc-0.3.1.tar.gz
  • Upload date:
  • Size: 50.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for surrealdb_rpc-0.3.1.tar.gz
Algorithm Hash digest
SHA256 028b710729fe1b1cce581ca95077574958441382f62d6232d011502e32821225
MD5 b61ddd60948e883d08a7d44f423e16b6
BLAKE2b-256 14355c640812c16481d2d58814e74f67173c974b43b6c0633d8d95ccced0f9a2

See more details on using hashes here.

File details

Details for the file surrealdb_rpc-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: surrealdb_rpc-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for surrealdb_rpc-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 61a614f0309f7ad492361adaa1a659e9a0495c2486450ed97ebaed7233835b38
MD5 46f32fe9c3446997365fa6ad9e39f7f3
BLAKE2b-256 783d8b4fe37c00abaec9da539c8ccb0669d1adfef1cde71d7e72c6b0d1bdb1b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page