FINBOURNE Drive API
Project description
lusid-drive-sdk
FINBOURNE Technology
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 0.1.617
- Package version: 2.0.22
- Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit 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:
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:
import lusid_drive
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
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 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,
FBN_ACCESS_TOKEN
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 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 and then run the following:
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 | GET /api/metadata/access/resources | [EARLY ACCESS] ListAccessControlledResources: Get resources available for access control |
| FilesApi | 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 | DELETE /api/files/{id} | [EARLY ACCESS] DeleteFile: Deletes a file from Drive. |
| FilesApi | download_file | GET /api/files/{id}/contents | [EARLY ACCESS] DownloadFile: Download the file from Drive. |
| FilesApi | get_file | GET /api/files/{id} | [EARLY ACCESS] GetFile: Get a file stored in Drive. |
| FilesApi | update_file_contents | PUT /api/files/{id}/contents | [EARLY ACCESS] UpdateFileContents: Updates contents of a file in Drive. |
| FilesApi | update_file_metadata | PUT /api/files/{id} | [EARLY ACCESS] UpdateFileMetadata: Updates metadata for a file in Drive. |
| FoldersApi | create_folder | POST /api/folders | [EARLY ACCESS] CreateFolder: Create a new folder in LUSID Drive |
| FoldersApi | delete_folder | DELETE /api/folders/{id} | [EARLY ACCESS] DeleteFolder: Delete a specified folder and all subfolders |
| FoldersApi | get_folder | GET /api/folders/{id} | [EARLY ACCESS] GetFolder: Get metadata of folder |
| FoldersApi | get_folder_contents | GET /api/folders/{id}/contents | [EARLY ACCESS] GetFolderContents: List contents of a folder |
| FoldersApi | get_root_folder | GET /api/folders | [EARLY ACCESS] GetRootFolder: List contents of root folder |
| FoldersApi | move_folder | POST /api/folders/{id} | [EARLY ACCESS] MoveFolder: Move files to specified folder |
| FoldersApi | update_folder | PUT /api/folders/{id} | [EARLY ACCESS] UpdateFolder: Update an existing folder's name, path |
| SearchApi | search | POST /api/search | [EARLY ACCESS] Search: Search for a file or folder with a given name and path |
Documentation For Models
- AccessControlledAction
- AccessControlledResource
- ActionId
- CreateFolder
- IdSelectorDefinition
- IdentifierPartSchema
- Link
- LusidProblemDetails
- LusidValidationProblemDetails
- PagedResourceListOfStorageObject
- ResourceListOfAccessControlledResource
- SearchBody
- StorageObject
- UpdateFile
- UpdateFolder
Documentation For Authorization
Authentication schemes defined for the API:
oauth2
- Type: OAuth
- Flow: implicit
- Authorization URL: https://lusid.okta.com/oauth2/default/v1/authorize
- Scopes: N/A
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lusid_drive_sdk-2.0.22.tar.gz.
File metadata
- Download URL: lusid_drive_sdk-2.0.22.tar.gz
- Upload date:
- Size: 51.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.1 CPython/3.8.2 Linux/5.15.106-flatcar
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66a2f8537c12ebbc4e67c34f17b98c820b62bf54bda2dfc08971733eb20242b3
|
|
| MD5 |
6339c72b32654731956e81275a6e3068
|
|
| BLAKE2b-256 |
8e1767fb497a65ac11df4d4bc8269f8f6a75a33e0a2c81944c1a7bf7bb1066b4
|
File details
Details for the file lusid_drive_sdk-2.0.22-py3-none-any.whl.
File metadata
- Download URL: lusid_drive_sdk-2.0.22-py3-none-any.whl
- Upload date:
- Size: 78.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.1 CPython/3.8.2 Linux/5.15.106-flatcar
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d8e693fb7a456341a022aec5fa93c805522b6a8236e616d239f28e156efe331
|
|
| MD5 |
858a636d54d59c0d8f2dbddcf66f961c
|
|
| BLAKE2b-256 |
94864577ece44a5a595a5e8416f20366c1029737ff0e27da0157daaf26c1a9bd
|