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 details)
Built Distribution
File details
Details for the file sorna-client-0.9.2.tar.gz
.
File metadata
- Download URL: sorna-client-0.9.2.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36fb606e723b3c51695984371cc151ead43d8dd5edf15c2b6c5bfa2608bd4d06 |
|
MD5 | 5511c394429c07fa277a0afd5587b662 |
|
BLAKE2b-256 | 08788200896440b1d92322ef0934af9b1da7d22d3e4f801d8cbf431024819a0e |
File details
Details for the file sorna_client-0.9.2-py3-none-any.whl
.
File metadata
- Download URL: sorna_client-0.9.2-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52800239a76b7200460dfc8f365e536c2491ee012e4c49d66f733ccc40ac3358 |
|
MD5 | 94e56d3485738afcd8c66e4162a69fd2 |
|
BLAKE2b-256 | 9613831574e8cd053a6ec9fc1d8cbacd16ea7a88c125535bc4a03d67425e189d |