Workpeg function runtime and SDK
Project description
Workpeg SDK
SDK for building Workpeg Pegs and Functions.
Currently focused on:
workpeg-runtime– function execution runtimeworkpeg-new-function– project scaffolding
Frontend features, Peg integrations, push & deployment tooling are coming soon.
Installation
pip install workpeg
Getting Started
1. Create a New Function
workpeg-new-function my-peg
cd my-peg
This generates:
my-peg/
app/
__init__.py
main.py
requirements.txt
Dockerfile
2. Implement Your Function
Edit app/main.py:
def main(context, payload):
return payload
Every Workpeg Function must define:
def main(context: dict, payload: dict) -> dict
context→ execution metadata (provided by Workpeg)payload→ input data- return value → must be JSON serializable
3. Run Locally
echo '{"context": {}, "payload": {"hello": "world"}}' | workpeg-runtime
Example output:
{ "status": "success", "result": { "hello": "world" } }
Runtime
workpeg-runtime:
- Reads JSON from STDIN
- Loads
app.main:main - Executes the function
- Writes structured JSON to STDOUT
Override entrypoint:
FUNCTION_ENTRYPOINT="module.path:function_name" workpeg-runtime
Roadmap
- Peg-level integrations
- Frontend features (Streamlit/Reflex style)
- Push & deployment tooling
- Hosted execution
📘 Documentation coming soon.
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file workpeg-0.1.0.tar.gz.
File metadata
- Download URL: workpeg-0.1.0.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93fea19b8cf1ce68a7eb90dc1109f430bed2d556cc8ab9e7f41cb980b68d4c80
|
|
| MD5 |
331f2f371f8f3d80a33f7045b9ae5bf4
|
|
| BLAKE2b-256 |
9d2bc27a4d0de3cad04b3d5d84ef654d6df60e43a7b59093e97d20be961d13ba
|
File details
Details for the file workpeg-0.1.0-py3-none-any.whl.
File metadata
- Download URL: workpeg-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67597811e4d05118a1aa57924580aab61ca75e48418e5dcda1c269e59d8c46c8
|
|
| MD5 |
69d96f5f42f37ee19c313e353de96973
|
|
| BLAKE2b-256 |
5b99cb49f76449a10686de5c1372013d9b2edd9a285aea193fd1451e13fd1b80
|