@@ -21,8 +21,13 @@ If you just want to retrieve the data of a node for another purpose, you can use
21
21
and ` ExternalServerSession ` directly:
22
22
23
23
``` python
24
- from molgenis- emx2.directory- client import DirectorySession, ExternalServerSession
25
- from molgenis- emx2.directory- client import NodeData
24
+ import logging
25
+ import asyncio
26
+ import os
27
+ from molgenis_emx2.directory_client.directory_client import DirectorySession
28
+ from molgenis_emx2.directory_client.directory_client import NodeData
29
+
30
+ os.environ[' NN_SCHEMA_PREFIX' ] = " BBMRI"
26
31
27
32
# Get the staging and published data of NL from the directory
28
33
async def get_data ():
@@ -36,18 +41,18 @@ async def get_data():
36
41
# Apply the 'signin' method with the username and password
37
42
session.signin(username, password)
38
43
39
- nl = session.get_external_node (" NL" )
44
+ nl = session.get_node (" NL" )
40
45
nl_staging_data: NodeData = session.get_staging_node_data(nl)
41
46
nl_published_data: NodeData = session.get_published_node_data(nl)
42
47
43
- # Get the data from the external server of NL
44
- external_session = ExternalServerSession(nl)
45
- nl_external_data: NodeData = external_session.get_node_data()
46
-
47
48
# Now you can use the NodeData objects as you wish
48
- for person in nl_external_data .persons.rows:
49
+ for person in nl_staging_data .persons.rows:
49
50
print (person)
50
51
52
+ # Now you can use the NodeData objects as you wish
53
+ for biobank in nl_published_data.biobanks.rows:
54
+ print (biobank)
55
+
51
56
if __name__ == " __main__" :
52
57
asyncio.run(get_data())
53
58
```
0 commit comments