Registry / aws / stellar-sdk

stellar-sdk

JSON →
library14.1.0pypypi✓ verified 84d ago

The Python Stellar SDK provides APIs to build transactions, interact with Horizon and Stellar RPC servers, and support Soroban smart contracts. Version 13.2.1 supports Protocol 23, SEP-45, and async operations. Released roughly monthly on GitHub.

pip install stellar-sdk
INSTALL
IMPORT
SIG · STELLAR-SDK
S
stellar-sdk
awspythonv14.1.0
Install
5.1s avg
Import
1671ms
Disk
45MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v14.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.776s · 46MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 5.1s · import 1.566s · 46MB
45MB installed
● package 45MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Server
from stellar_sdk.server import Server
from stellar_sdk import Server
Server was moved to stellar_sdk.server in v10+
TransactionBuilder
from stellar_sdk.transaction_builder import TransactionBuilder
Always use explicit import path
Keypair
from stellar_sdk.keypair import Keypair
Keypair is in its own module
SorobanServer
from stellar_sdk.soroban_server import SorobanServer
For Soroban RPC interactions

Generate a random keypair and load its account from the testnet.

from stellar_sdk.keypair import Keypair from stellar_sdk.server import Server server = Server(horizon_url="https://horizon-testnet.stellar.org") keypair = Keypair.random() print(f"Public: {keypair.public_key}, Secret: {keypair.secret}") account = server.load_account(keypair.public_key) print(f"Sequence: {account.sequence}")
Debug
Known issues
breakingIn v13.0.0, `StrKey` added support for med25519, liquidity pools, and claimable balances. Existing encoded strings may change interpretation.
fix
Review usage of `StrKey.decode_ed25519_public_key` or similar; ensure encoded data still works as expected.
affects: >=13.0.0
deprecated`diagnostic_events_xdr` has been removed from `stellar_sdk.soroban_rpc.Events`. Use `GetTransactionResponse.diagnostic_events_xdr` instead.
fix
Access `diagnostic_events_xdr` via `GetTransactionResponse` or `Transaction` objects.
affects: 13.2.0+
gotcha`SorobanServer.get_events()` and similar paginated methods: `start_ledger` is optional, but if omitted the server may return unexpected results.
fix
Always pass `start_ledger` explicitly when paginating to avoid missing events.
affects: >=12.2.1
breakingFrom v13.0.0, Transaction meta handling is updated for Protocol 23 v4. Older meta formats may not parse correctly.
fix
Ensure any metadata deserialization code is updated for the new XDR format (v4).
affects: >=13.0.0
gotchaWhen creating a `TransactionBuilder`, you must provide a valid `network_passphrase`. Using the wrong passphrase (e.g., testnet vs public) will cause submission failures.
fix
Use `stellar_sdk.Network.TESTNET_NETWORK_PASSPHRASE` or `Network.PUBLIC_NETWORK_PASSPHRASE`.
affects: all
Errors
Common errors & fixes
AttributeError: module 'stellar_sdk' has no attribute 'Server'
Server is not directly under stellar_sdk; it's in a submodule.
fix
Use `from stellar_sdk.server import Server`
stellar_sdk.exceptions.NotFoundError: Resource not found
Using a public network Horizon URL for a testnet account, or vice versa.
fix
Match the horizon_url to the network: testnet -> https://horizon-testnet.stellar.org, public -> https://horizon.stellar.org
stellar_sdk.exceptions.BadRequestError: ... "op_no_destination"
Payment operation has no destination account or invalid destination.
fix
Ensure the destination account exists on the network and is a valid Stellar address.
Upgrade
Version history
14.1.0latest on PyPI · released Jun 3, 2026
Audit
Dependencies
aiohttprequiredasync HTTP client for Stellar RPC
cryptographyrequiredkey generation and signing
Agent activity
45 hits · last 30 days
node
40
Meta
1
OpenAI (training)
1
Resources
stellar-sdk — pip install stellar-sdk · libregistry