Sorna API Client Library
Project description
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
Release history Release notifications | RSS feed
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 hashes)
Built Distribution
Close
Hashes for sorna_client-0.9.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52800239a76b7200460dfc8f365e536c2491ee012e4c49d66f733ccc40ac3358 |
|
MD5 | 94e56d3485738afcd8c66e4162a69fd2 |
|
BLAKE2b-256 | 9613831574e8cd053a6ec9fc1d8cbacd16ea7a88c125535bc4a03d67425e189d |