xrpl-py

raw JSON →
4.5.0 verified Mon Apr 27 auth: no python

A complete Python library for interacting with the XRP Ledger, supporting wallets, transactions, and network communication. Currently at version 4.5.0, with active development and a release cadence of roughly monthly.

pip install xrpl-py
error AttributeError: module 'xrpl' has no attribute 'Wallet'
cause Importing Wallet directly from the top-level xrpl package.
fix
Use from xrpl.wallet import Wallet
error ModuleNotFoundError: No module named 'xrpl'
cause Library not installed or not activated in current virtual environment.
fix
pip install xrpl-py
error ValueError: The secret is invalid.
cause Using an incorrect seed format or trying to recover a wallet from an invalid family seed.
fix
Ensure the seed is a valid XRPL family seed (starts with 's') and use Wallet.from_seed(seed)
breaking In v4.0.0, the transaction model classes were renamed (e.g., Payment became PaymentTx). Code using old names will break.
fix Update imports to use new class names: from xrpl.models.transactions import PaymentTx
breaking In v4.0.0, the Wallet class moved from xrpl.core to xrpl.wallet and its constructor changed. Import from xrpl.wallet instead.
fix Use from xrpl.wallet import Wallet
deprecated xrpl.clients.websocket_client.WebsocketClient is deprecated. Use xrpl.asyncio.clients.WebsocketClient instead.
fix Use from xrpl.asyncio.clients import WebsocketClient
gotcha Do NOT use xrpl.clients.JsonRpcClient for signing transactions; it's only for submitting. Use xrpl.transaction.submit_and_wait for full lifecycle.
fix Use xrpl.transaction.submit_and_wait(...) to handle signing and submission.

Create a testnet client and a new wallet.

import xrpl
from xrpl.clients import XRPClient
from xrpl.wallet import Wallet

client = XRPClient(json_rpc_url='https://s.altnet.rippletest.net:51234')
wallet = Wallet.create()
print(f'Classic address: {wallet.classic_address}')
print(f'Seed: {wallet.seed}')