> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tenderly.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Web3.py - Node RPC Integration

> Learn how to use Web3.py to enable your Python application to communicate with Ethereum through Node RPC.

[web3.py](https://web3py.readthedocs.io/en/stable/index.html) is a Python library for interacting with Ethereum.

It’s commonly found in decentralized apps (dapps) to help with sending transactions, interacting with smart contracts, reading block data, and a variety of other use cases. Point web3.py at [Node RPC](/node-rpc/overview) to reach 80+ EVM networks, and see the [JSON-RPC reference](/node-rpc/rpc-reference) for supported methods.

```py showLineNumbers title="connect.py" theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}

from web3 import Web3, AsyncWeb3

w3 = Web3(Web3.HTTPProvider('https:// mainnet.gateway.tenderly.co/<TENDERLY_NODE_ACCESS_KEY_MAINNET>'))
w3Async = AsyncWeb3(AsyncWeb3.AsyncHTTPProvider('https:// mainnet.gateway.tenderly.co/<TENDERLY_NODE_ACCESS_KEY_MAINNET>'))
w3Wss = Web3(Web3.WebsocketProvider('wss:// mainnet.gateway.tenderly.co/<TENDERLY_NODE_ACCESS_KEY_MAINNET>'))

print(w3.eth.get_block('latest'))
print(w3Async.eth.get_block('latest'))
print(w3Wss.is_connected())
print(w3Wss.eth.get_block('latest'))
```
