web3
web3: A Python library for interacting with Ethereum
What it is and what it does
web3.py is the standard Python interface to the Ethereum blockchain. It abstracts the JSON-RPC protocol used by Ethereum nodes, letting you query blockchain state, send transactions, deploy contracts, and listen to events without managing low-level HTTP or WebSocket details yourself. The library bundles Ethereum-specific utilities like account management (via eth-account), ABI encoding (via eth-abi), and type definitions (via eth-typing) into a cohesive API.
You use it by connecting to an Ethereum node—either a local node you run or a remote service like Infura—then calling methods to read data or submit transactions. It handles the cryptographic signing of transactions via eth-account and provides both synchronous (requests) and asynchronous (aiohttp, websockets) I/O patterns. The library supports modern Python versions and is actively maintained by the Ethereum Foundation.
Use it for:
- Query account balances, transaction history, and contract state on Ethereum mainnet or testnets.
- Send Ether transfers or call smart contract functions from a Python script or application.
- Deploy new smart contracts and interact with their methods programmatically.
- Build backend services for decentralized applications (dApps) that need to read or write blockchain data.
- Monitor blockchain events and react to contract state changes in real time.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
web3.py is a Python library for interacting with the Ethereum blockchain, enabling you to send transactions, query smart contracts, and build decentralized applications.
Yes. web3.py is the de facto standard for Ethereum development in Python, actively maintained, permissively licensed, and carries low install friction. Install it if you need to interact with Ethereum from Python—whether for querying data, sending transactions, or building dApp backends. No known vulnerabilities as of the fact sheet date.
Install
web3 on PyPI
pip
pip install web3uv
uv add web3poetry
poetry add web3Installing web3
Before you install
Low install friction with a pure-wheel distribution. Active maintenance with a recent release and ongoing commits. The package carries 14 runtime dependencies including eth-account, eth-abi, and aiohttp, which are standard Ethereum tooling libraries.
License in practice
MIT license permits commercial and private use, modification, and distribution with minimal restrictions—standard permissive terms suitable for most projects.
Quickstart
pip install web3
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://mainnet.infura.io/v3/YOUR_INFURA_KEY'))
print(w3.is_connected())
Requires an Ethereum node endpoint (local or remote) to connect to; Python 3.8 or later.
Verify before relying
- Whether pywin32 is required on all platforms or only Windows; may affect non-Windows install experience.
- Performance characteristics and rate limits when interacting with public RPC endpoints.
- Specific smart contract interaction patterns and ABI encoding/decoding workflows beyond basic connectivity.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 14 — eth-abi, eth-account, eth-hash, eth-typing, eth-utils, hexbytes, aiohttp, pydantic, pywin32, requests, typing-extensions, types-requests, websockets, pyunormalize |
| Maintenance | actively maintained — 105 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,152,034/month — #2,154 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: web3-7.16.0-py3-none-any.whl
Keywords: ethereum
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
aptos-sdkProvides Python bindings to interact with the…
permissive · top 15,000 on PyPI
cosmpyCosmPy provides Python bindings to interact…
permissive · top 15,000 on PyPI
etherscan-pythonProvides a complete Python client for…
permissive · top 15,000 on PyPI
solanaSolana.py is a Python SDK for building…
permissive · top 5,000 on PyPI
stellar-sdkStellar SDK provides Python APIs to build and…
permissive · top 15,000 on PyPI
py-evmPy-EVM is a Python implementation of the…
permissive · top 15,000 on PyPI
py-builder-relayer-clientA Python client library for submitting…
permissive · top 15,000 on PyPI
eth-brownieBrownie is a Python framework for developing,…
permissive · top 15,000 on PyPI
eth-testereth-tester provides an in-memory Ethereum…
permissive · top 15,000 on PyPI
tronpytronpy is a Python client library for…
permissive · top 15,000 on PyPI