convect flow sdk
Project description
flow-sdk
flow sdk
Install
pip install convect-flow-sdk
Usage
# set up environment variables
# FLOW_WORKSPACE_ID: your flow workspace id
# FLOW_API_TOKEN: your flow api token from the workspace
# FLOW_HOST: flow host, default to https://flow.convect.ai
from convect_flow_sdk import FlowAlgo
from pprint import pprint
# this is an example of how to use the flow_algo_sdk
flow_algo = FlowAlgo()
# this algo_id is will be the one defined in the algo project
algo_id = '2f1a1fa9-2958-4afe-bb48-4239a960986d'
pprint(flow_algo.list_algos())
pprint(flow_algo.list_algo_runs(algo_id))
# this submit will zip all the files in path_to_input folder and submit to flow
run_id =flow_algo.submit(algo_id,
"weekly_run",
{
"input_file": "input.csv",
"output_file": "output.csv",
"predict_start_week": "202348",
"predict_end_week": "202348",
"algo": "v03-percentile"
},
"path_to_input")
# flow_algo.terminate(run_id)
flow_algo.check_status(run_id)
flow_algo.log(run_id)
# this gather will download the output.tar.gz from flow and extract to path_to_output folder
flow_algo.gather(run_id,"./output")
# flow_algo_sdk.clear_local_algo_cache()
# clear local algo cache will delete the local history of submitted runs
Development
Regression Test
# set up environment variables
# FLOW_WORKSPACE_ID: your flow workspace id
# FLOW_API_TOKEN: your flow api token from the workspace
# FLOW_HOST: flow host
# you need to make sure the workspace has all the active apps
# you can run the following command to run the regression test
flow-cli regression-test
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
convect-flow-sdk-0.0.5.tar.gz
(12.8 kB
view details)
Built Distribution
File details
Details for the file convect-flow-sdk-0.0.5.tar.gz
.
File metadata
- Download URL: convect-flow-sdk-0.0.5.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75786b86e9bd3dbb9d5af452529e9bae20d142fcc90b56767d40a3fc660ad04a |
|
MD5 | 6b7a7b6d67ef66f502f8d5ef0ebdf34a |
|
BLAKE2b-256 | 35b11f676cccba159f40d4f6d2cfa7b73e95c8bc698aee3f740f0bb23aef3b4f |
File details
Details for the file convect_flow_sdk-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: convect_flow_sdk-0.0.5-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c99eb6ce73001814bfa57fb4e4121792a31dabe246a98c9c85061ccbd12b6786 |
|
MD5 | a125a59527a365f88d4bc87b02ff8589 |
|
BLAKE2b-256 | efe657c82532f8489d4e1b1e8118a04b5ef0ccc32f142a7466579f1d5e887eff |