|
57 | 57 | }, |
58 | 58 | "outputs": [], |
59 | 59 | "source": [ |
60 | | - "%pip install \"graphdatascience>=1.15\"" |
| 60 | + "%pip install \"graphdatascience>=1.15\" python-dotenv" |
| 61 | + ] |
| 62 | + }, |
| 63 | + { |
| 64 | + "cell_type": "code", |
| 65 | + "execution_count": null, |
| 66 | + "metadata": {}, |
| 67 | + "outputs": [], |
| 68 | + "source": [ |
| 69 | + "from dotenv import load_dotenv\n", |
| 70 | + "\n", |
| 71 | + "# This allows to load required secrets from `.env` file in local directory\n", |
| 72 | + "# This can include Aura API Credentials. If file does not exist this is a noop.\n", |
| 73 | + "load_dotenv(\".env\")" |
61 | 74 | ] |
62 | 75 | }, |
63 | 76 | { |
|
79 | 92 | "\n", |
80 | 93 | "from graphdatascience.session import AuraAPICredentials, GdsSessions\n", |
81 | 94 | "\n", |
82 | | - "client_id = os.environ[\"AURA_API_CLIENT_ID\"]\n", |
83 | | - "client_secret = os.environ[\"AURA_API_CLIENT_SECRET\"]\n", |
| 95 | + "# If your account is a member of several project, you must also specify the project ID to use\n", |
84 | 96 | "\n", |
85 | | - "# If your account is a member of several projects, you must also specify the project ID to use\n", |
86 | | - "project_id = os.environ.get(\"AURA_API_PROJECT_ID\", None)\n", |
| 97 | + "api_credentials = AuraAPICredentials(\n", |
| 98 | + " client_id=os.environ[\"CLIENT_ID\"],\n", |
| 99 | + " client_secret=os.environ[\"CLIENT_SECRET\"],\n", |
| 100 | + " project_id=os.environ.get(\"PROJECT_ID\", None),\n", |
| 101 | + ")\n", |
87 | 102 | "\n", |
88 | | - "sessions = GdsSessions(api_credentials=AuraAPICredentials(client_id, client_secret, project_id=project_id))" |
| 103 | + "sessions = GdsSessions(api_credentials=api_credentials)" |
89 | 104 | ] |
90 | 105 | }, |
91 | 106 | { |
|
146 | 161 | "\n", |
147 | 162 | "# Identify the Neo4j DBMS\n", |
148 | 163 | "db_connection = DbmsConnectionInfo(\n", |
149 | | - " uri=os.environ[\"NEO4J_URI\"], username=os.environ[\"NEO4J_USER\"], password=os.environ[\"NEO4J_PASSWORD\"]\n", |
| 164 | + " uri=os.environ[\"NEO4J_URI\"],\n", |
| 165 | + " username=os.environ[\"NEO4J_USERNAME\"],\n", |
| 166 | + " password=os.environ[\"NEO4J_PASSWORD\"],\n", |
150 | 167 | ")\n", |
151 | 168 | "\n", |
152 | 169 | "# Create a GDS session!\n", |
|
0 commit comments