Workpeg function runtime and SDK
Project description
Workpeg SDK
Python SDK for building Workpeg functions and Pegs.
The SDK provides tools to:
- Create new Workpeg function projects
- Run functions locally
- Submit function packages to the Workpeg registry
More features are coming, including Peg development tools, UI capabilities, and deployment workflows.
Repository https://gitlab.com/workpeg/workpeg-sdk
Installation
pip install workpeg
Or install from source:
pip install -e .
Getting Started
1. Create a new function project
workpeg new-function my-function
This creates a project scaffold like:
my-function/
app/
__init__.py
main.py
Your function lives in app/main.py.
Example:
def main(context, payload):
return {
"message": "Hello from Workpeg",
"payload": payload
}
2. Run locally
Functions are executed through the runtime.
Example:
echo '{"context": {}, "payload": {"name": "world"}}' | workpeg runtime
Output:
{
"status": "success",
"result": {
"message": "Hello from Workpeg",
"payload": {"name": "world"}
}
}
The runtime expects input in this format:
{
"context": {...},
"payload": {...}
}
3. Submit a function
Package your function and submit it to the Workpeg registry.
workpeg submit my-function:1.0.0
Authentication is provided through the WORKPEG_PK environment variable.
Example:
export WORKPEG_PK=<your-token>
The function will be uploaded to:
https://repo.workpeg.com
Function Entrypoint
By default the runtime loads:
app.main:main
You can override this using an environment variable:
FUNCTION_ENTRYPOINT=module.path:function
Example:
FUNCTION_ENTRYPOINT=app.main:handler workpeg runtime
Project Structure
Typical function project:
my-function
├─ app
│ ├─ __init__.py
│ └─ main.py
└─ requirements.txt
Roadmap
The SDK will expand to support:
- Peg development tooling
- UI features for building Peg interfaces
- Packaging and deployment workflows
- Function sandboxing and execution tooling
Documentation
Full documentation is coming soon.
License
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.3.tar.gz.
File metadata
- Download URL: workpeg-0.1.3.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
569dd5e2c662a5c7a2d078fc61b9d250331b6e7479553d5cfc1bb7154f0d213f
|
|
| MD5 |
c8015bf92a15f46852ea065d4cbe7fa9
|
|
| BLAKE2b-256 |
665339a905ec54e1ffd4b568d0b5292b8e92777cc673b33a6d212e3a5a9f1265
|
File details
Details for the file workpeg-0.1.3-py3-none-any.whl.
File metadata
- Download URL: workpeg-0.1.3-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
297f1e3cf8dd7f58dd0048d808f63cb2615480dbc9843aa4328963ccc92a488c
|
|
| MD5 |
4351b44ccb03a000823acd0252fcd1c3
|
|
| BLAKE2b-256 |
696528a8230b00423b30d1a58f3e11ae7ad836546428592bdc875c762ab40890
|