Skip to content

merrymake/python-service-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Service Library for Merrymake

This is the official Python service library for Merrymake. It defines all the basic functions needed to work with Merrymake.

Usage

Here is the most basic example of how to use this library:

from merrymake import Merrymake
from merrymake.merrymimetypes import MerryMimetypes
from merrymake.envelope import Envelope
from merrymake.headers import Headers

def handle_hello(payloadBytes: bytes, envelope: Envelope):
    payload = payloadBytes.decode('utf-8')
    Merrymake.reply_to_origin(f"Hello, {payload}!", Headers(MerryMimetypes.txt))

def main():
    Merrymake.service().handle("handle_hello", handle_hello)

if __name__ == "__main__":
    main()

Tutorials and templates

For more information check out our tutorials at merrymake.dev.

All templates are available through our CLI and on our GitHub.