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.6.dev0.tar.gz
(49.2 kB
view hashes)
Built Distribution
Close
Hashes for beaker_pyteal-0.0.6.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a19b562c5bdcf603afc05e8da76d85ee8eb792f36e95c31a22970fa6f295d1c5 |
|
MD5 | ba0ee8560d215f3dcb7b9a83d5d99a89 |
|
BLAKE2b-256 | 0b0c7d7bd85aec76b75bd62249b32afa87bb226ef0a70ad3df192a7b73eb7cce |