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.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1dc09ccd8539debc0cddd584a2961e4a0fa85a50845a8f690ef65e3ea99031c |
|
MD5 | e4ba41e336708e2cf6a31c9d71ecda56 |
|
BLAKE2b-256 | 445e481a1f28d4f36e5a4c1176bf581f7b264cffd7717ad91c653ff8859066b6 |