Base
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Base
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Python's tooling covers the full range of Base work. web3.py is the general-purpose library for scripting and application backends — reading balances, sending transactions, and calling contracts on the Coinbase-built L2 — while eth-brownie wraps a complete smart-contract development workflow with testing and deployment built in. Because Base is EVM-equivalent and uses ETH for gas, both connect to https://base.therpc.io/YOUR_API_KEY at chain ID 8453, and the same code scales from a one-off script to a production indexer.
web3.py 6+ offers both synchronous and asynchronous interfaces against Base. The sync API is simplest for scripts; for concurrent workloads, async usage requires AsyncWeb3 paired with an async-compatible provider so many Base requests can be in flight at once.
Install web3.py with pip install web3, then connect by wrapping your Base endpoint in an HTTP provider: Web3(Web3.HTTPProvider('https://base.therpc.io/YOUR_API_KEY')). As the de facto official Python library for EVM chains, it exposes the full JSON-RPC surface — eth.get_balance, eth.send_raw_transaction, contract calls, and more — all working unchanged on Base at chain ID 8453.
eth-brownie is a Python framework built around the full smart-contract lifecycle on Base — writing, testing, and deploying Solidity — with pytest-style tests and managed deployments. Configure a Base network in Brownie pointing at https://base.therpc.io/YOUR_API_KEY (chain ID 8453) and your contracts deploy there just as they would on any EVM chain. Install it with pip install eth-brownie.
For concurrent work against Base — fetching many blocks or balances at once — web3.py's AsyncWeb3 interface lets requests overlap instead of running one at a time, a real win when you're scanning Base's fast ~2s blocks. It requires an async-compatible provider and runs inside an asyncio event loop, so drive it from async def functions with asyncio.run.
web3.py ships comprehensive type stubs, so you can annotate your Base code with TxParams, Wei, and Address imported from web3.types. These give you IDE autocompletion and let mypy statically catch mistakes — like passing a plain int where a Wei is expected — before a transaction ever reaches the Base network.