Skip to main content

Workpeg function runtime and SDK

Project description

Workpeg SDK

SDK for building Workpeg Pegs and Functions.

Currently focused on:

  • workpeg-runtime – function execution runtime
  • workpeg-new-function – project scaffolding

Frontend features, Peg integrations, push & deployment tooling are coming soon.


Installation

pip install workpeg-sdk

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:

  1. Reads JSON from STDIN
  2. Loads app.main:main
  3. Executes the function
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

workpeg_sdk-0.1.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

workpeg_sdk-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file workpeg_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: workpeg_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for workpeg_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e8dba3e2e84f63c64e8d430038020b5f562607b8cabce025edb72671d1651355
MD5 9566745277621cb64577e68fae37777a
BLAKE2b-256 f0f41c57b3fe4f645971ef9c6ed0f30768230a6062ef09619ce41bd680af1c29

See more details on using hashes here.

File details

Details for the file workpeg_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: workpeg_sdk-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

Hashes for workpeg_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43e67f528dc79275d1f4698901ae78c5514efa08602f87a23eb0dd5918b7d14e
MD5 0bd6ae8e55dbe981b40d53f5fcda53b0
BLAKE2b-256 e64e88c77e001aeb2bcd194825743fcc092d9bea20fd379917f8f552e83d1669

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page