stellar-sdk
The Python Stellar SDK library provides APIs to build transactions and connect to Horizon and Stellar RPC server.
What it is and what it does
Stellar SDK is a Python library for building applications on the Stellar blockchain network. It provides networking APIs to communicate with Horizon (Stellar's data API) and Stellar RPC servers, along with tools for constructing, signing, and submitting transactions. The package handles account management, transaction building with various operations (payments, trades, etc.), and network history queries.
The library is designed for developers building Stellar apps in Python and supports modern Python versions (3.10+) and PyPy 3.11. It depends on established packages like pydantic for validation, pynacl for cryptographic signing, requests for HTTP communication, and xdrlib3 for Stellar's data serialization format. Optional async support and Shamir backup functionality are available through extras.
Use it for:
- Build and submit payment transactions on the Stellar network from a Python application
- Query account balances, transaction history, and network state via Horizon API
- Create and manage Stellar keypairs and sign transactions for custody or trading workflows
- Integrate Stellar blockchain functionality into a Python backend service or trading bot
- Call Stellar Soroban smart contracts using generated Python bindings
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Stellar SDK provides Python APIs to build and sign transactions, query network history, and communicate with Stellar Horizon and Stellar RPC servers for blockchain applications.
Yes. Stellar SDK is actively maintained (last commit 2026-07-27), has no known vulnerabilities, and provides a complete, well-documented interface to the Stellar blockchain. Low install friction, permissive licensing, and broad Python version support make it a solid choice for any Stellar-based Python project. Install with confidence if you need to interact with Stellar.
Install
stellar-sdk on PyPI
pip
pip install stellar-sdkuv
uv add stellar-sdkpoetry
poetry add stellar-sdkInstalling stellar-sdk
Before you install
Low friction install with a pure-Python wheel. Actively maintained with recent releases; last commit 2026-07-27. Requires Python 3.10+ or PyPy 3.11. Eight runtime dependencies are all established packages (pydantic, requests, pynacl, etc.), making the dependency tree straightforward.
License in practice
Apache-2.0 permissive license allows commercial use, modification, and distribution with minimal restrictions—suitable for most projects that can comply with attribution and license disclosure requirements.
Quickstart
pip install stellar-sdk
from stellar_sdk import Keypair, Server, TransactionBuilder, Network, Asset
alice_keypair = Keypair.from_secret("SBFZCHU5645DOKRWYBXVOXY2ELGJKFRX6VGGPRYUWHQ7PMXXJNDZFMKD")
server = Server("https://horizon-testnet.stellar.org")
account = server.load_account(alice_keypair.public_key)
transaction = TransactionBuilder(
source_account=account,
network_passphrase=Network.TESTNET_NETWORK_PASSPHRASE,
base_fee=100
).append_payment_op("GA7YNBW5CBTJZ3ZZOWX3ZNBKD6OE7A7IHUQVWMY62W2ZBG2SGZVOOPVH", Asset.native(), "10.25").build()
transaction.sign(alice_keypair)
response = server.submit_transaction(transaction)
Requires Python 3.10 or higher; PyPy 3.11 is also supported. Optional async support and Shamir backup require additional dependencies installed via extras.
Verify before relying
- Whether the package's type hints (Typing :: Typed classifier) cover all public APIs or only partial coverage
- Performance characteristics when handling large transaction batches or high-frequency network queries
- Compatibility details with Stellar RPC server versions beyond what the description states
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — mnemonic, pydantic, pynacl, requests, requests-sse, toml, typing-extensions, xdrlib3 |
| Maintenance | actively maintained — 41 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 179,787/month — #10,162 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: stellar_sdk-15.0.0-py3-none-any.whl
Keywords: stellar-sdk, stellar, stellar.org, lumens, xlm, blockchain, distributed exchange, cryptocurrency, dex, horizon, soroban, sdex, trading, soroban, soroban-rpc, stellar-rpc
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
web3web3.py is a Python library for interacting…
permissive · top 5,000 on PyPI
solanaSolana.py is a Python SDK for building…
permissive · top 5,000 on PyPI
injective-pyInjective Python SDK provides client libraries…
permissive · top 15,000 on PyPI
cdp-sdkPython client library for the Coinbase…
permissive · top 15,000 on PyPI
etherscan-pythonProvides a complete Python client for…
permissive · top 15,000 on PyPI
cosmpyCosmPy provides Python bindings to interact…
permissive · top 15,000 on PyPI
planetary-computerSigns Azure Blob Storage URLs and STAC objects…
permissive · top 15,000 on PyPI
aptos-sdkProvides Python bindings to interact with the…
permissive · top 15,000 on PyPI
hyperliquid-python-sdkPython SDK for trading on the Hyperliquid…
permissive · top 15,000 on PyPI
dune-clientA Python client for querying and managing Dune…
permissive · top 15,000 on PyPI