Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

MedBook Platform for Cancer Data Capture, Analysis and Sharing

Project Description

MedBookLib provides a python interface to MedBook (R version should come next).


MedBookConnection(<name optional>, <password optional>)
You begin the conversation by creating a MedBook Connection object which will be used

MedBookConnection("", "test1234");

or using the MedBook environment variables: MEDBOOKUSER, MEDBOOKPASSWORD

medbook = MedBookConnection();

This will throw an exception object if it does not make authenticated connection to the MedBook server.

MedBookConnection.find(<collection required>, <mongo query optional>, <keyword querys optional>)

The simplest find command will return all of the data objects in a collection. For example

data = medbook.find("Clinical_Info");

Some tables such as Expression2 are very large and if just need one gene from one study, you can do this by simply doing:

data = medbook.find("Expression2", { "Study_ID": "prad_wcdt", "gene": "BRCA1" });

This can be more easily expressed using the python keyword idiom:

data = medbook.find("Expression2", Study_ID="prad_wcdt", gene="BRCA1");

But use the mongo syntax to express complicated queriess,

data = medbook.find("Expression2", { "Study_ID": {"$in": [ "prad_tcga", "prad_wcdt"] }, "gene": { "$in": ["EGFR","BRCA1"]}});

You cannot combine keyword queries and mongo queries.

You must provide credentials to MedBook in the form of a name and password. There are two ways
to do this:

Preferred way: Set the MEDBOOKUSER and MEDBOOKPASSWORD environment variables. For exmaple:
export MEDBOOKPASSWORD=test1234

There is also a MEDBOOKSERVER environment variable. If no server is specificed
The default server is But you can also set the server to be your laptop.

Common ones are:



export MEDBOOKSERVER=http://localhost:20012/

Alternatively, you can provide the name and password in the parameters of the MedBookConnection object (see above).

Release History

This version
History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(3.0 kB) Copy SHA256 Hash SHA256
Source None May 21, 2015

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers