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.api import Api
from superblocks_agent.client import Client, Config
from superblocks_agent.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.1.tar.gz (90.1 kB view details)

Uploaded Source

Built Distribution

superblocks_agent_sdk-0.0.1-py3-none-any.whl (172.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: superblocks-agent-sdk-0.0.1.tar.gz
  • Upload date:
  • Size: 90.1 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.1.tar.gz
Algorithm Hash digest
SHA256 4f583299cc4a300ab411e54d70b7dcc51a54af25b48b0a386bbc99cf3669ee73
MD5 42baf4841d5c1b9c1a4f22d72f9f24f3
BLAKE2b-256 db528ce108d5a4b2bdc1d9544621f25d5a436c3716353024297e05b7dd72b4d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for superblocks_agent_sdk-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4223ee8507796d0595ada0edaa1aa44f749bbadc674ca44d654edfb8a5475826
MD5 c53daff9c8fba063922546efc892c638
BLAKE2b-256 c4d01ca1e4fe79e06aa1773d0e070bf7fd827a9a56293bc752ece68afeffadd0

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