PyTezos is a Python library for interacting with Tezos blockchain and testing smart contracts.

With PyTezos, you can do the following:

And many more.

<aside> 💡 This tutorial uses hangzhounet. As tezos is upgradable, new testnets appear after every 3 months and older ones are made absolute. So, always use the latest testnet.

</aside>

Install

Install the PyTezos library using pip.

pip install pytezos

PyTezos requires some platform-specific dependencies. In case of issues with installation, refer here for installation instructions for your OS.

Using PyTezos

PyTezos works best with Jupyter notebooks. You can see the parameter structure of entrypoints, contract storage, etc easily using Jupyter notebook.

from pytezos import pytezos

pytezos = pytezos.using(shell = "<https://hangzhounet.smartpy.io/>", key = "edsk..")