luminesce-examples (WIP)

This repo contains reference examples for Luminence.

This project is a WIP.

image info

branch status
master Build and test
master Daily build

Run using Docker

You can run with docker as follows.

Build the image:

docker build . -t luminesce-examples-runner

Run a container by passing auth credentials as environment variables:

docker run \
-e FBN_LUSID_API_URL=<API_URL> \
-e FBN_PASSWORD=<PASSWORD> \
-e FBN_APP_NAME=<APP_NAME> \
-e FBN_USERNAME=<USERNAME> \
-e FBN_CLIENT_SECRET=<CLIENT_SECRET> \
-e FBN_CLIENT_ID=<CLIENT_ID> \
-e FBN_TOKEN_URL=<TOKEN_URL> \
-e FBN_DRIVE_API_URL=<DRIVE_URL> \
-e FBN_LUMI_API_URL=<LUMI_URL> \
luminesce-examples-runner -start_dir=examples/drive

Running locally

You can run one or more of these examples locally by using the --secrets and --start_dir parameters.

For example, to run the Drive examples only:

python runner/run.py --secrets=secrets/secrets.json --start_dir=examples/drive

You can also choose to keep the sample Drive files created by the runner:

python runner/run.py --secrets=secrets/secrets.json --start_dir=examples/drive --keepfiles

List of examples

💡 The files in a directory are numbered if they need to be run in order 💡

System

For loops with cross apply

Reconcile instruments

Check for missing instrument fields

Check for price outliers

View management

File orchestration

Transactions

Corporate actions source

Instruments

Reference portfolios

Run a reconciliation

Quotes

Portfolios

Properties

Returns

Relationships

Run valuation

Holdings

Run a recon holdings in different scopes

Statistical functions

Drive

Pdf generation

Horizon

Insights

Automated testing

We run automated tests on the SQL files in this project via GitHub Actions. The configurtion for these tests live in the .github/workflows directory.

Many of our tests require setup data. To create this data, there is a process where the testing runner will search for a _data directory wherever it finds .sql files. Then, two things happen:

  1. If there are data files in the _data directory, the runner will upload these to a luminesce-examples folder in LUSID Drive
  2. If there is a setup.py file in this directory, the runner will run the setup.py file. We use this setup.py file to configure recipes and other configurations we don't want to setup via Luminesce.

Sample structure below:

upload_equity_instruments.sql
upload_bond_instruments.sql
_data
    eq_instruments.csv
    instruments.txt
    setup.py
⚠️ This file is generated, any direct edits will be lost. For instructions on how to generate the file, see docgen.