Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 66817fd

Browse files
authoredMay 15, 2024··
replace all references to project_name parameter with container_path (#75)
* Update README.md * Update README.md * Update query_examples.py example data referenced in comment does not exist * Update query_examples.py replace project_name references with container_path * Update sampleset_domain_example.py replace project_name references with container_path * Update security_example.py replace project_name reference with container_path * Update storage.md replace project_name reference with container_path * Update experiment_example.py replace project_name with container_path * Update experiment_platemetadata_example.py replace project_name with container_path * Update domain_example.py replace project_name with container_path * Update api_wrapper.md replace references to projects with container path * Update README.md
1 parent f08d77e commit 66817fd

9 files changed

+24
-25
lines changed
 

‎README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,15 @@ from labkey.api_wrapper import APIWrapper
9393

9494
print("Create an APIWrapper")
9595
labkey_server = 'localhost:8080'
96-
project_name = 'ModuleAssayTest' # Project folder name
96+
container_path = 'Tutorials/HIV Study' # in this example, Tutorials is a project name and HIV study is a subfolder under it.
9797
contextPath = 'labkey'
9898
schema = 'core'
9999
table = 'Users'
100-
api = APIWrapper(labkey_server, project_name, contextPath, use_ssl=False)
101100

101+
# Note: If developing against localhost with https disabled, set use_ssl=False below
102+
api = APIWrapper(labkey_server, container_path, contextPath)
103+
104+
# Makes an API request to https://www.example.com/labkey/tutorials/hiv%20study/query-getQuery.api
102105
result = api.query.select_rows(schema, table)
103106

104107
if result is not None:

‎docs/api_wrapper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ from labkey.api_wrapper import APIWrapper
5252

5353
print("Create an APIWrapper")
5454
labkey_server = 'www.example.com'
55-
container_path = 'ModuleAssayTest' # Project folder name
55+
container_path = 'Tutorials/HIV Study' # Full project/folder container path
5656
contextPath = 'labkey'
5757
schema = 'core'
5858
table = 'Users'

‎docs/storage.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ The specific set of props will differ for each storage item type:
3131
from labkey.api_wrapper import APIWrapper
3232

3333
labkey_server = "localhost:8080"
34-
project_name = "FM API Test" # Project folder name
34+
container_path = 'Tutorials/HIV Study' # Full project/folder container path
3535
contextPath = "labkey"
36-
api = APIWrapper(labkey_server, project_name, contextPath, use_ssl=False)
36+
api = APIWrapper(labkey_server, container_path, contextPath, use_ssl=False)
3737

3838

3939
###############
@@ -130,4 +130,4 @@ if result is not None:
130130
else:
131131
print("Delete freezer: no results returned")
132132
exit()
133-
```
133+
```

‎samples/domain_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
from labkey.query import QueryFilter
1919

2020
labkey_server = "localhost:8080"
21-
project_name = "Study" # Project folder name
21+
container_path = 'Tutorials/HIV Study' # Full project/folder container path
2222
context_path = "labkey"
23-
api = APIWrapper(labkey_server, project_name, context_path, use_ssl=False)
23+
api = APIWrapper(labkey_server, container_path, context_path, use_ssl=False)
2424

2525
###################
2626
# Create a list domain

‎samples/experiment_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
from labkey.experiment import Batch, Run
1818

1919
labkey_server = "localhost:8080"
20-
project_name = "ModulesAssayTest" # Project folder name
20+
container_path = 'Tutorials/HIV Study' # Full project/folder container path
2121
context_path = "labkey"
22-
api = APIWrapper(labkey_server, project_name, context_path, use_ssl=False)
22+
api = APIWrapper(labkey_server, container_path, context_path, use_ssl=False)
2323

2424
assay_id = 3315 # provide one from your server
2525

‎samples/experiment_platemetadata_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
from labkey.experiment import Batch, Run
1818

1919
labkey_server = "localhost:8080"
20-
project_name = "assays" # Project folder name
20+
container_path = 'Tutorials/assay' # Full project/folder container path
2121
context_path = "labkey"
22-
api = APIWrapper(labkey_server, project_name, context_path, use_ssl=False)
22+
api = APIWrapper(labkey_server, container_path, context_path, use_ssl=False)
2323
assay_id = 310 # provide one from your server
2424

2525
###################

‎samples/query_examples.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
#
1616
"""
1717
Examples using the Query.py API
18-
19-
Sample data from the New Study tutorial on labkey.org:
20-
https://www.labkey.org/Documentation/wiki-page.view?name=studySetupManual
21-
2218
"""
2319
from labkey.api_wrapper import APIWrapper
2420
from labkey.exceptions import (
@@ -34,9 +30,9 @@
3430

3531
print("Create a server context")
3632
labkey_server = "localhost:8080"
37-
project_name = "ModuleAssayTest" # Project folder name
33+
container_path = 'Tutorials/HIV Study' # Full project/folder container path
3834
context_path = "labkey"
39-
api = APIWrapper(labkey_server, project_name, context_path, use_ssl=False)
35+
api = APIWrapper(labkey_server, container_path, context_path, use_ssl=False)
4036

4137
schema = "lists"
4238
table = "Demographics"
@@ -80,7 +76,7 @@
8076
print("Caught bad schema")
8177

8278
# catch SSL error
83-
ssl_api = APIWrapper(labkey_server, project_name, context_path, use_ssl=True)
79+
ssl_api = APIWrapper(labkey_server, container_path, context_path, use_ssl=True)
8480
try:
8581
result = ssl_api.query.select_rows(schema, table)
8682
print(result)
@@ -89,15 +85,15 @@
8985

9086

9187
# catch bad context path
92-
bad_api = APIWrapper(labkey_server, project_name, "", use_ssl=False)
88+
bad_api = APIWrapper(labkey_server, container_path, "", use_ssl=False)
9389
try:
9490
result = bad_api.query.select_rows(schema, table)
9591
print(result)
9692
except ServerNotFoundError:
9793
print("Caught context path")
9894

9995
# catch bad folder path error
100-
bad_api = APIWrapper(labkey_server, "bad_project_name", context_path, use_ssl=False)
96+
bad_api = APIWrapper(labkey_server, "bad_container_path", context_path, use_ssl=False)
10197
try:
10298
result = bad_api.query.select_rows(schema, table)
10399
print(result)

‎samples/sampleset_domain_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from labkey.api_wrapper import APIWrapper
22

33
labkey_server = "localhost:8080"
4-
project_name = "MySamples" # Project folder name
4+
container_path = "Tutorials/MySamples" # Full project/folder container path
55
context_path = "labkey"
6-
api = APIWrapper(labkey_server, project_name, context_path, use_ssl=False)
6+
api = APIWrapper(labkey_server, container_path, context_path, use_ssl=False)
77

88
###################
99
# Create a SampleSet domain

‎samples/security_example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
from labkey.exceptions import ServerNotFoundError
1818

1919
labkey_server = "localhost:8080"
20-
project_name = "Home" # Project folder name
20+
container_path = 'Tutorials/HIV Study' # Full project/folder container path
2121
contextPath = "labkey"
22-
api = APIWrapper(labkey_server, project_name, contextPath, use_ssl=False)
22+
api = APIWrapper(labkey_server, container_path, contextPath, use_ssl=False)
2323

2424

2525
###############

0 commit comments

Comments
 (0)
Please sign in to comment.