Practical overview
When it fits
Use it when a Python application needs to connect to Horizon or RPC for Stellar network data or transaction workflows.
Who it is for
- Python developers building applications that interact with Stellar Horizon or Stellar RPC.
- Teams implementing Stellar transaction and network-data workflows in Python.
Documented uses
- Query Stellar network history through Horizon or RPC.
- Construct and sign Stellar transactions.
- Submit signed transactions to a Stellar server.
Requirements & limits
The repository is public and identifies the project as open source under Apache-2.0. The README lists Python 3.10+ and PyPy 3.11 support.
- It is a library for application development, not a hosted end-user service.
- The README provides separate package extras for asynchronous use and Shamir backup support.
- Soroban binding generation and Horizon JSON parsing are attributed to related projects, stellar-contract-bindings and stellar-model.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install the Stellar Python SDK
Add the SDK to a Python project, choosing the documented optional dependency when asynchronous use or Shamir backup support is needed.
Before you start
- Python 3.10+ or PyPy 3.11
- A Python environment in which to install packages
Steps
Install the package with the command below.
pip install --upgrade stellar-sdkFor asynchronous use, install with the command below instead.
pip install --upgrade stellar-sdk[aiohttp]For Shamir backup support, install with the command below instead.
pip install --upgrade stellar-sdk[shamir]
Expected outcome
The documented stellar-sdk package and, when selected, its asynchronous or Shamir backup dependencies are installed.
Guide limitations
- These steps cover installation only, not connection setup or transaction execution.
- The README recommends specifying the major version in the dependency file to avoid unknown effects from breaking changes.
Build and submit a testnet XLM payment
Follow the README example to construct, sign and submit an XLM payment through a Stellar Horizon testnet server.
Before you start
- Python 3.10+ or PyPy 3.11
- The installed
stellar-sdkpackage - A Stellar account keypair and recipient address
- A connection to the Horizon testnet server used in the example
Steps
Create the sender keypair and recipient address, then connect to
https://horizon-testnet.stellar.org.Load the sender account and initialize a transaction builder with the testnet network passphrase and base fee.
Add the payment operation, set a timeout and build the transaction.
Sign the transaction with the sender keypair and submit it through the server.
Expected outcome
The example submits a signed 10.25 XLM payment to Horizon testnet and prints the server response.
Guide limitations
- The example is explicitly a testnet workflow; it does not document a mainnet configuration.
- The README example includes a secret-key literal; use appropriately controlled credentials for any real account.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 10 October 2026
- Original website title
- StellarCN/py-stellar-base · Official homepage title · retained in its source language

