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.4.tar.gz (51.5 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.4-py3-none-any.whl (45.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for surrealdb_rpc-0.3.4.tar.gz
Algorithm Hash digest
SHA256 b9514c0a7a420218fee3c111800f71bbac2c3b80ee7f68ac224c75cfc542de61
MD5 7375c6ac4365abcb5895e2af79c9b420
BLAKE2b-256 6de896c18342e8a8e7b745eaae00a2580db0943a7e461c0962bd0b09e29f00e5

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for surrealdb_rpc-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 17ce2d9f852d2f096a173d7de3cc383a876fd942178e9ee0cf46823b825d0152
MD5 89a4a7a93f4fbe4114bfb830bb8f1599
BLAKE2b-256 77afbc0b8cebadf4a0bedb6f95d10e1090676fcdae5c977474baeebbda3c1f94

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