This package contains a set of utility functions and a Command Line Interface (CLI) for interacting with LUSID by FINBOURNE. To use it you'll need a LUSID account. Sign up for free at lusid.com
For more details see the lusid-python-tools wiki.
The PyPi package for lusid-python-tools can installed globally on your machine using the following command:
$ pip install lusidtools
or if you are running as a non privileged user you may prefer to install specifically for your user account:
$ pip install --user lusidtools
You will need to create a secrets file and supply its location using the secrets-file
parameter (or alternatively lusidtools will pick up a file called secrets.json
in the current directory). The steps to do this are covered in Getting started with the LUSID API and SDKs.
Make sure that the Python bin
folder is on your search path before trying the following examples. This is typically found under following locations:
- Windows: C:\Users[userid]\AppData\Local\Programs\Python[version]
- macOS: /Users/[userid]/Library/Python/[version]/bin
- Linux: /usr/local/bin/python
To see a full list of the available commands, run the following:
lusidtools --help
lusidtools instr_id --secrets-file /path/to/secrets.json
lusidtools instr_list -l 10 --secrets-file /path/to/secrets.json
lusidtools scopes --secrets-file /path/to/secrets.json
lusidtools portfolios "<scope>" --secrets-file /path/to/secrets.json
lusidtools hld "<scope>" "<portfolio-code>" --secrets-file /path/to/secrets.json
lusidtools txn "<scope>" "<portfolio-code>" --secrets-file /path/to/secrets.json
lusidtools rec \
"<scope-left>" "<portfolio-left>" "YYYY-MM-DD" \
"<scope-right>" "<portfolio-right>" "YYYY-MM-DD" \
--secrets-file /path/to/secrets.json
You can reconcile a portfolio against itself by specifying the same values for <scope-left>
/ <scope-right>
and <portfolio-left
/ <portfolio-right
> and then providing different effective dates.
We welcome contributions from our community. See our contributing guide for information on how to contribute to and report issues with the Python tools for LUSID repository.
To upgrade lusidtools run one of the commands below
$ pip install lusidtools -U
or
$ pip install lusidtools -U --user