The Official Python SDK for Superblocks
Project description
Superblocks Agent Python SDK
Installation
Use the package manager pip to install.
pip install superblocks-agent-sdk
Quickstart
Run an API
from superblocks_agent_sdk.api import Api
from superblocks_agent_sdk.client import Client, Config
from superblocks_agent_sdk.testing.step import on, Params
# configure client
client = Client(config=Config(token="my-token"))
# specify api to run
api = Api("my-api-id")
# run with client in context manager
with client as c:
# run api
result = api.run(client=c, inputs={"input1": "foo", "input2": 5})
# create a mock for any step named "Step1" and have it return {"im": "mocked"}
mock = on(params=Params(step_name="Step1")).return_({"im": "mocked"})
result_with_mock = api.run(client=c, mocks=[mock])
# get api output
print(result.get_result())
# get block output by name
print(result_with_mock.get_block_result("Step1")) # {"im": "mocked"}
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
Built Distribution
File details
Details for the file superblocks-agent-sdk-0.1.0.tar.gz
.
File metadata
- Download URL: superblocks-agent-sdk-0.1.0.tar.gz
- Upload date:
- Size: 90.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70c0e5100699a2461db2bee3961fa7c7079864dce4cfcaf52b87764faa8b12e8 |
|
MD5 | 7c4732ea860e383d41b0cf40fa6879c3 |
|
BLAKE2b-256 | 50980363149a0c0c5d71e10b2646eca8370d4d4cfd34b02f9fbff5c5586881d9 |
File details
Details for the file superblocks_agent_sdk-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: superblocks_agent_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 173.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a801ea7db815da991721bbb1b760a79fa642f4ed3f1e08e10115ec536fc37ee |
|
MD5 | 975e64cbf5b14c166551e8eb1a63e2ba |
|
BLAKE2b-256 | beecad11b34e884d36c7343d805b1d24f8439233d33dd3c1e9a460760243a763 |