Skip to main content

Array codec and API wrapper for SYV server

Project description

SYVLIB

0.2.150

Introduction

SYVLIB is an SDK which provides tools for building client applications for the SYV server.

Installation

pip install syvlib

Usage

First you need to open a session with your SYV instance:

import syvlib

session = syvlib.Session('https://syv.example.com', 'myusername', 'mypassword')

Once you have a session, you can open a cycle on a pump:

cycle = session.open('mypump')

Depending on the pump's engine type, you may then want to download drops:

drops = cycle.pull_drops('input', cycle.drop_uids.get('input'))

...or upload drops:

import numpy as np

drops = [syvlib.Drop(cycle, {'myarrayspec': np.zeros((64,64))})]
cycle.push_drops('output', drops)

...or upload a record:

with open('myfile.zip', 'rb') as stream:
    cycle.push_record('input', stream)

In any case, you will eventually need to commit the cycle:

cycle.commit_and_wait()

if cycle.error is not None:
    raise Exception(cycle.error)

Once the cycle has successfully completed the commit process, you may then be able to download a record (again, depending on the engine type):

with open('myfile.zip', 'wb') as stream:
    cycle.pull_record('output', stream)

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

syvlib-0.2.150.tar.gz (17.9 kB view hashes)

Uploaded Source

Built Distribution

syvlib-0.2.150-py3-none-any.whl (18.4 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