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

Uploaded Source

Built Distribution

superblocks_agent_sdk-0.1.1-py3-none-any.whl (173.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: superblocks-agent-sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 90.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for superblocks-agent-sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 596ccbb685f11c66296ca8eafa65f59b12da4ec7143aa2f6ccb672416cdcc860
MD5 53a29df03cdecfad07c4fdd871edc625
BLAKE2b-256 7ca7310188a1d5b68d0c2b4a41a97252df4d4b1d39e92984814b9419223cba76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for superblocks_agent_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a00dc23a4e8ec38b339a015541435958d230325b5b9c919b0191b8d7912a08cf
MD5 f8b7c6a8ab27475b705a7b7b8ab380f4
BLAKE2b-256 09d37eb69cfa50a469e35e7d3f0e1ca491d6d111a176056b59d978bbe6aef950

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