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.2.tar.gz (90.3 kB view details)

Uploaded Source

Built Distribution

superblocks_agent_sdk-0.0.2-py3-none-any.whl (173.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: superblocks-agent-sdk-0.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 1bfff61575f31b3d450cfcb75900b54d3322fdf73676cebff2cb3c434cb4edf5
MD5 ea028292089ab19e857d2a3ed1b41d9d
BLAKE2b-256 700033dbaf0515aa46ff7c0f6032c14a954c4a4d45643193d952d991daf4b0bf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for superblocks_agent_sdk-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4bedc9b2824489203e912fb43362fbd942306f0d0c526fb045ce4c04c1891ea4
MD5 2f2e7dfed9bc6e2d071f507c0fc2d51e
BLAKE2b-256 ac658a0bdce2e7cb49a10da6a76c353658899fa42e6d4d6490aa564e0a93b995

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