Metadata-Version: 2.4
Name: shiftlabs
Version: 0.1.0
Summary: Type hints for shiftlabs Python workflows: the module the platform injects at deploy.
Author: shiftlabs
Author-email: shiftlabs <packages@shiftlabs.org>
License-Expression: MIT
License-File: LICENSE
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.11
Project-URL: Homepage, https://shiftlabs.org
Project-URL: Documentation, https://docs.shiftlabs.org
Description-Content-Type: text/markdown

# shiftlabs

Type hints for [shiftlabs](https://shiftlabs.org) workflows written in Python.

```sh
uv add --dev shiftlabs   # or: pip install shiftlabs
```

```python
from shiftlabs import Context, workflow


async def charge(invoice_id: str) -> dict[str, str]:
    ...


@workflow(payload={"type": "object", "properties": {"id": {"type": "string"}}, "required": ["id"]})
async def refund_check(ctx: Context) -> dict[str, str]:
    charged = await ctx.step.run("charge", charge, ctx.payload["id"], retries={"limit": 3, "delay": "10 seconds"})
    ctx.log.info("charged", {"id": charged["id"]})
    return charged
```

The package is for your editor and type checker. You don't need it at run time: the platform adds the same module
to every Python workflow when you deploy, at the version the platform runs.

Run `npx shiftlabs types` to write `shiftlabs_types.pyi` with your workspace's secret and var names. After that,
`ctx.secrets.NAME` and `ctx.vars.NAME` only accept those names.

Docs: [docs.shiftlabs.org](https://docs.shiftlabs.org).
