{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "e00686a6-c019-414e-92be-a44d32cfe138", "metadata": {}, "outputs": [], "source": [ "import os\n", "import sys\n", "import getpass\n", "\n", "from BrainAnnex.modules.neo_access.neo_access import NeoAccess" ] }, { "cell_type": "code", "execution_count": 2, "id": "0bfca9e9-2785-42b5-9c7d-04451495f7e5", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "*** SOME DIAGNOSTIC VALUES: ***\n", "\n", "sys.executable: D:\\Docs\\- MY CODE\\Brain Annex\\BA-Win7\\venv\\Scripts\\python.exe\n", "\n", "cwd: D:\\Docs\\- MY CODE\\Brain Annex\\BA-Win7\n", "\n", "sys.path using separate lines: \n", " D:\\Docs\\- MY CODE\\Brain Annex\\BA-Win7\n", " D:\\Docs\\- MY CODE\\Brain Annex\\BA-Win7\n", " C:\\Program Files\\Python 3.8.10\\python38.zip\n", " C:\\Program Files\\Python 3.8.10\\DLLs\n", " C:\\Program Files\\Python 3.8.10\\lib\n", " C:\\Program Files\\Python 3.8.10\n", " D:\\Docs\\- MY CODE\\Brain Annex\\BA-Win7\\venv\n", " \n", " D:\\Docs\\- MY CODE\\Brain Annex\\BA-Win7\\venv\\lib\\site-packages\n", " D:\\Docs\\- MY CODE\\Brain Annex\\BA-Win7\\venv\\lib\\site-packages\\win32\n", " D:\\Docs\\- MY CODE\\Brain Annex\\BA-Win7\\venv\\lib\\site-packages\\win32\\lib\n", " D:\\Docs\\- MY CODE\\Brain Annex\\BA-Win7\\venv\\lib\\site-packages\\Pythonwin\n" ] } ], "source": [ "print(\"*** SOME DIAGNOSTIC VALUES: ***\")\n", "\n", "print(\"\\nsys.executable: \", sys.executable)\n", "\n", "print(\"\\ncwd: \", os.getcwd())\n", "\n", "#print(\"\\nsys.path: \", sys.path)\n", "\n", "print(\"\\nsys.path using separate lines: \")\n", "for p in sys.path:\n", " print(\" \", p)" ] }, { "cell_type": "code", "execution_count": 3, "id": "8ebe967e-3446-4ca5-8584-9603ec532a9b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "To create a database connection, enter the host IP, but leave out the port number: (EXAMPLES: bolt://1.2.3.4 OR neo4j://localhost )\n", "\n" ] }, { "name": "stdin", "output_type": "stream", "text": [ "Enter host IP WITHOUT the port number. EXAMPLE: bolt://123.456.789.012 bolt://155.248.202.124\n", "Enter the databse password: ········\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "=> Will be using: host='bolt://155.248.202.124:7687', username='neo4j', password=**********\n" ] } ], "source": [ "print(\"To create a database connection, enter the host IP, but leave out the port number: (EXAMPLES: bolt://1.2.3.4 OR neo4j://localhost )\\n\")\n", "\n", "host = input(\"Enter host IP WITHOUT the port number. EXAMPLE: bolt://123.456.789.012\")\n", "host += \":7687\" # EXAMPLE of host value: \"bolt://123.456.789.012:7687\"\n", "\n", "password = getpass.getpass(\"Enter the database password:\")\n", "\n", "print(f\"\\n=> Will be using: host='{host}', username='neo4j', password=**********\")" ] }, { "cell_type": "code", "execution_count": 6, "id": "7247f139-9f06-41d1-98e8-410ff7c9f177", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "~~~~~~~~~ Initializing NeoAccess object ~~~~~~~~~\n", "Attempting to connect to Neo4j host 'bolt://155.248.202.124:7687', with username 'neo4j'\n", "Connection to host 'bolt://155.248.202.124:7687' established\n" ] } ], "source": [ "db = NeoAccess(host=host,\n", " credentials=(\"neo4j\", password),\n", " debug=True, autoconnect=True)" ] }, { "cell_type": "code", "execution_count": 7, "id": "c96ece03-2b07-4a4d-ad6e-e41ccbf67251", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Version of the Neo4j driver: 4.3.9\n" ] } ], "source": [ "print(\"Version of the Neo4j driver: \", db.version())" ] }, { "cell_type": "code", "execution_count": null, "id": "e93300b0-86ba-44e8-bf0f-38923084c3c1", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" } }, "nbformat": 4, "nbformat_minor": 5 }