Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
ZARP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
zavolan_group
pipelines
ZARP
Commits
e8b7584c
Commit
e8b7584c
authored
5 years ago
by
BIOPZ-Börsch Anastasiya
Browse files
Options
Downloads
Patches
Plain Diff
Add script to load LabKey tables through API
parent
9d7eca2a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!8
Labkey api
Pipeline
#10063
passed
5 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/labkey_api.py
+27
-0
27 additions, 0 deletions
scripts/labkey_api.py
with
27 additions
and
0 deletions
scripts/labkey_api.py
0 → 100644
+
27
−
0
View file @
e8b7584c
# This script targets the client api version 0.4.0 and later
#
# Check the page: https://github.com/LabKey/labkey-api-python/blob/master/samples/query_examples.py
# for example about filtering in queries.
# A starting point to investigate further is here:
# https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.Query.Filter.html
import
labkey
import
pandas
as
pd
import
sys
# for convenience, load QueryFilter explicitly (avoids long lines in filter definitions)
from
labkey.query
import
QueryFilter
if
__name__
==
"
__main__
"
:
#project_name = "TEST_ABOERSCH"
#query_name = "RNA_Seq_data_template"
project_name
=
sys
.
argv
[
1
]
query_name
=
sys
.
argv
[
2
]
server_context
=
labkey
.
utils
.
create_server_context
(
'
labkey.scicore.unibas.ch
'
,
'
/Zavolan Group/
'
+
project_name
,
'
labkey
'
,
use_ssl
=
True
)
schema_name
=
"
lists
"
results
=
labkey
.
query
.
select_rows
(
server_context
,
schema_name
,
query_name
)
print
(
results
)
table_of_data
=
pd
.
DataFrame
(
results
[
"
rows
"
])
print
(
table_of_data
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment