Skip to main content

A Framework for building PyTeal Applications

Project description

Beaker

Beaker is a smart contract development framework for PyTeal inspired by Flask

With Beaker, we build a class that represents our entire application including state and routing.

Mostly Untested - Expect Breaking Changes

Hello, Beaker

from pyteal import *
from beaker import *

class HelloBeaker(Application):
    @external
    def hello(self, name: abi.String, *, output: abi.String):
        return output.set(Concat(Bytes("Hello, "), name.get()))

if __name__ == "__main__":
    from algosdk.atomic_transaction_composer import AccountTransactionSigner
    from beaker import sandbox, client

    app = HelloBeaker()

    addr, private_key, signer = sandbox.get_accounts().pop()

    app_client = client.ApplicationClient(
        sandbox.get_algod_client(), app, signer=signer
    )

    app_id, app_addr, txid = app_client.create()

    result = app_client.call(app.hello, name="Beaker")
    print(result.return_value) # Hello, Beaker

Install

You can install from pip:

pip install beaker-pyteal

Or from github directly (no promises on stability):

pip install git+https://github.com/algorand-devrel/beaker

Use

Examples

Docs

TODO

Please feel free to file issues/prs

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

beaker-pyteal-0.0.7.dev0.tar.gz (50.1 kB view hashes)

Uploaded Source

Built Distribution

beaker_pyteal-0.0.7.dev0-py3-none-any.whl (62.5 kB view hashes)

Uploaded Python 3

Supported by

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