Skip to main content

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

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.3.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

convect_flow_sdk-0.0.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file convect-flow-sdk-0.0.3.tar.gz.

File metadata

  • Download URL: convect-flow-sdk-0.0.3.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for convect-flow-sdk-0.0.3.tar.gz
Algorithm Hash digest
SHA256 862f9d1d1764dde8c7d2a94ba357c897dde27f8b7cd9d08dfdcc0fadb91632e3
MD5 8358a0220c35f4daefc4637a344a244f
BLAKE2b-256 70d0afebd49dfa96917a1bac086cd4f3a7d6ab80d17717dccb64698f03abe80c

See more details on using hashes here.

File details

Details for the file convect_flow_sdk-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for convect_flow_sdk-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ae6fb9bd8b17628d3d27571fc7b888351ebe5b59a2a71872cfcf02f869784fe7
MD5 0e5ecc27d63684fbdce36676ee7b33fd
BLAKE2b-256 c080bcf752bb215555c92492a772355fc4c4487defc53696c408238e2112212c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page