Skip to main content

This is the Python SDK for all of FINBOURNE's APIs

Project description

LUSID_by_Finbourne

Finbourne Python SDK

Contents

Summary

This is the python SDK for all of Finbourne's applications, part of the LUSID by FINBOURNE platform. To use it you'll need a LUSID account - sign up for free at lusid.com.

Some description For more details on other applications in the LUSID platform, see Understanding all the applications in the LUSID platform.

This sdk supports Production, Early Access, Beta and Experimental API endpoints. For more details on API endpoint categories, see What is the LUSID feature release lifecycle. To find out which category an API endpoint falls into, see the api reference.

This code is automatically generated by the OpenAPI Generator project.

Endpoints and models

Versions

  • SDK version: 0.1.11

Requirements

  • Python 3.9+

Installation

If using uv

uv add finbourne-sdk

If using pip

pip install finbourne-sdk

Then import the package in your python file

import finbourne.sdk

Getting Started

You'll need to provide some configuration to connect to the Merged OpenAPI Specification - see the articles about short-lived access tokens and a long-lived Personal Access Token. This configuration can be provided using a secrets file or environment variables.

For some configuration it is also possible to override the global configuration at the ApiClientFactory level, or at the request level. For the set of configuration which can be overridden, please see ConfigurationOptions. For a code illustration of this configuration being overridden, please see the example.

Environment variables

Required for a short-lived access token

FBN_TOKEN_URL
FBN_BASE_URL
FBN_USERNAME
FBN_PASSWORD
FBN_CLIENT_ID
FBN_CLIENT_SECRET

Required for a long-lived access token

FBN_BASE_URL
FBN_ACCESS_TOKEN

Other optional configuration

# sdk client timeouts in milliseconds - a value of 0 means no timeout, otherwise timeout values must be a positive integer
# please note - the chances of seeing a network issue increase with the duration of the request
# for this reason, rather than increasing the timeout, it will be more reliable to use an alternate polling style endpoint where these exist
FBN_TOTAL_TIMEOUT_MS # the default is 1800000 (30 minutes)
FBN_CONNECT_TIMEOUT_MS # the default is 0 (no timeout)
FBN_READ_TIMEOUT_MS # the default is 0 (no timeout)
FBN_RATE_LIMIT_RETRIES # the default is 2

Secrets file

The secrets file must be in the current working directory. By default the SDK looks for a secrets file called secrets.json

Required for a short-lived access token

{
  "profiles": {
    "default": {
        "tokenUrl":"<your-token-url>",
        "baseUrl":"https://<your-domain>.lusid.com",
        "username":"<your-username>",
        "password":"<your-password>",
        "clientId":"<your-client-id>",
        "clientSecret":"<your-client-secret>"
    }
}

Required for a long-lived access token

{
  "profiles": {
    "default": {
        "baseUrl":"https://<your-domain>.lusid.com",
        "accessToken":"<your-access-token>"
    }
}

Authentication Example

The minimum requirements for authentication are having the FBN_ACCESS_TOKEN and FBN_FINBOURNE/SDK_URL environment variables set, or a secrets.json file with the accessToken and finbourneSdkUrl fields populated.

Authenticate using environment variables:

from finbourne.sdk.extensions import SyncApiClientFactory

# The factory will automatically read from the FBN_* environment variables
api_client_factory = SyncApiClientFactory()

Authenticate using a secrets file:

import os
from finbourne.sdk.extensions import SyncApiClientFactory

os.environ["LUSID_SECRETS_FILE"] = "/path/to/my/secrets.json"
api_client_factory = SyncApiClientFactory()

Authenticate with configuration overrides:

from finbourne.sdk.extensions import SyncApiClientFactory
from finbourne.sdk.extensions.configuration_options import ConfigurationOptions

opts = ConfigurationOptions()
opts.total_timeout_ms = 30_000
api_client_factory = SyncApiClientFactory(opts=opts)

Using the Python async client:

from finbourne.sdk.extensions import ApiClientFactory
async with api_factory:
    application_meta_data_api = api_factory.build(lusid.ApplicationMetadataApi)
    await application_meta_data_api.get_lusid_versions_async()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finbourne_sdk-0.1.11.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finbourne_sdk-0.1.11-py3-none-any.whl (6.8 MB view details)

Uploaded Python 3

File details

Details for the file finbourne_sdk-0.1.11.tar.gz.

File metadata

  • Download URL: finbourne_sdk-0.1.11.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.2

File hashes

Hashes for finbourne_sdk-0.1.11.tar.gz
Algorithm Hash digest
SHA256 d4c6adab8f1a9e251c9cf84ab774e4fb786086a7211bd4da2d59912cdfb43b93
MD5 9c922f70fe2586e88fe8999b397df578
BLAKE2b-256 447dd1fa2c466d3ad8706a0bddddd292170d2041254514cbf17730712067e695

See more details on using hashes here.

File details

Details for the file finbourne_sdk-0.1.11-py3-none-any.whl.

File metadata

File hashes

Hashes for finbourne_sdk-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 822d34f884280b1a6ba2adc779850d2dea0b828907935cf089955b5851119736
MD5 2a9c35f7a0a18d003fb3a99a90663bf1
BLAKE2b-256 3093e39b45f06783015f023a281716b7a2478050acaf12b51fb269e8441297b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page