Python client introduction

Python API documentation:

Install the client

The easy way to install TinyChain's Python client is using Pip:

# on newer operating systems this command may be "pip" instead of "pip3"
pip3 install tinychain

Hello, World!

You can verify that you've installed the Python client correctly by running this Hello, World! program:

import tinychain as tc

# This host is available for demonstration purposes, but may be slow
# due to the volume of requests it receives.
HOST ="")

# This endpoint will attempt to execute resolve whatever State it receives,
# without committing any write operations.
ENDPOINT = "/transact/hypothetical"

def hello(name: tc.String):
    return tc.String("Hello, {{name}}!").render(name=name)

if __name__ == "__main__":
    cxt = tc.Context()
    cxt.hello = hello
    cxt.result = cxt.hello("World")
    print(, cxt))

If you have any trouble with the host at, you can run your own host by following the steps in Install TinyChain.

Last updated