Skip to main content

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

ivcap_sdk_service-0.3.1.tar.gz (23.0 kB view hashes)

Uploaded Source

Built Distribution

ivcap_sdk_service-0.3.1-py3-none-any.whl (36.0 kB view hashes)

Uploaded Python 3

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