Package: pytezos
PyTezosRPC query engineCryptographyBuilding and parsing operationsSmart contract interactionLocal forging/packing & vice versaWorking with Michelson ASTPyTezos CLIGenerating contract parameter/storage schemaActivating and revealing accountsDeploying contracts (+ GitHub integration)Michelson REPLBuiltin interpreter (reimplemented)Set of extra helpers (stack visualization, blockchain context mocking)Michelson Jupyter kernelCustom interpreter with runtime type checkerSyntax highlighting, autocomplete withTabIn-place docstrings withShift+TabMacros supportVerbose execution loggingDebug helpersMichelson integration testing frameworkWriting integration tests usingunittestpackageSimulating contract execution using remote intepreter (via RPC) or builtin oneInstallationMake sure you have Python 3.8 to 3.11 installed and set as default in the system.You also need to install cryptographic packages before installing the library/building the project:LinuxUbuntu, Debian and other apt-based distributions$sudoaptinstalllibsodium-devlibsecp256k1-devlibgmp-devpkg-configArch Linux$sudopacman-Syu--neededlibsodiumlibsecp256k1gmpMacOSHomebrewneeds to be installed.$brewtapcuber/homebrew-libsecp256k1
$brewinstalllibsodiumlibsecp256k1gmppkg-configM1 (ARM)In casesecp256k1orgmpcannot find either include or lib paths, try explicitly set environment vars:CFLAGS="-I/opt/homebrew/Cellar/gmp/6.2.1_1/include/ -L/opt/homebrew/Cellar/gmp/6.2.1_1/lib/" LIB_DIR="/opt/homebrew/Cellar/libsecp256k1/0.1/lib" INCLUDE_DIR=/opt/homebrew/Cellar/libsecp256k1/0.1/include pip3 install --user pytezosFor running tests you might also need to exportLD_LIBRARY_PATH:export LD_LIBRARY_PATH=/opt/homebrew/lib/WindowsThe recommended way is to use WSL and then follow the instructions for Linux,
but if you feel lucky you can try to install natively:Install MinGW fromhttps://osdn.net/projects/mingw/Make sureC:\MinGW\binis added to yourPATHDownload the latest libsodium-X.Y.Z-msvc.zip fromhttps://download.libsodium.org/libsodium/releases/.Extract the Win64/Release/v143/dynamic/libsodium.dll from the zip fileCopy libsodium.dll to C:\Windows\System32\libsodium.dllFrom PyPi$pipinstallwheelsetuptoolspkginfocryptography
$pipinstallpytezosGoogle Colab>>>!aptinstalllibsodium-devlibsecp256k1-devlibgmp-dev>>>!pipinstallpytezosDocker containerVerified & minified images for CI/CDhttps://hub.docker.com/r/bakingbad/pytezos/tags$# 1. Use image from registry$dockerpullbakingbad/pytezos
$# or build it yourself$dockerbuild.-tpytezos
$# 2. Use included docker-compose.yml$docker-composeup-dnotebookBuilding from sourcesRequirements:Python 3.8+libsodium, libsecp256k1, gmpmake$# prepare environment$makeinstall# # run full CI with tests$makeQuick startReadquick start guideLearn how toenable Jupyter with MichelsonAPI referenceCheck out a completeAPI referenceInline documentationIf you are working in Jupyter/Google Colab or any other interactive console,
you can display documentation for a particular class/method:>>>frompytezosimportpytezos>>>pytezosPublicationsPytezos 2.0 release with embedded docs and smart contract interaction enginehttps://medium.com/coinmonks/high-level-interface-for-michelson-contracts-and-not-only-7264db76d7aeMaterials from TQuorum:Berlin workshop - building an app on top of PyTezos and ConseilPyhttps://medium.com/coinmonks/atomic-tips-berlin-workshop-materials-c5c8ee3f46aaMaterials from the EETH hackathon - setting up a local development infrastructure, deploying and interacting with a contracthttps://medium.com/tezoscommons/preparing-for-the-tezos-hackathon-with-baking-bad-45f2d5fca519Introducing integration testing enginehttps://medium.com/tezoscommons/testing-michelson-contracts-with-pytezos-513718499e93ContactTelegram chat:@baking_bad_chatSlack channel:#baking-badCreditsThe project was initially started by Arthur Breitman, now it's maintained by Baking Bad team.Baking Bad is supported by Tezos FoundationMichelson test set from the Tezos repo is used to ensure the interpreter workabilityMichelson structured documentation by Nomadic Labs is used for inline help