Ethereum for Python Developers
Use Ethereum to create decentralized applications (or "dapps") that utilize the benefits of cryptocurrency and blockchain technology. These dapps can be trustworthy, meaning that once they are deployed to Ethereum, they will always run as programmed. They can control digital assets in order to create new kinds of financial applications. They can be decentralized, meaning that no single entity or person controls them and are nearly impossible to censor.
Getting started with smart contracts and the Solidity language
Take your first steps to integrating Python with Ethereum
Need a more basic primer first? Check out ethereum.org/learn or ethereum.org/developers.
- Blockchain Explainedย (opens in a new tab)
- Understanding Smart Contractsย (opens in a new tab)
- Write your First Smart Contractย (opens in a new tab)
- Learn How to Compile and Deploy Solidityย (opens in a new tab)
- The state of Python in blockchain 2023 reportย (opens in a new tab)
Beginner articles
- web3.py Overviewย (opens in a new tab)
- Ethereum Python Ecosystem Tourย (opens in a new tab)
- A (Python) Developer's Guide to Ethereumย (opens in a new tab)
- Prize-Worthy: An Ethereum Python Hackathon Guideย (opens in a new tab)
- An Introduction to Smart Contracts with Vyperย (opens in a new tab)
- How to develop Ethereum contract using Python Flask?ย (opens in a new tab)
- Intro to Web3.py ยท Ethereum For Python Developersย (opens in a new tab)
- How to call a Smart Contract function using Python and web3.pyย (opens in a new tab)
Intermediate articles
- Friends of web3.py: Intro to Apeย (opens in a new tab)
- Dapp Development for Python Programmersย (opens in a new tab)
- Creating a Python Ethereum Interface: Part 1ย (opens in a new tab)
- Ethereum Smart Contracts in Python: a comprehensive(ish) guideย (opens in a new tab)
Advanced use patterns
- web3.py Patterns: Real-Time Event Subscriptionsย (opens in a new tab)
- web3.py Patterns: WebSocketProviderย (opens in a new tab)
- Compiling, deploying and calling Ethereum smartcontract using Pythonย (opens in a new tab)
- Analyze Solidity Smart Contracts with Slitherย (opens in a new tab)
- Blockchain Fintech Tutorial: Lending and Borrowing With Pythonย (opens in a new tab)
Archived articles
- Deploy your own ERC20 Token with Python and Brownieย (opens in a new tab)
- Using Brownie and Python to deploy Smart Contractsย (opens in a new tab)
- Creating NFTs on OpenSea with Brownieย (opens in a new tab)
Python projects and tools
Active:
- Web3.pyย (opens in a new tab) - Python library for interacting with Ethereum
- Vyperย (opens in a new tab) - Pythonic Smart Contract Language for the EVM
- Titanoboaย (opens in a new tab) - Vyper's native testing tool; an interpreter with mainnet forking, debugging, and pretty tracebacks
- Moccasinย (opens in a new tab) - A smart contract development and testing framework for Vyper and Python, built on Titanoboa
- Apeย (opens in a new tab) - The smart contract development tool for Pythonistas, Data Scientists, and Security Professionals
- py-evmย (opens in a new tab) - implementation of the Ethereum Virtual Machine
- eth-testerย (opens in a new tab) - tools for testing Ethereum-based applications
- eth-utilsย (opens in a new tab) - utility functions for working with Ethereum related codebases
- py-solc-xย (opens in a new tab) - Python wrapper around the solc solidity compiler with 0.5.x support
- pymakerย (opens in a new tab) - Python API for Maker contracts
- siweย (opens in a new tab) - Sign in with Ethereum (siwe) for Python
- Web3 DeFi for Ethereum integrationsย (opens in a new tab) - A Python package with ready integrations for ERC-20, Uniswap and other popular projects
- Wakeย (opens in a new tab) - All-in-one Python framework for contracts testing, fuzzing, deployment, vulnerability scanning and code navigation (language server - Tools for Solidityย (opens in a new tab))
- DeFiPyย (opens in a new tab) - Python SDK for DeFi analytics and AMM simulation across Uniswap V2/V3, Balancer, and Curve
Archived / No longer maintained:
- Trinityย (opens in a new tab) - Ethereum Python client
- Mambaย (opens in a new tab) - framework to write, compile, and deploy smart contracts written in Vyper language
- Brownieย (opens in a new tab) - Python framework for deploying, testing and interacting with Ethereum smart contracts
- pydevp2pย (opens in a new tab) - implementation of the Ethereum P2P stack
- py-wasmย (opens in a new tab) - Python implementation of the web assembly interpreter
Looking for more resources? Check out ethereum.org/developers.
Projects using Python tooling
The following Ethereum-based projects use tools mentioned on this page. The related open-source repositories serve as a good reference for example code and best practices.
- Yearn Financeย (opens in a new tab) and Yearn Vault Contracts repositoryย (opens in a new tab)
- Curveย (opens in a new tab) and Curve smart contracts repositoryย (opens in a new tab)
- BadgerDAOย (opens in a new tab) and smart contracts using Brownie toolchainย (opens in a new tab)
- Sushiย (opens in a new tab) uses Python in managing and deploying their vesting contractsย (opens in a new tab)
- Alpha Financeย (opens in a new tab), of Alpha Homora fame, uses Brownie to test and deploy smart contractsย (opens in a new tab)
Python Community discussion
- Ethereum Python Community Discordย (opens in a new tab) for Web3.py and other Python framework discussion
- Vyper Discordย (opens in a new tab) for Vyper smart contract programming discussion
Other aggregated lists
The Vyper wiki has an incredible list of resources for Vyperย (opens in a new tab)