Python blockchain libraries

Updated Nov 2026

Python blockchain libraries read chain data, build and sign transactions, and call smart contracts from Python code. Signing happens locally with a private key before a client sends the transaction to a node over JSON-RPC. These libraries let wallets, trading bots, and AI agents act on Ethereum, Solana, and Bitcoin.

Popularity

eth-utils has the most monthly downloads in this comparison, at 8.2M.

LibraryMonthly downloadsStarsLast releaseLicense
eth-utils
8.2M
337Mar 2026MIT
eth-abi
7.7M
256Aug 2026MIT
eth-keys
6.4M
177Aug 2026MIT
eth-account
6.3M
314Aug 2026MIT
web3
5.5M
5.5KAug 2026MIT
Solders
1.7M
450Aug 2026Unresolved
Solana.py
853.1K
1.4KNov 2026MIT
python-bitcoinlib
568.9K
1.9KJun 2023LGPL-3.0-or-later
Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Provides common utility functions for Python code that works with Ethereum.

Downloads / mo
8.2M
Stars
337
Last release
6.0.0
License
MIT

Quickstart

From utilities.html
$ python -m pip install eth-utils
from eth_utils import to_checksum_address

address = to_checksum_address('0xd3cda913deb6f67967b99d67acdfa1712c293601')

eth-utils examples

From open-source projects on GitHub

Encodes and decodes Ethereum ABI data.

Downloads / mo
7.7M
Stars
256
Last release
6.0.0
License
MIT

Quickstart

From encoding.html
$ python -m pip install eth-abi
from eth_abi import encode

encoded = encode(['uint256'], [12345])

eth-abi examples

From open-source projects on GitHub

Provides a common API for Ethereum key operations.

Downloads / mo
6.4M
Stars
177
Last release
0.8.0
License
MIT

Quickstart

From README.md
$ python -m pip install eth-keys
from eth_keys import keys

private_key = keys.PrivateKey(b'\x01' * 32)
signature = private_key.sign_msg(b'a message')

eth-keys examples

From open-source projects on GitHub

eth-account

Signs Ethereum transactions and messages using local private keys.

Downloads / mo
6.3M
Stars
314
Last release
0.14.0
License
MIT

Strengths

  • Works without a node connection. Create accounts and sign locally before choosing a broadcaster.
  • Signs structured Ethereum messages. Use sign_typed_data for structured message signatures.

Limitations

  • Typed-data signing remains unaudited. The typed-data implementation has not undergone an external audit.
  • Raw hashes need trusted origins. Prefer sign_message over signing a hash supplied by someone else.

Quickstart

From eth_account.html
$ python -m pip install eth-account
from eth_account import Account

account = Account.create()

Reads Ethereum blockchain data and interacts with smart contracts.

Downloads / mo
5.5M
Stars
5.5K
Last release
8.0.0
License
MIT

Strengths

  • Reads and calls smart contracts. Use one client for blocks, transactions, and contract interactions.
  • Offers multiple connection transports. Choose HTTP, IPC, or WebSocket connections to the node.

Limitations

  • Live reads need a node. Configure a provider connection before querying live Ethereum state.
  • Test provider needs extra dependencies. Install the tester extra for the local Ethereum test provider.

Quickstart

From quickstart.html
$ pip install "web3[tester]"
from web3 import Web3, EthereumTesterProvider

w3 = Web3(EthereumTesterProvider())
block = w3.eth.get_block('latest')

Provides Solana keypairs, transaction types, and RPC message codecs.

Downloads / mo
1.7M
Stars
450
Last release
0.29.0
License
Unresolved

Strengths

  • Builds typed RPC messages. Serialize RPC requests to JSON and parse typed responses.
  • Supports partial transaction signing. Collect signatures without sharing each signer’s private key.

Limitations

  • RPC networking needs solana-py. Use solana-py to send requests to an RPC server.
  • Token clients live elsewhere. Use solana-py for SPL Token and Memo clients.

Quickstart

From transactions.html
$ pip install solders
from solders.keypair import Keypair

keypair = Keypair()
public_key = keypair.pubkey()

Solders examples

From open-source projects on GitHub

Connects Python applications to Solana RPC and token programs.

Downloads / mo
853.1K
Stars
1.4K
Last release
0.42.0
License
MIT

Strengths

  • Provides an asynchronous RPC client. Use AsyncClient with a context manager for connection cleanup.
  • Manages subscription handles. Use returned handles to unsubscribe from the original connection.

Limitations

  • Core types live in solders. Import keypairs and transaction types from the solders package.
  • Signature subscriptions are one-shot. Unsubscribing after their notification raises ValueError.

Quickstart

From README.md
$ pip install solana
import asyncio
from solana.rpc.async_api import AsyncClient

async def main():
    async with AsyncClient('https://api.devnet.solana.com') as client:
        return await client.is_connected()

asyncio.run(main())

python-bitcoinlib

Provides general tools for the Bitcoin protocol.

Downloads / mo
568.9K
Stars
1.9K
Last release
0.12.2
License
LGPL-3.0-or-later

Quickstart

From __init__.py
$ pip install python-bitcoinlib
from bitcoin.core import CMutableTransaction

transaction = CMutableTransaction()
wire = transaction.serialize()

FAQ

web3 suits Ethereum apps that read chain data and call contracts. Solana.py with Solders suits Solana apps. eth-account suits code that only signs transactions and messages.

Solders provides Solana keypairs, transaction types, and RPC message codecs written in Rust with Python bindings. Solana.py uses it for its core types.

web3 is the Python library for Ethereum. It reads blocks and balances, sends transactions, and calls smart contracts through a node's JSON-RPC API.

python-bitcoinlib provides Bitcoin protocol data structures, scripts, and serialization in Python.

For coding agents

Found your blockchain library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official