Metadata-Version: 2.4
Name: finbourne-sdk
Version: 0.1.12
Summary: This is the Python SDK for all of FINBOURNE's APIs
Project-URL: Repository, https://github.com/finbourne/finbourne-sdk-python.git
Author-email: Finbourne Technology LTD <info@finbourne.com>
License: MIT
Keywords: Merged OpenAPI Specification,OpenAPI,OpenAPI-Generator,finbourne-sdk
Requires-Python: >=3.11
Requires-Dist: aenum<4.0.0,>=3.1.11
Requires-Dist: aiohttp<4.0.0,>=3.13.4
Requires-Dist: pydantic<3.0.0,>=2.6.3
Requires-Dist: python-dateutil<3.0.0,>=2.8.2
Requires-Dist: requests<3.0.0,>=2.32.4
Requires-Dist: urllib3<3.0.0,>=2.6.3
Provides-Extra: dev
Requires-Dist: flake8<5.0.0,>=4.0.0; extra == 'dev'
Requires-Dist: pyright>=1.1.408; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest>=9.0.3; extra == 'dev'
Requires-Dist: ruff>=0.15.12; extra == 'dev'
Requires-Dist: xeger<1.0.0,>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

![LUSID_by_Finbourne](./resources/Finbourne_Logo_Teal.svg)

# Finbourne Python SDK

## Contents

- [Summary](#summary)
- [Endpoints and models](#endpoints-and-models)
- [Versions](#versions)
- [Requirements](#requirements)
- [Installation](#installation)
- [Getting Started](#getting-started)
    * [Environment variables](#environment-variables)
    * [Secrets file](#secrets-file)
    * [Authentication Example](#authentication-example)

## Summary

This is the python SDK for all of Finbourne's applications, part of the [LUSID by FINBOURNE](https://www.finbourne.com/lusid-technology) platform. To use it you'll need a LUSID account - [sign up for free at lusid.com](https://www.lusid.com/app/signup).

Some description
For more details on other applications in the LUSID platform, see [Understanding all the applications in the LUSID platform](https://support.lusid.com/knowledgebase/article/KA-01787).

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](https://support.lusid.com/knowledgebase/article/KA-01786). To find out which category an API endpoint falls into, see the [api reference](https://www.lusid.com/docs/api/intro).

This code is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project.

## Endpoints and models

- See [Documentation for API Endpoints](finbourne/sdk/docs/api_endpoints.md) for a description of each endpoint
- See [Documentation for Models](finbourne/sdk/docs/models.md) for descriptions of the models used


## Versions
- SDK version: 0.1.12

## Requirements

- Python 3.9+

## Installation

If using [uv](https://docs.astral.sh/uv/)

```
uv add finbourne-sdk
```

If using [pip](https://pypi.org/project/pip/)

```
pip install finbourne-sdk
```

Then import the package in your python file
```python
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](https://support.lusid.com/knowledgebase/article/KA-01654) and a [long-lived Personal Access Token](https://support.lusid.com/knowledgebase/article/KA-01774). 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](sdk/finbourne/sdk/extensions/configuration_options.py). For a code illustration of this configuration being overridden, please see the [example](#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

```bash
# 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
```json
{
  "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
```json
{
  "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:
```python
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:
```python
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:
```python
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:
```python
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()

```
