Skip to main content

The Official Python SDK for Superblocks

Project description

Superblocks Agent Python SDK

Python version PyPi Version

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

superblocks-agent-sdk-0.0.3.tar.gz (90.3 kB view details)

Uploaded Source

Built Distribution

superblocks_agent_sdk-0.0.3-py3-none-any.whl (173.3 kB view details)

Uploaded Python 3

File details

Details for the file superblocks-agent-sdk-0.0.3.tar.gz.

File metadata

  • Download URL: superblocks-agent-sdk-0.0.3.tar.gz
  • Upload date:
  • Size: 90.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for superblocks-agent-sdk-0.0.3.tar.gz
Algorithm Hash digest
SHA256 13b66241c47df6178f91cf8011deaf67f3034f43b5f1d224eedc42c6e0482d7d
MD5 4a491a18d4edb3608f0a98ef3c655c5f
BLAKE2b-256 5acd683d7808668bf41a295e71a09aff1e56d33e451af94c5221d260c0565b97

See more details on using hashes here.

File details

Details for the file superblocks_agent_sdk-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for superblocks_agent_sdk-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 64afe5b018a3eda964f328757a9d752577f23da0971dafc9555f81843220bf10
MD5 d8c74edfd4be0e211396c48598f8c2b1
BLAKE2b-256 5ac1115edf466edd4784b3c1b0b80e9e060cca6f70c025f14b945ad6b294a5da

See more details on using hashes here.

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