FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
rspace-client-python/examples/create_folder_and_notebook.py at master · emichr/rspace-client-python · GitHub
emichr
/
rspace-client-python
Public
forked from
rspace-os/rspace-client-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
rspace-client-python
/
examples
/
create_folder_and_notebook.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
52 lines (40 loc) · 1.69 KB
Breadcrumbs
rspace-client-python
/
examples
/
create_folder_and_notebook.py
Copy path
File metadata and controls
executable file
·
52 lines (40 loc) · 1.69 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python3
from
__future__
import
print_function
import
rspace_client
def
print_forms
(
response
):
for
form
in
response
[
"forms"
]:
print
(
form
[
"globalId"
],
form
[
"name"
])
# Parse command line parameters
client
=
rspace_client
.
utils
.
createELNClient
()
print
(
"Creating a folder:"
)
response
=
client
.
create_folder
(
"Testing Folder"
)
print
(
"Folder has been created:"
,
response
[
"globalId"
],
response
[
"name"
])
print
(
"Creating a notebook in the folder:"
)
response
=
client
.
create_folder
(
"Testing Notebook"
,
parent_folder_id
=
response
[
"globalId"
],
notebook
=
True
)
print
(
"Notebook has been created:"
,
response
[
"globalId"
],
response
[
"name"
])
print
(
"Getting information about the parent folder:"
)
response
=
client
.
get_folder
(
response
[
"parentFolderId"
])
print
(
response
[
"globalId"
],
response
[
"name"
])
print
(
"Creating a folder to delete:"
)
response
=
client
.
create_folder
(
"Testing Folder to delete"
)
folder_id
=
response
[
"globalId"
]
print
(
'Folder id [{}] with name "{}" has been created:'
.
format
(
folder_id
,
response
[
"name"
]
)
)
print
(
"Deleting folder"
)
response
=
client
.
delete_folder
(
response
[
"globalId"
])
print
(
"deleted folder {}"
.
format
(
folder_id
))
print
(
"Listing all contents of home folder"
)
response
=
client
.
list_folder_tree
()
print
(
"Found {} items "
.
format
(
response
[
"totalHits"
]))
for
item
in
response
[
"records"
]:
print
(
"{}, (id = {}), type = {}"
.
format
(
item
[
"name"
],
item
[
"id"
],
item
[
"type"
]))
print
(
"Listing only documents and notebooks..."
)
response
=
client
.
list_folder_tree
(
None
, [
"document"
,
"notebook"
])
print
(
"Found {} items "
.
format
(
response
[
"totalHits"
]))
for
item
in
response
[
"records"
]:
print
(
"{}, (id = {}), type = {}"
.
format
(
item
[
"name"
],
item
[
"id"
],
item
[
"type"
]))
Back
|
FazBrowse Home
|
New Git URL