Skip to main content

PyTezos

Twitter Monthly downloads GitHub stars Python Version
Binder License: MIT Latest release GitHub issues GitHub pull requests

  • RPC query engine
  • Cryptography
  • Building and parsing operations
  • Smart contract interaction
  • Local forging/packing & vice versa
  • Working with Michelson AST

PyTezos CLI

  • Generating contract parameter/storage schema
  • Activating and revealing accounts
  • Deploying contracts (+ GitHub integration)

Michelson REPL

  • Builtin interpreter (reimplemented)
  • Set of extra helpers (stack visualization, blockchain context mocking)

Michelson Jupyter kernel

  • Custom interpreter with runtime type checker
  • Syntax highlighting, autocomplete with Tab
  • In-place docstrings with Shift+Tab
  • Macros support
  • Verbose execution logging
  • Debug helpers

Michelson integration testing framework

  • Writing integration tests using unittest package
  • Simulating contract execution using remote intepreter (via RPC) or builtin one

Installation

Make sure you have Python 3.10 to 3.13 installed and set as default in the system.

You also need to install cryptographic packages before installing the library/building the project:

Linux

Ubuntu, Debian and other apt-based distributions

$ sudo apt install libsodium-dev libgmp-dev pkg-config

Arch Linux

$ sudo pacman -Syu --needed libsodium gmp

MacOS

Homebrew needs to be installed.

$ brew install libsodium gmp pkg-config

M1 (ARM)

In case libsodium or gmp cannot find either include or lib paths, try explicitly set environment vars:

export CFLAGS="-I/opt/homebrew/Cellar/gmp/6.2.1_1/include/ -L/opt/homebrew/Cellar/gmp/6.2.1_1/lib/"
export DYLD_LIBRARY_PATH=/opt/homebrew/lib/
pip3 install --user pytezos

For running tests you might also need to export LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=/opt/homebrew/lib/

Windows

The recommended way is to use WSL and then follow the instructions for Linux, but if you feel lucky you can try to install natively:

  1. Install MinGW from https://sourceforge.net/projects/mingw/
  2. Make sure C:\MinGW\bin is added to your PATH
  3. Download the latest libsodium-X.Y.Z-msvc.zip from https://download.libsodium.org/libsodium/releases/.
  4. Extract the Win64/Release/v143/dynamic/libsodium.dll from the zip file
  5. Copy libsodium.dll to C:\Windows\System32\libsodium.dll

From PyPi

$ pip install wheel setuptools pkginfo cryptography
$ pip install pytezos

Google Colab

>>> !apt install libsodium-dev libgmp-dev
>>> !pip install pytezos

Docker container

Verified & minified images for CI/CD https://hub.docker.com/r/bakingbad/pytezos/tags

$ # 1. Use image from registry
$ docker pull bakingbad/pytezos
$ # or build it yourself
$ docker build . -t pytezos
$ # 2. Use included docker-compose.yml
$ docker-compose up -d notebook

Building from sources

Requirements:

  • Python 3.10 to 3.13
  • libsodium, coincurve, gmp
  • make
$ # prepare environment
$ make install
# # run full CI with tests
$ make all

Quick start

Read quick start guide
Learn how to enable Jupyter with Michelson

API reference

Check out a complete API reference

Inline documentation

If you are working in Jupyter/Google Colab or any other interactive console, you can display documentation for a particular class/method:

>>> from pytezos import pytezos
>>> pytezos

Publications

Contact

Credits

  • The project was initially started by Arthur Breitman, now it's maintained by Baking Bad team.
  • Baking Bad is supported by Tezos Foundation
  • Michelson test set from the Tezos repo is used to ensure the interpreter workability
  • Michelson structured documentation by Nomadic Labs is used for inline help

Release files for pytezos 3.20.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytezos 3.20.0
File Size Uploaded
pytezos-3.20.0.tar.gz 1.7 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytezos 3.20.0
File Interpreter ABI Platform
pytezos-3.20.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.0 MB

Release files / pytezos-3.20.0.tar.gz

Download URL pytezos-3.20.0.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
c4404ba7624bf538a4d1bb097236249fd86f9c18212b822a8904a98a9cbc9c22
BLAKE2b-256 checksum
How to use checksums
0d74bf21c3db3332a8baca71e13f486421d9796afef83e9708e147d93ca1a0b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pytezos-3.20.0-py3-none-any.whl

Download URL pytezos-3.20.0-py3-none-any.whl
Size 254.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fffbd30f4934045bb37f45f4162bde08575aad431d43c3c3d9c34d010147fcf7
BLAKE2b-256 checksum
How to use checksums
4503e58ae6646f1cae3f3fb6b629a5dcfe6bad0729ecd487e1b4dde12470d1f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.15 {"installer":{"name":"uv","version":"0.12.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

3.20.0 This release

2 release files

3.19.0

2 release files

3.18.0

2 release files

3.17.0

2 release files

3.16.1

2 release files

3.16.0

2 release files

3.15.0

2 release files

3.14.0

2 release files

3.13.6

2 release files

3.13.4

2 release files

3.13.3

2 release files

3.13.2

2 release files

3.13.1

2 release files

3.13.0

2 release files

3.12.1

2 release files

3.12.0

2 release files

3.11.3

2 release files

3.11.2

2 release files

3.10.3

2 release files

3.10.0

2 release files

3.9.0

2 release files

3.8.0

2 release files

3.7.4

2 release files

3.7.3

2 release files

3.7.2

2 release files

3.7.1

2 release files

3.7.0

2 release files

3.6.1

2 release files

3.6.0

2 release files

3.5.2

2 release files

3.5.1

2 release files

3.5.0

2 release files

3.4.2

2 release files

3.4.1

2 release files

3.4.0

2 release files

3.3.6

2 release files

3.3.5

2 release files

3.3.4

2 release files

3.3.3

2 release files

3.3.2

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.11

2 release files

3.2.10

2 release files

3.2.9

2 release files

3.2.8

2 release files

3.2.7

2 release files

3.2.6

2 release files

3.2.5

2 release files

3.2.4

2 release files

3.2.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.0

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.5.13

2 release files

2.5.12

2 release files

2.5.11

2 release files

2.5.9

2 release files

2.5.8

2 release files

2.5.7

2 release files

2.5.6

2 release files

2.5.5

2 release files

2.5.4

2 release files

2.5.3

2 release files

2.5.2

2 release files

2.5.1

2 release files

2.5.0

2 release files

2.4.11

2 release files

2.4.9

2 release files

2.4.8

2 release files

2.4.7

2 release files

2.4.6

2 release files

2.4.5

2 release files

2.4.4

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.5

2 release files

2.3.4

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.8

2 release files

2.2.7

2 release files

2.2.6

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.9

2 release files

2.1.8

2 release files

2.1.7

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page