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, secret = sandbox.get_accounts().pop()
app_client = client.ApplicationClient(
sandbox.get_algod_client(), app, signer=AccountTransactionSigner(secret)
)
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.5.dev0.tar.gz
(48.9 kB
view hashes)
Built Distribution
Close
Hashes for beaker_pyteal-0.0.5.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d73fe8cd7e67841654306277b4cd41987434e8ab866f0295d6278e35c313307 |
|
MD5 | 21bf614f650f86597f0d47f7c118216f |
|
BLAKE2b-256 | 4959bc802e4f968c4cdaf61199948054ff7f37b2bd15ae52016fc64cd62d8611 |