Skip to content

Running the tutorials

Rizwan Saeed edited this page Dec 16, 2019 · 5 revisions

We have provided a set of examples within the repository that demonstrate how to call the LUSID API. The full tutorial series can be found at https://www.lusid.com/app/resources/tutorials.

Running the Tutorials

The tutorials can be run as tests from within the sdk folder. First set up your API credentials (if using a secrets.json file place this in the sdk folder) and install the required dependencies via pip:

$ pip install -r requirements.txt

Run the tests with the following command:

Windows:

$ set PYTHONPATH=%PYTHONPATH%;%cd%;%cd%\tests
$ python -m unittest discover -v

macOS/linux:

$ PYTHONPATH=$(pwd):$(pwd)/tests python -m unittest discover -v

Docker

The tutorials can also be run using docker. Build and run the container using docker-compose

$ docker-compose up --build && docker-compose rm -f

Alernatively run using docker commands

Build the container

$ docker build -t finbourne/lusid-sdk-python-test .

Run the tests

$ docker run --rm -it --name lusid-sdk-python-test -v `pwd`:/usr/src finbourne/lusid-sdk-python-test

Clone this wiki locally