# Mitosis Python SDK
This is the Python client SDK to interact with the Mitosis API. It provides a convenient way to access Mitosis services and manage your resources programmatically.
See the [Mitosis documentation](https://docs.stack.rs/mitosis) and [Mitosis repository](https://github.com/stack-rs/mitosis) for more details.
## Usage
Install the package with pip
```bash
pip install pynetmito
```
Or if you are using [uv](https://docs.astral.sh/uv/), you can add it to your project with:
```bash
uv add pynetmito
```
Now let's see a simple example of how to use the SDK:
```python
from pynetmito import MitoHttpClient
coordinator_addr = "http://127.0.0.1:5000" # The coordinator address of the mitosis backend service
c = MitoHttpClient(coordinator_addr)
c.connect(user="your-user-name", password="your-password")
# Now you can use the client to submit tasks
with open("orig.txt", "w") as f:
f.write("hello world")
c.upload_attachment(Path("orig.txt"), key="some-remote-text-file/in-object-storage/log.txt")
# Specify the task with attachment
attachment = RemoteResourceDownload(
remote_file=RemoteResource.attachment("some-remote-text-file/in-object-storage/log.txt"), local_path=Path("test.txt")
)
task_spec = TaskSpec(args=["echo", "$MITO_RESOURCE/test.txt"], resources=[attachment], terminal_output=True)
args = SubmitTaskReq(group_name=c.username, task_spec=task_spec)
r = c.user_submit_task(args) # This will return a SubmitTaskResp object (with uuid to identify the task)
res = c.get_task_by_uuid(r.uuid) # You can use the uuid to get the task status and result
print(res)
# To download the terminal output of the task
c.download_artifact(
r.uuid,
content_type=ArtifactContentType.STD_LOG,
local_path=Path("new.txt"),
)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "pynetmito",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "API, Async, Client, Distributed, HTTP, REST, SDK, evaluation, mitosis",
"author": null,
"author_email": "BobAnkh <bobankhshen@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d3/d8/4d4ebafc08cfe8e8f35cfc07b719a6873e51e85021d8d809c0d5cea43d1a/pynetmito-0.1.3.tar.gz",
"platform": null,
"description": "# Mitosis Python SDK\n\nThis is the Python client SDK to interact with the Mitosis API. It provides a convenient way to access Mitosis services and manage your resources programmatically.\n\nSee the [Mitosis documentation](https://docs.stack.rs/mitosis) and [Mitosis repository](https://github.com/stack-rs/mitosis) for more details.\n\n## Usage\n\nInstall the package with pip\n\n```bash\npip install pynetmito\n```\n\nOr if you are using [uv](https://docs.astral.sh/uv/), you can add it to your project with:\n\n```bash\nuv add pynetmito\n```\n\nNow let's see a simple example of how to use the SDK:\n\n```python\nfrom pynetmito import MitoHttpClient\ncoordinator_addr = \"http://127.0.0.1:5000\" # The coordinator address of the mitosis backend service\nc = MitoHttpClient(coordinator_addr)\nc.connect(user=\"your-user-name\", password=\"your-password\")\n\n# Now you can use the client to submit tasks\nwith open(\"orig.txt\", \"w\") as f:\n f.write(\"hello world\")\nc.upload_attachment(Path(\"orig.txt\"), key=\"some-remote-text-file/in-object-storage/log.txt\")\n\n# Specify the task with attachment\nattachment = RemoteResourceDownload(\n remote_file=RemoteResource.attachment(\"some-remote-text-file/in-object-storage/log.txt\"), local_path=Path(\"test.txt\")\n)\ntask_spec = TaskSpec(args=[\"echo\", \"$MITO_RESOURCE/test.txt\"], resources=[attachment], terminal_output=True)\nargs = SubmitTaskReq(group_name=c.username, task_spec=task_spec)\nr = c.user_submit_task(args) # This will return a SubmitTaskResp object (with uuid to identify the task)\nres = c.get_task_by_uuid(r.uuid) # You can use the uuid to get the task status and result\nprint(res)\n\n# To download the terminal output of the task\nc.download_artifact(\n r.uuid,\n content_type=ArtifactContentType.STD_LOG,\n local_path=Path(\"new.txt\"),\n)\n\n```\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Python Client SDK for mitosis",
"version": "0.1.3",
"project_urls": {
"Documentation": "https://docs.stack.rs/mitosis/",
"Homepage": "https://github.com/stack-rs/mitosis-python-sdk",
"Source": "https://github.com/stack-rs/mitosis-python-sdk"
},
"split_keywords": [
"api",
" async",
" client",
" distributed",
" http",
" rest",
" sdk",
" evaluation",
" mitosis"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "09bc787cca72a9fc67436e2202c5d6f225f8ab8aa34a16391d53d9b5489b9682",
"md5": "f721ac619611c689fe7b8a514bcf0805",
"sha256": "2131dc3a2a447faf1115c538aa50fcc8c660d00d842640f792520f25003e205c"
},
"downloads": -1,
"filename": "pynetmito-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f721ac619611c689fe7b8a514bcf0805",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 16272,
"upload_time": "2025-09-05T05:26:42",
"upload_time_iso_8601": "2025-09-05T05:26:42.735717Z",
"url": "https://files.pythonhosted.org/packages/09/bc/787cca72a9fc67436e2202c5d6f225f8ab8aa34a16391d53d9b5489b9682/pynetmito-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d3d84d4ebafc08cfe8e8f35cfc07b719a6873e51e85021d8d809c0d5cea43d1a",
"md5": "20285dbfefb675a25bdf0dbbb893fd70",
"sha256": "f936d2b4938a6a58909e83cd425e53cb0825e63aa443d147d9b9303a3e94d2e2"
},
"downloads": -1,
"filename": "pynetmito-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "20285dbfefb675a25bdf0dbbb893fd70",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 15906,
"upload_time": "2025-09-05T05:26:44",
"upload_time_iso_8601": "2025-09-05T05:26:44.201813Z",
"url": "https://files.pythonhosted.org/packages/d3/d8/4d4ebafc08cfe8e8f35cfc07b719a6873e51e85021d8d809c0d5cea43d1a/pynetmito-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-05 05:26:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "stack-rs",
"github_project": "mitosis-python-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pynetmito"
}