# Superblocks Agent Python SDK
[![Python version](https://img.shields.io/badge/python-%3E=_3.10-teal.svg)](https://www.python.org/downloads/)
[![PyPi Version](https://img.shields.io/pypi/v/superblocks-agent)](https://pypi.org/project/superblocks-agent-sdk/)
## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install.
```sh
pip install superblocks-agent-sdk
```
## Quickstart
### Run an API
```python3
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"}
```
Raw data
{
"_id": null,
"home_page": "https://github.com/superblocksteam/orchestrator/tree/main/clients/python",
"name": "superblocks-agent-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "superblocks api sdk",
"author": "Joey Greco",
"author_email": "joeyagreco@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/50/98/0363149a0c0c5d71e10b2646eca8370d4d4cfd34b02f9fbff5c5586881d9/superblocks-agent-sdk-0.1.0.tar.gz",
"platform": null,
"description": "# Superblocks Agent Python SDK\n\n[![Python version](https://img.shields.io/badge/python-%3E=_3.10-teal.svg)](https://www.python.org/downloads/)\n[![PyPi Version](https://img.shields.io/pypi/v/superblocks-agent)](https://pypi.org/project/superblocks-agent-sdk/)\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install.\n\n```sh\npip install superblocks-agent-sdk\n```\n\n## Quickstart\n\n### Run an API\n\n```python3\nfrom superblocks_agent_sdk.api import Api\nfrom superblocks_agent_sdk.client import Client, Config\nfrom superblocks_agent_sdk.testing.step import on, Params\n\n\n# configure client\nclient = Client(config=Config(token=\"my-token\"))\n\n# specify api to run\napi = Api(\"my-api-id\")\n\n# run with client in context manager\nwith client as c:\n # run api\n result = api.run(client=c, inputs={\"input1\": \"foo\", \"input2\": 5})\n # create a mock for any step named \"Step1\" and have it return {\"im\": \"mocked\"}\n mock = on(params=Params(step_name=\"Step1\")).return_({\"im\": \"mocked\"})\n result_with_mock = api.run(client=c, mocks=[mock])\n\n# get api output\nprint(result.get_result())\n# get block output by name\nprint(result_with_mock.get_block_result(\"Step1\")) # {\"im\": \"mocked\"}\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "The Official Python SDK for Superblocks",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/superblocksteam/orchestrator/tree/main/clients/python"
},
"split_keywords": [
"superblocks",
"api",
"sdk"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "beecad11b34e884d36c7343d805b1d24f8439233d33dd3c1e9a460760243a763",
"md5": "975e64cbf5b14c166551e8eb1a63e2ba",
"sha256": "0a801ea7db815da991721bbb1b760a79fa642f4ed3f1e08e10115ec536fc37ee"
},
"downloads": -1,
"filename": "superblocks_agent_sdk-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "975e64cbf5b14c166551e8eb1a63e2ba",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 173349,
"upload_time": "2024-06-24T21:50:47",
"upload_time_iso_8601": "2024-06-24T21:50:47.428839Z",
"url": "https://files.pythonhosted.org/packages/be/ec/ad11b34e884d36c7343d805b1d24f8439233d33dd3c1e9a460760243a763/superblocks_agent_sdk-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "50980363149a0c0c5d71e10b2646eca8370d4d4cfd34b02f9fbff5c5586881d9",
"md5": "7c4732ea860e383d41b0cf40fa6879c3",
"sha256": "70c0e5100699a2461db2bee3961fa7c7079864dce4cfcaf52b87764faa8b12e8"
},
"downloads": -1,
"filename": "superblocks-agent-sdk-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "7c4732ea860e383d41b0cf40fa6879c3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 90246,
"upload_time": "2024-06-24T21:50:49",
"upload_time_iso_8601": "2024-06-24T21:50:49.439391Z",
"url": "https://files.pythonhosted.org/packages/50/98/0363149a0c0c5d71e10b2646eca8370d4d4cfd34b02f9fbff5c5586881d9/superblocks-agent-sdk-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-24 21:50:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "superblocksteam",
"github_project": "orchestrator",
"github_not_found": true,
"lcname": "superblocks-agent-sdk"
}