Skip to content

Commit 71166e7

Browse files
committed
.
1 parent 7b60bef commit 71166e7

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.env
22
venv/
3-
SpotifyCollabGraph/connectTest.py
43
__pycache__/
54
*.cache

SpotifyCollabGraph/connectTest.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import os
2+
3+
import requests
4+
import xml.etree.ElementTree as ET
5+
from dotenv import load_dotenv
6+
from pathlib import Path
7+
from requests.auth import HTTPBasicAuth
8+
9+
env_path = Path('../') / '.env'
10+
load_dotenv(dotenv_path=env_path)
11+
12+
url = os.getenv("NEO4J_URI_HTTP_MAGNACLOUDA") + "/db/neo4j/query/v2"
13+
auth = HTTPBasicAuth(os.getenv("NEO4J_USERNAME"), os.getenv("NEO4J_PASSWORD"))
14+
15+
payload = {
16+
"statement": "MATCH (n:Artist) RETURN n",
17+
18+
}
19+
20+
headers = {
21+
"Content-Type": "application/json"
22+
}
23+
24+
def artists_test_query():
25+
response = requests.post(url, json=payload, auth=auth, headers=headers)
26+
return response.json()
27+
28+
29+
30+
31+

0 commit comments

Comments
 (0)