This repository was archived by the owner on Sep 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First commit after rescuing original setup.
- Loading branch information
0 parents
commit 65e24c5
Showing
13 changed files
with
1,401 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
site_*.py | ||
*.pyc | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
## Python interface to the GenoLogics LIMS server via its REST API. | ||
|
||
A basic module for interacting with the GenoLogics LIMS server via | ||
its REST API. The goal is to provide simple access to the most common | ||
entities and their attributes in a reasonably Pythonic fashion. | ||
|
||
### Design | ||
|
||
All instances of Project, Sample, Artifact, etc should be obtained using | ||
the get_* methods of the Lims class, which keeps an internal cache of | ||
current instances. The idea is to create one and only one instance in | ||
a running script for representing an item in the database. If one has | ||
more than one instance representing the same item, there is a danger that | ||
one of them gets updated and not the others. | ||
|
||
An instance of Project, Sample, Artifact, etc, retrieves lazily (i.e. | ||
only when required) its XML representation from the database. This | ||
is parsed and kept as an ElementTree within the instance. All access | ||
to predefined attributes goes via descriptors which read from or | ||
modify the ElementTree. This simplifies writing back an updated | ||
instance to the database. | ||
|
||
### Installation | ||
|
||
The 'genologics' directory should be made accessible in your Python path, | ||
by whatever method suits your installation. | ||
|
||
### Usage | ||
|
||
The client script imports the class Lims from the genologics.lims module, | ||
and instantiates it with the required arguments: | ||
|
||
- Base URI of the server, including the port number, but excluding | ||
the '/api/v1' segment of the path. | ||
- User name of the account on the server. | ||
- Password of the account on the server. | ||
|
||
### Example scripts | ||
|
||
Usage example scripts are provided in the subdirectory 'examples'. | ||
|
||
NOTE: The example files rely on specific entities and configurations | ||
on the server, and use base URI, user name and password, so to work | ||
for your server, all these must be reviewed and modified. | ||
|
||
### Caveats | ||
|
||
The interface has not been used much yet, so it is not properly debugged. | ||
|
||
Known issues: | ||
- Artifact state is part of its URL (as a query parameter). | ||
It is not entirely clear how to deal with this in the Lims.cache: | ||
Currently, an artifact that has the current state may be represented | ||
by a URL that includes the state, and another that does not contain it. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"""Python interface to GenoLogics LIMS via its REST API. | ||
Per Kraulis, Science for Life Laboratory, Stockholm, Sweden. | ||
Copyright (C) 2012 Per Kraulis | ||
""" |
Oops, something went wrong.