# lusid-drive-sdk
FINBOURNE Technology
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 0.1.632
- Package version: 2.1.5
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://www.finbourne.com](https://www.finbourne.com)
## Requirements.
Python 3.7+
## Installation & Usage
### pip install
If the python package is hosted on a repository, you can install directly using:
```sh
pip install git+https://github.com/finbourne/drive-sdk-python.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/finbourne/drive-sdk-python.git`)
Then import the package:
```python
import lusid_drive
```
### Setuptools
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)
Then import the package:
```python
import lusid_drive
```
### Tests
Execute `pytest` to run the tests.
## Getting Started
You'll need to provide some configuration to connect to the lusid_drive application.
These can be provided using a secrets file or environment variables.
### Environment variables
In order to use [short lived access tokens](https://support.lusid.com/knowledgebase/article/KA-01654/en-us) you will need to have appropriate values set for the following environment variables:
```
FBN_TOKEN_URL,
FBN_LUSID_DRIVE_API_URL,
FBN_USERNAME,
FBN_PASSWORD,
FBN_CLIENT_ID,
FBN_CLIENT_SECRET
```
To use a long lived Personal Access Token, you must provide the following environment variables:
```
FBN_LUSID_DRIVE_API_URL,
FBN_ACCESS_TOKEN
```
You can send your requests to lusid_drive via a proxy, by setting `FBN_PROXY_ADDRESS`.
If your proxy has basic auth enabled, you must akso supply `FBN_PROXY_USERNAME` and `FBN_PROXY_PASSWORD`
### Secrets file
In order to use [short lived access tokens](https://support.lusid.com/knowledgebase/article/KA-01654/en-us) you will need to have appropriate values set in a `secrets.json` file in the same folder as your script.
```
{
"api":
{
"tokenUrl":"<your-token-url>",
"lusid_driveUrl":"<FINBOURNE-application-url>",
"username":"<your-username>",
"password":"<your-password>",
"clientId":"<your-client-id>",
"clientSecret":"<your-client-secret>",
}
}
```
To use a long lived Personal Access Token, you must provide a `secrets.json` with the following variables:
```
{
"api":
{
"lusid_driveUrl":"<FINBOURNE-application-url>",
"accessToken":"<your-access-token>"
}
}
```
You can send your requests to lusid_drive via a proxy, by adding a proxy section to your `secrets.json`.
If your proxy has basic auth enabled, you must also supply a `username` and `password` in this section.
```
{
"api":
{
"lusid_driveUrl":"<FINBOURNE-application-url>",
"accessToken":"<your-access-token>"
},
"proxy":
{
"address":"<your-proxy-address>",
"username":"<your-proxy-username>",
"password":"<your-proxy-password>"
}
}
```
### Using the SDK
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
import time
import lusid_drive
from lusid_drive.exceptions import ApiException
from pprint import pprint
import os
from lusid_drive import (
ApiClientFactory,
ApplicationMetadataApi,
EnvironmentVariablesConfigurationLoader,
SecretsFileConfigurationLoader,
ArgsConfigurationLoader
)
# Use the lusid_drive ApiClientFactory to build Api instances with a configured api client
# By default this will read config from environment variables
# Then from a secrets.json file found in the current working directory
api_client_factory = ApiClientFactory()
# The ApiClientFactory can be passed an iterable of configuration loaders to read configuration from
api_url = "https://fbn-prd.lusid.com/drive"
# Path to a secrets.json file containing authentication credentials
# See https://support.lusid.com/knowledgebase/article/KA-01667/en-us
# for a detailed guide to setting up the SDK make authenticated calls to LUSID APIs
secrets_path = os.getenv("FBN_SECRETS_PATH")
app_name="LusidJupyterNotebook"
config_loaders = [
EnvironmentVariablesConfigurationLoader(),
SecretsFileConfigurationLoader(api_secrets_file=secrets_path),
ArgsConfigurationLoader(api_url=api_url, app_name=app_name)
]
api_client_factory = ApiClientFactory(config_loaders=config_loaders)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Enter a context with an instance of the ApiClientFactory to ensure the connection pool is closed after use
async with api_client_factory:
# Create an instance of the API class
api_instance = api_client_factory.build(ApplicationMetadataApi)
try:
# [EARLY ACCESS] ListAccessControlledResources: Get resources available for access control
api_response = await api_instance.list_access_controlled_resources()
print("The response of ApplicationMetadataApi->list_access_controlled_resources:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling ApplicationMetadataApi->list_access_controlled_resources: %s\n" % e)
```
## Documentation for API Endpoints
All URIs are relative to *https://fbn-prd.lusid.com/drive*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ApplicationMetadataApi* | [**list_access_controlled_resources**](docs/ApplicationMetadataApi.md#list_access_controlled_resources) | **GET** /api/metadata/access/resources | [EARLY ACCESS] ListAccessControlledResources: Get resources available for access control
*FilesApi* | [**create_file**](docs/FilesApi.md#create_file) | **POST** /api/files | [EARLY ACCESS] CreateFile: Uploads a file to Lusid Drive. If using an SDK, consider using the UploadAsStreamAsync function for larger files instead.
*FilesApi* | [**delete_file**](docs/FilesApi.md#delete_file) | **DELETE** /api/files/{id} | [EARLY ACCESS] DeleteFile: Deletes a file from Drive.
*FilesApi* | [**download_file**](docs/FilesApi.md#download_file) | **GET** /api/files/{id}/contents | [EARLY ACCESS] DownloadFile: Download the file from Drive.
*FilesApi* | [**get_file**](docs/FilesApi.md#get_file) | **GET** /api/files/{id} | [EARLY ACCESS] GetFile: Get a file stored in Drive.
*FilesApi* | [**update_file_contents**](docs/FilesApi.md#update_file_contents) | **PUT** /api/files/{id}/contents | [EARLY ACCESS] UpdateFileContents: Updates contents of a file in Drive.
*FilesApi* | [**update_file_metadata**](docs/FilesApi.md#update_file_metadata) | **PUT** /api/files/{id} | [EARLY ACCESS] UpdateFileMetadata: Updates metadata for a file in Drive.
*FoldersApi* | [**create_folder**](docs/FoldersApi.md#create_folder) | **POST** /api/folders | [EARLY ACCESS] CreateFolder: Create a new folder in LUSID Drive
*FoldersApi* | [**delete_folder**](docs/FoldersApi.md#delete_folder) | **DELETE** /api/folders/{id} | [EARLY ACCESS] DeleteFolder: Delete a specified folder and all subfolders
*FoldersApi* | [**get_folder**](docs/FoldersApi.md#get_folder) | **GET** /api/folders/{id} | [EARLY ACCESS] GetFolder: Get metadata of folder
*FoldersApi* | [**get_folder_contents**](docs/FoldersApi.md#get_folder_contents) | **GET** /api/folders/{id}/contents | [EARLY ACCESS] GetFolderContents: List contents of a folder
*FoldersApi* | [**get_root_folder**](docs/FoldersApi.md#get_root_folder) | **GET** /api/folders | [EARLY ACCESS] GetRootFolder: List contents of root folder
*FoldersApi* | [**move_folder**](docs/FoldersApi.md#move_folder) | **POST** /api/folders/{id} | [EARLY ACCESS] MoveFolder: Move files to specified folder
*FoldersApi* | [**update_folder**](docs/FoldersApi.md#update_folder) | **PUT** /api/folders/{id} | [EARLY ACCESS] UpdateFolder: Update an existing folder's name, path
*SearchApi* | [**search**](docs/SearchApi.md#search) | **POST** /api/search | [EARLY ACCESS] Search: Search for a file or folder with a given name and path
## Documentation For Models
- [AccessControlledAction](docs/AccessControlledAction.md)
- [AccessControlledResource](docs/AccessControlledResource.md)
- [ActionId](docs/ActionId.md)
- [CreateFolder](docs/CreateFolder.md)
- [IdSelectorDefinition](docs/IdSelectorDefinition.md)
- [IdentifierPartSchema](docs/IdentifierPartSchema.md)
- [Link](docs/Link.md)
- [LusidProblemDetails](docs/LusidProblemDetails.md)
- [LusidValidationProblemDetails](docs/LusidValidationProblemDetails.md)
- [PagedResourceListOfStorageObject](docs/PagedResourceListOfStorageObject.md)
- [ResourceListOfAccessControlledResource](docs/ResourceListOfAccessControlledResource.md)
- [SearchBody](docs/SearchBody.md)
- [StorageObject](docs/StorageObject.md)
- [UpdateFile](docs/UpdateFile.md)
- [UpdateFolder](docs/UpdateFolder.md)
<a id="documentation-for-authorization"></a>
## Documentation For Authorization
Authentication schemes defined for the API:
<a id="oauth2"></a>
### oauth2
- **Type**: OAuth
- **Flow**: implicit
- **Authorization URL**: https://lusid.okta.com/oauth2/default/v1/authorize
- **Scopes**: N/A
## Author
info@finbourne.com
Raw data
{
"_id": null,
"home_page": "https://github.com/finbourne/drive-sdk-python",
"name": "lusid-drive-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "OpenAPI, OpenAPI-Generator, FINBOURNE Drive API, lusid-drive-sdk",
"author": "FINBOURNE Technology",
"author_email": "info@finbourne.com",
"download_url": "https://files.pythonhosted.org/packages/d4/61/05299a24b922bab46bb648c6b70bab08df39b8ea6d957f72cb27134f274b/lusid_drive_sdk-2.1.5.tar.gz",
"platform": null,
"description": "# lusid-drive-sdk\nFINBOURNE Technology\n\nThis Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:\n\n- API version: 0.1.632\n- Package version: 2.1.5\n- Build package: org.openapitools.codegen.languages.PythonClientCodegen\nFor more information, please visit [https://www.finbourne.com](https://www.finbourne.com)\n\n## Requirements.\n\nPython 3.7+\n\n## Installation & Usage\n### pip install\n\nIf the python package is hosted on a repository, you can install directly using:\n\n```sh\npip install git+https://github.com/finbourne/drive-sdk-python.git\n```\n(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/finbourne/drive-sdk-python.git`)\n\nThen import the package:\n```python\nimport lusid_drive\n```\n\n### Setuptools\n\nInstall via [Setuptools](http://pypi.python.org/pypi/setuptools).\n\n```sh\npython setup.py install --user\n```\n(or `sudo python setup.py install` to install the package for all users)\n\nThen import the package:\n```python\nimport lusid_drive\n```\n\n### Tests\n\nExecute `pytest` to run the tests.\n\n## Getting Started\n\nYou'll need to provide some configuration to connect to the lusid_drive application.\nThese can be provided using a secrets file or environment variables.\n\n### Environment variables\n\nIn order to use [short lived access tokens](https://support.lusid.com/knowledgebase/article/KA-01654/en-us) you will need to have appropriate values set for the following environment variables:\n\n``` \nFBN_TOKEN_URL,\nFBN_LUSID_DRIVE_API_URL,\nFBN_USERNAME,\nFBN_PASSWORD,\nFBN_CLIENT_ID,\nFBN_CLIENT_SECRET\n```\n\nTo use a long lived Personal Access Token, you must provide the following environment variables:\n``` \nFBN_LUSID_DRIVE_API_URL,\nFBN_ACCESS_TOKEN\n```\n\nYou can send your requests to lusid_drive via a proxy, by setting `FBN_PROXY_ADDRESS`. \nIf your proxy has basic auth enabled, you must akso supply `FBN_PROXY_USERNAME` and `FBN_PROXY_PASSWORD`\n\n### Secrets file\n\nIn order to use [short lived access tokens](https://support.lusid.com/knowledgebase/article/KA-01654/en-us) you will need to have appropriate values set in a `secrets.json` file in the same folder as your script.\n\n``` \n{\n \"api\":\n {\n \"tokenUrl\":\"<your-token-url>\",\n \"lusid_driveUrl\":\"<FINBOURNE-application-url>\",\n \"username\":\"<your-username>\",\n \"password\":\"<your-password>\",\n \"clientId\":\"<your-client-id>\",\n \"clientSecret\":\"<your-client-secret>\",\n }\n}\n```\n\nTo use a long lived Personal Access Token, you must provide a `secrets.json` with the following variables:\n``` \n{\n \"api\":\n {\n \"lusid_driveUrl\":\"<FINBOURNE-application-url>\",\n \"accessToken\":\"<your-access-token>\"\n }\n}\n```\n\nYou can send your requests to lusid_drive via a proxy, by adding a proxy section to your `secrets.json`. \nIf your proxy has basic auth enabled, you must also supply a `username` and `password` in this section.\n\n``` \n{\n \"api\":\n {\n \"lusid_driveUrl\":\"<FINBOURNE-application-url>\",\n \"accessToken\":\"<your-access-token>\"\n },\n \"proxy\":\n {\n \"address\":\"<your-proxy-address>\",\n \"username\":\"<your-proxy-username>\",\n \"password\":\"<your-proxy-password>\"\n }\n}\n```\n\n### Using the SDK\n\nPlease follow the [installation procedure](#installation--usage) and then run the following:\n\n```python\n\nimport time\nimport lusid_drive\nfrom lusid_drive.exceptions import ApiException\nfrom pprint import pprint\n\nimport os\nfrom lusid_drive import (\n ApiClientFactory,\n ApplicationMetadataApi,\n EnvironmentVariablesConfigurationLoader,\n SecretsFileConfigurationLoader,\n ArgsConfigurationLoader\n)\n\n# Use the lusid_drive ApiClientFactory to build Api instances with a configured api client\n# By default this will read config from environment variables\n# Then from a secrets.json file found in the current working directory\napi_client_factory = ApiClientFactory()\n\n# The ApiClientFactory can be passed an iterable of configuration loaders to read configuration from\n\napi_url = \"https://fbn-prd.lusid.com/drive\"\n# Path to a secrets.json file containing authentication credentials\n# See https://support.lusid.com/knowledgebase/article/KA-01667/en-us\n# for a detailed guide to setting up the SDK make authenticated calls to LUSID APIs\nsecrets_path = os.getenv(\"FBN_SECRETS_PATH\")\napp_name=\"LusidJupyterNotebook\"\n\nconfig_loaders = [\n\tEnvironmentVariablesConfigurationLoader(),\n\tSecretsFileConfigurationLoader(api_secrets_file=secrets_path),\n\tArgsConfigurationLoader(api_url=api_url, app_name=app_name)\n]\napi_client_factory = ApiClientFactory(config_loaders=config_loaders)\n\n\n# The client must configure the authentication and authorization parameters\n# in accordance with the API server security policy.\n\n\n\n# Enter a context with an instance of the ApiClientFactory to ensure the connection pool is closed after use\nasync with api_client_factory:\n # Create an instance of the API class\n api_instance = api_client_factory.build(ApplicationMetadataApi)\n\n try:\n # [EARLY ACCESS] ListAccessControlledResources: Get resources available for access control\n api_response = await api_instance.list_access_controlled_resources()\n print(\"The response of ApplicationMetadataApi->list_access_controlled_resources:\\n\")\n pprint(api_response)\n except ApiException as e:\n print(\"Exception when calling ApplicationMetadataApi->list_access_controlled_resources: %s\\n\" % e)\n\n```\n\n## Documentation for API Endpoints\n\nAll URIs are relative to *https://fbn-prd.lusid.com/drive*\n\nClass | Method | HTTP request | Description\n------------ | ------------- | ------------- | -------------\n*ApplicationMetadataApi* | [**list_access_controlled_resources**](docs/ApplicationMetadataApi.md#list_access_controlled_resources) | **GET** /api/metadata/access/resources | [EARLY ACCESS] ListAccessControlledResources: Get resources available for access control\n*FilesApi* | [**create_file**](docs/FilesApi.md#create_file) | **POST** /api/files | [EARLY ACCESS] CreateFile: Uploads a file to Lusid Drive. If using an SDK, consider using the UploadAsStreamAsync function for larger files instead.\n*FilesApi* | [**delete_file**](docs/FilesApi.md#delete_file) | **DELETE** /api/files/{id} | [EARLY ACCESS] DeleteFile: Deletes a file from Drive.\n*FilesApi* | [**download_file**](docs/FilesApi.md#download_file) | **GET** /api/files/{id}/contents | [EARLY ACCESS] DownloadFile: Download the file from Drive.\n*FilesApi* | [**get_file**](docs/FilesApi.md#get_file) | **GET** /api/files/{id} | [EARLY ACCESS] GetFile: Get a file stored in Drive.\n*FilesApi* | [**update_file_contents**](docs/FilesApi.md#update_file_contents) | **PUT** /api/files/{id}/contents | [EARLY ACCESS] UpdateFileContents: Updates contents of a file in Drive.\n*FilesApi* | [**update_file_metadata**](docs/FilesApi.md#update_file_metadata) | **PUT** /api/files/{id} | [EARLY ACCESS] UpdateFileMetadata: Updates metadata for a file in Drive.\n*FoldersApi* | [**create_folder**](docs/FoldersApi.md#create_folder) | **POST** /api/folders | [EARLY ACCESS] CreateFolder: Create a new folder in LUSID Drive\n*FoldersApi* | [**delete_folder**](docs/FoldersApi.md#delete_folder) | **DELETE** /api/folders/{id} | [EARLY ACCESS] DeleteFolder: Delete a specified folder and all subfolders\n*FoldersApi* | [**get_folder**](docs/FoldersApi.md#get_folder) | **GET** /api/folders/{id} | [EARLY ACCESS] GetFolder: Get metadata of folder\n*FoldersApi* | [**get_folder_contents**](docs/FoldersApi.md#get_folder_contents) | **GET** /api/folders/{id}/contents | [EARLY ACCESS] GetFolderContents: List contents of a folder\n*FoldersApi* | [**get_root_folder**](docs/FoldersApi.md#get_root_folder) | **GET** /api/folders | [EARLY ACCESS] GetRootFolder: List contents of root folder\n*FoldersApi* | [**move_folder**](docs/FoldersApi.md#move_folder) | **POST** /api/folders/{id} | [EARLY ACCESS] MoveFolder: Move files to specified folder\n*FoldersApi* | [**update_folder**](docs/FoldersApi.md#update_folder) | **PUT** /api/folders/{id} | [EARLY ACCESS] UpdateFolder: Update an existing folder's name, path\n*SearchApi* | [**search**](docs/SearchApi.md#search) | **POST** /api/search | [EARLY ACCESS] Search: Search for a file or folder with a given name and path\n\n\n## Documentation For Models\n\n - [AccessControlledAction](docs/AccessControlledAction.md)\n - [AccessControlledResource](docs/AccessControlledResource.md)\n - [ActionId](docs/ActionId.md)\n - [CreateFolder](docs/CreateFolder.md)\n - [IdSelectorDefinition](docs/IdSelectorDefinition.md)\n - [IdentifierPartSchema](docs/IdentifierPartSchema.md)\n - [Link](docs/Link.md)\n - [LusidProblemDetails](docs/LusidProblemDetails.md)\n - [LusidValidationProblemDetails](docs/LusidValidationProblemDetails.md)\n - [PagedResourceListOfStorageObject](docs/PagedResourceListOfStorageObject.md)\n - [ResourceListOfAccessControlledResource](docs/ResourceListOfAccessControlledResource.md)\n - [SearchBody](docs/SearchBody.md)\n - [StorageObject](docs/StorageObject.md)\n - [UpdateFile](docs/UpdateFile.md)\n - [UpdateFolder](docs/UpdateFolder.md)\n\n\n<a id=\"documentation-for-authorization\"></a>\n## Documentation For Authorization\n\n\nAuthentication schemes defined for the API:\n<a id=\"oauth2\"></a>\n### oauth2\n\n- **Type**: OAuth\n- **Flow**: implicit\n- **Authorization URL**: https://lusid.okta.com/oauth2/default/v1/authorize\n- **Scopes**: N/A\n\n\n## Author\n\ninfo@finbourne.com\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "FINBOURNE Drive API",
"version": "2.1.5",
"project_urls": {
"Homepage": "https://github.com/finbourne/drive-sdk-python",
"Repository": "https://github.com/finbourne/drive-sdk-python"
},
"split_keywords": [
"openapi",
" openapi-generator",
" finbourne drive api",
" lusid-drive-sdk"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "23659c27273115e77c5975424e32af5f696941259ae7c28d7d805871cc558cfe",
"md5": "4fd7a94d6bfa3354c0332378969edf3b",
"sha256": "71e2531f274437d6013895185c12af56a7a01b13b7cda8ef325b6da9ccbe2331"
},
"downloads": -1,
"filename": "lusid_drive_sdk-2.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4fd7a94d6bfa3354c0332378969edf3b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 78574,
"upload_time": "2024-04-16T17:29:40",
"upload_time_iso_8601": "2024-04-16T17:29:40.367726Z",
"url": "https://files.pythonhosted.org/packages/23/65/9c27273115e77c5975424e32af5f696941259ae7c28d7d805871cc558cfe/lusid_drive_sdk-2.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d46105299a24b922bab46bb648c6b70bab08df39b8ea6d957f72cb27134f274b",
"md5": "49664b5b7e3b478feddac76cad1f2952",
"sha256": "0126978d2d989f334b7aaf34fdb2b5b70039ae152cf9e4e47b34d0a717b0c6c5"
},
"downloads": -1,
"filename": "lusid_drive_sdk-2.1.5.tar.gz",
"has_sig": false,
"md5_digest": "49664b5b7e3b478feddac76cad1f2952",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 51734,
"upload_time": "2024-04-16T17:29:50",
"upload_time_iso_8601": "2024-04-16T17:29:50.960926Z",
"url": "https://files.pythonhosted.org/packages/d4/61/05299a24b922bab46bb648c6b70bab08df39b8ea6d957f72cb27134f274b/lusid_drive_sdk-2.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-16 17:29:50",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "finbourne",
"github_project": "drive-sdk-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "lusid-drive-sdk"
}