Exemplo n.º 1
0
# Create the LIMS interface instance, and check the connection and version.
lims = Lims(BASEURI, USERNAME, PASSWORD)
lims.check_version()

# Get the list of all projects.
projects = lims.get_projects()
print len(projects), 'projects in total'

# Get the list of all projects opened since May 30th 2012.
day = '2012-05-30'
projects = lims.get_projects(open_date=day)
print len(projects), 'projects opened since', day

# Get the project with the specified LIMS id, and print some info.
project = lims.get_project('KRA61')
print project, project.name, project.open_date

print 'UDFs:'
for key, value in project.udf.items():
    if isinstance(value, unicode):
        value = codecs.encode(value, 'UTF-8')
    print ' ', key, '=', value

udt = project.udt
if udt:
    print 'UDT:', udt.udt
    for key, value in udt.items():
        if isinstance(value, unicode):
            value = codecs.encode(value, 'UTF-8')
        print ' ', key, '=', value
Exemplo n.º 2
0
from genologics.lims import Lims

# Login parameters for connecting to a LIMS instance.
# NOTE: Modify according to your setup.
from genologics.site_cloud import BASEURI, USERNAME, PASSWORD

# Create the LIMS interface instance, and check the connection and version.
lims = Lims(BASEURI, USERNAME, PASSWORD)
lims.check_version()

# Get the list of all samples.
samples = lims.get_samples()
print len(samples), 'samples in total'

# Get the list of samples in the project with the LIMS id KLL60.
project = lims.get_project('KLL60')
samples = lims.get_samples(projectlimsid=project.id)
print len(samples), 'samples in', project

print
# Get the sample with the LIMS id JGR58A21, and print info and its UDFs.
sample = lims.get_sample('JGR58A21')
print sample.id, sample.name, sample.date_received, sample.uri,
for key, value in sample.udf.items():
    print ' ', key, '=', value

# Get the sample with the name 'Joels proper sample-20'.
# Check that it is the sample as the previously obtained sample;
# not just equal, but exactly the same instance, courtesy of the Lims cache.
samples = lims.get_samples(name='Joels proper sample-20')
print samples[0].name, samples[0] is sample