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
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)
Built Distribution
Close
Hashes for beaker_pyteal-0.0.7.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8e7134f807525c6c913307811217cbf6ed51646f5cc9ebba865a46a9ca738f5 |
|
MD5 | ca7a6ae503138cf0d8f5c78d89a6667f |
|
BLAKE2b-256 | 0c31acc1b9792ba7981563a127f819b05f989fb6bce964a613fd0b09e32b07aa |