SalureConnect is a Python package that handles the credential information between other packages and the web platform SalureConnect. The package simplifies the process of fetching and refreshing authentication credentials, as well as downloading files stored on the SalureConnect platform.
To install the salureconnect
package, run:
Copy code
pip install salureconnect
To start using the SalureConnect
package, you first need to import the module and create an instance of the SalureConnect
class:
pythonCopy codefrom salureconnect import SalureConnect
salure = SalureConnect(customer=
salure = SalureConnect(customer=
'your_customer_name', api_token='your_api_token', staging='prod')
You can also set the following environment variables instead of passing the customer and API token as parameters:
SALURECONNECT_CUSTOMER_NAME
SALURECONNECT_API_TOKEN
SALURECONNECT_ENVIRONMENT
To fetch authentication credentials for a specific system, use the get_system_credential()
method:
- pythonCopy code
credentials = salure.get_system_credential(system='system_name', label='label_name', test_environment=False)
To refresh OAuth authentication credentials for a specific system, use the refresh_system_credential()
method:
- pythonCopy code
credentials = salure.refresh_system_credential(system='system_name', system_id=123)
To list available files from the SalureConnect API, use the list_files()
method:
pythonCopy code
files = salure.list_files()
To download multiple files from SalureConnect, use the download_files()
method:
pythonCopy codesalure.download_files(output_path='path/to/output/folder', filter_upload_definition_ids=[1, 2], filter_file_names=['file1', 'file2'], filter_deleted=False)
To download a specific file from SalureConnect, use the download_file()
method:
python
Copy codesalure.download_file(file_id=123, file_name_and_path='path/to/output/file.ext')