The LUSID Python SDK provides convenient access to the LUSID REST API in Python 3.11+ environments.
Note: Supporting applications in the FINBOURNE platform (such as Drive, Scheduler and Luminesce) have their own Python SDKs.
You can install the latest version of the LUSID Python SDK from PyPi using your preferred package manager, for example:
$ pip install lusid-sdkNote the following:
Python 3.11 or later is required.
If you are upgrading from an earlier major version, read these instructions.
We strongly recommend pinning a SDK to an exact version to control when you take updates and make your builds repeatable.
You can download the source instead by cloning the Github repo. Note if you do, the
mainbranch may not always have the latest REST API version.
To authenticate for the first time, you must generate a client ID and secret and store them with the credentials of a valid LUSID user as either environment variables or in a secrets file. The LUSID Python SDK uses these credentials to obtain a short-lived API access token from FINBOURNE's identity provider (Okta) on demand. More information.
For code samples for simple operations such as creating portfolios, upserting transactions and generating holdings, start with the Github readme. For more complex examples, examine the sample Juypter Notebooks available to run in your LUSID domain.
Documentation for SDK methods is available with code samples in Github, or as a searchable package on Readthedocs (the content is the same).