Skip to content

Utility functions and a Command Line Interface (CLI) for interacting with LUSID by FINBOURNE.

License

Notifications You must be signed in to change notification settings

adamMQM/lusid-python-tools

 
 

Repository files navigation

Python tools for LUSID

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

LUSID by Finbourne

PyPI Daily build Build and test Commit hook Quality Gate Status

For more details see the lusid-python-tools wiki.

Installation

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

CLI usage

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

Examples:

List configured instrument identifier types

lusidtools instr_id --secrets-file /path/to/secrets.json

List instruments

lusidtools instr_list -l 10  --secrets-file /path/to/secrets.json 

List scopes

lusidtools scopes  --secrets-file /path/to/secrets.json

List portfolios in a scope

lusidtools portfolios "<scope>"  --secrets-file /path/to/secrets.json 

List holdings

lusidtools hld "<scope>" "<portfolio-code>"  --secrets-file /path/to/secrets.json 

List transactions

lusidtools txn "<scope>" "<portfolio-code>"  --secrets-file /path/to/secrets.json 

Reconcile holdings

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.

Contributing

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.

Upgrading

To upgrade lusidtools run one of the commands below

$ pip install lusidtools -U

or

$ pip install lusidtools -U --user

About

Utility functions and a Command Line Interface (CLI) for interacting with LUSID by FINBOURNE.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • Other 0.2%