Skip to main content

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 ivcap_sdk_service import Service, ServiceArgs, Parameter, PythonWorkflow, Type, register_service
import logging

SERVICE = Service(
    name = "Hello World",
    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', min_cpu='500m', min_ephemeral_storage='4Gi'),
)

def hello_world(args: ServiceArgs, 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 or for a git repo which could work as a starting point, check out ivcap-python-service-example and ivcap-python-service-example-collection.

API Documentation

The auto-generated API docs can be found here.

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 initially created by Max Ott max.ott@csiro.au, Tim Erwin tim.erwin@csiro.au with additional contributions from Ben Clews ben.clews@csiro.au" and "John Zhang j.zhang@csiro.au". See LICENSE for licensing terms.

Credits

ivcap_sdk_service was created with cookiecutter and the py-pkgs-cookiecutter template.

Development

Setup with Conda

To use conda to create a virtual python environment named ivcap_service:

conda create --name ivcap_service python=3.9 -y
conda activate ivcap_service
pip install poetry

Setup with Nix Flakes

Alternatively, if you'd like to use Nix Flakes for your virtual environment, run:

nix develop

To use direnv to automatically load the development environment when you enter the ivcap-service-sdk-python directory, run:

direnv allow

Adding dependencies

For testing:

poetry add --group dev _lib_name_

Metadata

Release files for ivcap_sdk_service 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ivcap_sdk_service 0.8.0
File Size Uploaded
ivcap_sdk_service-0.8.0.tar.gz 36.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ivcap_sdk_service 0.8.0
File Interpreter ABI Platform
ivcap_sdk_service-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 86.2 kB

Release files / ivcap_sdk_service-0.8.0.tar.gz

Download URL ivcap_sdk_service-0.8.0.tar.gz
Size 36.3 kB
Tags Source
SHA-256 checksum
How to use checksums
dc3d082513ca3e69f59a9c45b046d7897e9aa6bddd8f7f7e3532821793a964fe
BLAKE2b-256 checksum
How to use checksums
0d71b53451ef9681487f3370d6080479c8781da584ac1e02f4318ee459d3e54c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.16 Darwin/23.4.0

Release files / ivcap_sdk_service-0.8.0-py3-none-any.whl

Download URL ivcap_sdk_service-0.8.0-py3-none-any.whl
Size 49.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87ae0b96cba1e2b085e020b08f5d8ac19483c851a61111eabc23eec0a309397c
BLAKE2b-256 checksum
How to use checksums
06994591fde2487690f1a8f536f97db8f5f87dba3c7ed38b1fa1a92e6c026496
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.9.16 Darwin/23.4.0

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.6.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page