Skip to main content

Sorna API Client Library

Project description

Travis Build Status AppVeyor Build Status Code Coverage PyPI

The API client library for Sorna

Usage

Grab your keypair from cloud.sorna.io or your cluster admin.

export SORNA_ACCESS_KEY=...
export SORNA_SECRET_KEY=...

# optional (for local clusters)
export SORNA_ENDPOINT="https://my-precious-cluster/"

Synchronous API

from sorna.kernel import Kernel

kern = Kernel.get_or_create('lua5', client_token='abc')
result = kern.execute('print("hello world")', mode='query')
print(result['console'])
kern.destroy()

Asynchronous API

import asyncio
from sorna.asyncio.kernel import AsyncKernel

async def main():
    kern = await AsyncKernel.get_or_create('lua5', client_token='abc')
    result = await kern.execute('print("hello world")', mode='query')
    print(result['console'])
    await kern.destroy()

loop = asyncio.get_event_loop()
try:
    loop.run_until_complete(main())
finally:
    loop.close()

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

sorna-client-0.9.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

sorna_client-0.9.2-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file sorna-client-0.9.2.tar.gz.

File metadata

File hashes

Hashes for sorna-client-0.9.2.tar.gz
Algorithm Hash digest
SHA256 36fb606e723b3c51695984371cc151ead43d8dd5edf15c2b6c5bfa2608bd4d06
MD5 5511c394429c07fa277a0afd5587b662
BLAKE2b-256 08788200896440b1d92322ef0934af9b1da7d22d3e4f801d8cbf431024819a0e

See more details on using hashes here.

File details

Details for the file sorna_client-0.9.2-py3-none-any.whl.

File metadata

File hashes

Hashes for sorna_client-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 52800239a76b7200460dfc8f365e536c2491ee012e4c49d66f733ccc40ac3358
MD5 94e56d3485738afcd8c66e4162a69fd2
BLAKE2b-256 9613831574e8cd053a6ec9fc1d8cbacd16ea7a88c125535bc4a03d67425e189d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page