@@ -7,54 +7,54 @@ This code is intended to be illustrative and is **not** guaranteed to perform we
77
88
99## Dependencies
10- - Python 2.7 or 3.X
10+ - Python 2.7 or 3.3+
1111- ElasticSearch
1212
1313
1414## Quickstart
1515
16161 . Clone the repository:
1717
18- ``` bash
18+ ``` sh
1919 git clone https://github.com/MatchmakerExchange/reference-server.git
2020 cd reference-server
2121 ```
2222
23- 1. Install the Python package dependencies (it' s recommended that you use a [Python virtual environment](#install-es )):
23+ 1. Install the Python package dependencies (it' s recommended that you do this inside a [Python virtual environment](#install-venv )):
2424
25- ```bash
26- pip install -r requirements.txt
25+ ```sh
26+ pip install -e .
2727 ```
2828
29291. Start up your elasticsearch server in another shell (see the [ElasticSearch instructions](#install-es) for more information).
3030
31- ```bash
31+ ```sh
3232 ./path/to/elasticsearch
3333 ```
3434
35351. Download and index vocabularies and sample data:
3636
37- ```bash
38- python server.py quickstart
37+ ```sh
38+ mme- server quickstart
3939 ```
4040
41411. Run tests:
4242
43- ```bash
44- python test.py
43+ ```sh
44+ mme-server test
4545 ```
4646
47471. Start up MME reference server:
4848
49- ```bash
50- python server.py run
49+ ```sh
50+ mme- server start
5151 ```
5252
5353 By default, the server listens globally (`--host 0.0.0.0`) on port 8000 (`--port 8000`).
5454
55551. Try it out:
5656
57- ```bash
57+ ```sh
5858 curl -XPOST -H ' Content-Type: application/vnd.ga4gh.matchmaker.v1.0+json' \
5959 -H ' Accept: application/vnd.ga4gh.matchmaker.v1.0+json' \
6060 -d ' {" patient" :{
@@ -73,32 +73,32 @@ It's recommended that you run the server within a Python virtual environment so
7373
7474To set up your Python virtual environment:
7575
76- ` ` ` bash
76+ ` ` ` sh
7777# Set up virtual environment within a folder '.virtualenv' (add `-p python3` to force python 3)
7878virtualenv .virtualenv
7979
8080# Install dependencies
81- pip install -r requirements.txt
81+ pip install -e .
8282` ` `
8383
8484You can then activate this environment within a particular shell with:
8585
86- ` ` ` bash
86+ ` ` ` sh
8787source .virtualenv/bin/activate
8888` ` `
8989
9090# ## <a name="install-es"></a> ElasticSearch
9191
9292First, download elasticsearch:
9393
94- ` ` ` bash
94+ ` ` ` sh
9595wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.1.1/elasticsearch-2.1.1.tar.gz
9696tar -xzf elasticsearch-2.1.1.tar.gz
9797` ` `
9898
9999Then, start up a local elasticsearch cluster to serve as our database (` -Des.path.data=data` puts the elasticsearch indices in a subdirectory called ` data` ):
100100
101- ` ` ` bash
101+ ` ` ` sh
102102./elasticsearch-2.1.1/bin/elasticsearch -Des.path.data=data
103103` ` `
104104
@@ -109,22 +109,22 @@ Then, start up a local elasticsearch cluster to serve as our database (`-Des.pat
109109Custom patient data can be indexed by the server in two ways (if a patient ' id' matches an existing patient, the existing patient is updated):
110110
1111111. Batch index from the command line:
112- ` ` ` bash
113- python server.py index patients --filename patients.json
112+ ` ` ` sh
113+ mme- server index patients --filename patients.json
114114 ` ` `
115115
1161161. Batch index from the Python interface:
117117
118- ` ` ` python
119- >>> from models import DatastoreConnection
118+ ` ` ` py
119+ >>> from mme_server. models import DatastoreConnection
120120 >>> db = DatastoreConnection ()
121121 >>> db.patients.index(' /path/to/patients.json' )
122122 ` ` `
123123
1241241. Single patient index the Python interface:
125125
126- ` ` ` python
127- >>> from models import Patient, DatastoreConnection
126+ ` ` ` py
127+ >>> from mme_server. models import Patient, DatastoreConnection
128128 >>> db = DatastoreConnection ()
129129 >>> patient = Patient.from_api({...})
130130 >>> db.patients.index_patient(patient)
0 commit comments