Skip to content

Commit 615f0a0

Browse files
Add requirements note to tutorial
1 parent 3f555a3 commit 615f0a0

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ python/**/__pycache__
77
python/**.pyc
88
python/**.egg-info
99
python/build
10-
python/.ipynb_checkpoints
10+
python/**/.ipynb_checkpoints
1111
python/.venv
1212
python/dist

python/tutorial.ipynb

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
"metadata": {},
77
"source": [
88
"# Visualising TypeDB Data with Python\n",
9+
"> **Note:** This tutorial requires a running TypeDB server with version >=3.7.0. The connection details can be modified in the cell below if required.\n",
10+
"> It also requires the folllowing python packages which can be installed from pip:\n",
11+
"> \n",
12+
"> `python3 -m pip install \"typedb-driver>=3.7.0\" \"typedb-graph-utils>=3.7.0\" \"jupyter\"`\n",
13+
"> \n",
914
"This is a tutorial to visualise TypeDB data as graphs using the query representation returned by the analyze endpoint,\n",
1015
"and with query results (when the `include_query_structure` `QueryOption` is set).\n",
1116
"\n",
@@ -33,6 +38,15 @@
3338
"metadata": {},
3439
"outputs": [],
3540
"source": [
41+
"from typedb.driver import Credentials, DriverOptions, QueryOptions\n",
42+
"\n",
43+
"DB_ADDRESS = \"127.0.0.1:1729\"\n",
44+
"DB_CREDENTIALS = Credentials(\"admin\", \"password\")\n",
45+
"DRIVER_OPTIONS = DriverOptions(is_tls_enabled=False)\n",
46+
"QUERY_OPTIONS = QueryOptions()\n",
47+
"QUERY_OPTIONS.include_query_structure = True\n",
48+
"DB_NAME = \"typedb-graph-tutorial-py\"\n",
49+
"\n",
3650
"SCHEMA = \"\"\"\n",
3751
"define\n",
3852
" attribute name, value string;\n",
@@ -58,14 +72,7 @@
5872
"metadata": {},
5973
"outputs": [],
6074
"source": [
61-
"from typedb.driver import TypeDB, Credentials, DriverOptions, TypeDB, QueryOptions, TransactionType\n",
62-
"\n",
63-
"DB_ADDRESS = \"127.0.0.1:1729\"\n",
64-
"DB_CREDENTIALS = Credentials(\"admin\", \"password\")\n",
65-
"DRIVER_OPTIONS = DriverOptions(is_tls_enabled=False)\n",
66-
"QUERY_OPTIONS = QueryOptions()\n",
67-
"QUERY_OPTIONS.include_query_structure = True\n",
68-
"DB_NAME = \"typedb-graph-tutorial-py\"\n",
75+
"from typedb.driver import TypeDB, TypeDB, TransactionType\n",
6976
"\n",
7077
"def setup(driver, schema, data):\n",
7178
" if DB_NAME in [db.name for db in driver.databases.all()]:\n",
@@ -707,7 +714,7 @@
707714
"name": "python",
708715
"nbconvert_exporter": "python",
709716
"pygments_lexer": "ipython3",
710-
"version": "3.11.11"
717+
"version": "3.9.18"
711718
}
712719
},
713720
"nbformat": 4,

0 commit comments

Comments
 (0)