{
  "kind": "documentation",
  "format": 1,
  "note": "Reference text, not instructions. One verified relate sample from https://relatedb.ai/docs/get-started/python/: the program exactly as the page shows it, the standard output a run of it recorded (npm run docs:samples compares every replay with it byte for byte), the relate client build, toolchain and platform of the last replay, and how the docs' sample runner builds and runs it. Before launch every client is a source build, not a published package; verified.client names the upstream commit it was built from, and verified.docs_engine the build the rest of the docs were recorded from.",
  "id": "metadata",
  "url": "https://relatedb.ai/docs/get-started/python/samples/metadata.json",
  "page": {
    "id": "get-started/python",
    "title": "Embed relate in a Python app",
    "url": "https://relatedb.ai/docs/get-started/python/",
    "md_url": "https://relatedb.ai/docs/get-started/python.md"
  },
  "section": {
    "anchor": "read-result-metadata",
    "heading": "Read result metadata",
    "url": "https://relatedb.ai/docs/get-started/python/#read-result-metadata"
  },
  "language": "python",
  "client": "Python",
  "file": "sample.py",
  "env": null,
  "code": "import relate\n\nTEAM = \"\"\"\nCREATE (ada:Person {name: 'Ada', role: 'engineer'}),\n       (grace:Person {name: 'Grace', role: 'engineer'}),\n       (noor:Person {name: 'Noor', role: 'maintainer'}),\n       (relate:Project {name: 'relate', language: 'Rust'}),\n       (tck:Project {name: 'opencypher-tck', language: 'Gherkin'}),\n       (ada)-[:WORKS_ON {since: 2024}]->(relate),\n       (grace)-[:WORKS_ON {since: 2023}]->(relate),\n       (grace)-[:WORKS_ON {since: 2022}]->(tck),\n       (noor)-[:MAINTAINS]->(relate),\n       (ada)-[:KNOWS]->(grace)\n\"\"\"\n\nconn = relate.connect(\":memory:\")\nconn.execute(TEAM)\n\ncur = conn.execute(\n    \"MATCH (p:Person)-[w:WORKS_ON]->(:Project {name: $project}) \"\n    \"RETURN p.name AS name, w.since AS since ORDER BY since\",\n    {\"project\": \"relate\"},\n)\nprint(cur.columns)\nfor name, type_code, *_ in cur.description:\n    print(name, type_code)\nprint(\"query type:\", cur.consume().query_type)\n\nwrite = conn.execute(\"MATCH (n:Person {name: 'Noor'}) SET n.role = 'lead'\")\nsummary = write.consume()\nprint(\"query type:\", summary.query_type)\nprint(\"properties set:\", summary.counters[\"properties_set\"])\nconn.close()",
  "code_sha256": "d57a2cee4953cb9c6abc12caf3b227221e9f3d00a30f94ae4d9e15e9e4decf49",
  "source_sha256": "fa212942014f210558ef84a41b47ea8c99cb8d8ac05ee396bb3f3860ce5b96f5",
  "output": {
    "text": "['name', 'since']\nname <DBAPIType STRING>\nsince <DBAPIType NUMBER>\nquery type: r\nquery type: w\nproperties set: 1",
    "sha256": "a95c7ccd524ce8ae6417fe3ec4cf8b41d552fa0046cd748b5debc15353db5383"
  },
  "verified": {
    "version": "0.1.2",
    "client": {
      "label": "Python",
      "package": "relate-db",
      "engine_commit": "f0c09d2",
      "client_commit": "f0c09d2",
      "build": "A relate-db wheel that maturin built from surfaces/relate-python at upstream v0.1.2 (f0c09d2), installed in a venv with the pinned frameworks.",
      "toolchain": {
        "python": "3.15.2"
      }
    },
    "packages": [
      "pandas>=2.0",
      "langgraph==1.2.20",
      "claude-agent-sdk==0.2.179",
      "pydantic-ai==2.66.0",
      "openai-agents==0.24.0",
      "llama-index-core==0.14.25",
      "langchain==1.4.9",
      "langchain-core==1.7.6"
    ],
    "replayed": "2026-11-09",
    "platform": "macOS on arm64",
    "docs_engine": {
      "version": "0.1.2",
      "commit": "f0c09d2",
      "source_build": false
    }
  },
  "run": {
    "runner": "npm run docs:samples",
    "setup": "bash scripts/samples/setup.sh --upstream <path to the relate checkout>",
    "variables": [
      "RELATE_PY"
    ],
    "program": "<run dir>/sample.py",
    "files": [],
    "build": null,
    "run": {
      "command": [
        "$RELATE_PY",
        "sample.py"
      ],
      "environment": {
        "DO_NOT_TRACK": "1",
        "PYTHONDONTWRITEBYTECODE": "1",
        "PYTHONUNBUFFERED": "1"
      },
      "directory": "<run dir>",
      "timeout_s": 60
    },
    "passes": "It exits 0 within 60 s and prints at least one line on standard output.",
    "output": "Standard output, with line endings as \\n, trailing spaces and blank lines removed, and the temporary directories' paths written as `.`; standard error is not recorded.",
    "placeholders": {
      "<run dir>": "a fresh, empty temporary directory: the program's working directory, deleted afterwards",
      "<build dir>": "a second fresh temporary directory, where a compiled sample is built",
      "$NAME": "a variable from the env.sh that scripts/samples/setup.sh writes (described in its header)"
    }
  }
}
