SDK library for building services for the IVCAP platform
Project description
ivcap_sdk_service
SDK library for building services for the IVCAP platform
Installation
pip install ivcap_sdk_service
Usage
Below is the obligatory hello world service which simply writes a few messages to logging.
from typing import Dict
from ivcap_sdk_service import Service, Parameter, PythonWorkflow, Type, register_service
import logging
SERVICE = Service(
name = "HelloWorld",
description = "Simple service which does a few simple things",
parameters = [
Parameter(name="msg", type=Type.STRING, description="Message to echo"),
Parameter(name="times", type=Type.INT, default=2, description="Times to repeat"),
],
workflow = PythonWorkflow(min_memory='2Gi')
)
def hello_world(args: Dict, logger: logging):
for i in range(args.times):
logger.info(f"({i + 1}) Hello {args.msg}")
register_service(SERVICE, hello_world)
For more useful examples see the examples directory.
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
License
ivcap_sdk_service
was created by Max Ott max.ott@csiro.au, Tim Erwin tim.erwin@csiro.au. See LICENSE for licensing terms.
Credits
ivcap_sdk_service
was created with cookiecutter
and the py-pkgs-cookiecutter
template.
Development
Setup
conda create --name ivcap_service python=3.7 -y
conda activate ivcap_service
pip install poetry
Adding dependencies
For testing:
poetry add --group dev _lib_name_
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
Built Distribution
Hashes for ivcap_sdk_service-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 526b65b2a541e05e8c808dadf9c4d9bcf32048008acc935e1b625dd76c1a43fc |
|
MD5 | b2904c8271df5b0bc6703cd2b9f2a308 |
|
BLAKE2b-256 | ee60c9902a3b2ff818407c16cad1a15ed4f68371898eae2d19464971f8bac36b |