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.6.tar.gz (1.3 MB 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.6-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: surrealdb_rpc-0.3.6.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • 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.6.tar.gz
Algorithm Hash digest
SHA256 d5ec92ba798f4ed0a69170d92b8c1ad33ba172890c15dcea8cf5c9aa589cc6e8
MD5 18a4c5163f59d79b6cf3021db75a4ac6
BLAKE2b-256 378771ec1196ac6853360b9d38c93d4e1b32377cadc3b3ddf9c30891718dc593

See more details on using hashes here.

File details

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

File metadata

  • Download URL: surrealdb_rpc-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 47.0 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bc437a8cf62e9753e7c384afe1718aabff7709332d9943469d3eee4095807b4e
MD5 5c35320735eb96a006dac535aeabc3d4
BLAKE2b-256 3dcf3fdbce488d18ac84efbc301b7a75046ecce71a2e87d1bc8ae4b9d836710b

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