Skip to content

Commit c871baf

Browse files
dev: lint: run ruff check on examples (#32)
* run ruff check * make executable examples 19 - 20
1 parent 2782cc7 commit c871baf

15 files changed

+1
-30
lines changed

examples/001-manipulating-metadata.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# In this example script, we show you how to manage extra fields through the "metadata" attribute #
55
###################################################################################################
66

7-
from pprint import pprint
87
import elabapi_python
98

109
# use the locally defined client.py module to get the api_client object, fully configured and ready to be used to instantiate api objects

examples/002-extra-field-to-column.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# In this example script, we want to grab information from metadata and add it to the Resource as a proper column #
55
###################################################################################################################
66

7-
from pprint import pprint
87
import elabapi_python
98
import json
109

examples/01-download-timestamp-archive.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env python
2-
import time
32
import datetime
43
import elabapi_python
5-
from elabapi_python.rest import ApiException
64

75
#########################
86
# CONFIG #

examples/02-patch-metadata-per-category.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/usr/bin/env python
2-
import time
3-
import datetime
42
import elabapi_python
5-
from elabapi_python.rest import ApiException
63

74
#########################
85
# CONFIG #

examples/03-experiment-file-handling.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/usr/bin/env python
22
import os
3-
import time
4-
import datetime
53
import elabapi_python
6-
from elabapi_python.rest import ApiException
74

85
#########################
96
# CONFIG #
@@ -40,7 +37,7 @@
4037
for upload in uploadsApi.read_uploads('experiments', exp.id):
4138
print(upload.id, upload.real_name, upload.comment)
4239
# get and save file
43-
with open(f'README.downloaded_with_api.md', 'wb') as file:
40+
with open('README.downloaded_with_api.md', 'wb') as file:
4441
# the _preload_content flag is necessary so the api_client doesn't try and deserialize the response
4542
file.write(uploadsApi.read_upload('experiments', 256, upload.id, format='binary', _preload_content=False).data)
4643
# delete all the files where the name is 'README.md'

examples/04-create-teamgroup-add-user.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/usr/bin/env python
2-
import time
3-
import datetime
42
import elabapi_python
5-
from elabapi_python.rest import ApiException
63

74
#########################
85
# CONFIG #

examples/05-create-modify-item.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/usr/bin/env python
2-
import time
3-
import datetime
42
import elabapi_python
5-
from elabapi_python.rest import ApiException
63

74
#########################
85
# CONFIG #

examples/06-create-users.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/usr/bin/env python
2-
import time
3-
import datetime
42
import elabapi_python
5-
from elabapi_python.rest import ApiException
63

74
#########################
85
# CONFIG #

examples/07-patch-sysadmin-settings.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/usr/bin/env python
2-
import time
3-
import datetime
42
import elabapi_python
5-
from elabapi_python.rest import ApiException
63

74
#########################
85
# CONFIG #

examples/08-create-items-add-metadata.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/usr/bin/env python
2-
import time
3-
import datetime
42
import elabapi_python
5-
from elabapi_python.rest import ApiException
63

74
# necessary imports for this example
85
import csv

0 commit comments

Comments
 (0)