skillfed

stellar-sdk

The Python Stellar SDK library provides APIs to build transactions and connect to Horizon and Stellar RPC server.

stellar-sdk v15.0.0 179.8K downloads/30d#10,162 on PyPI368
Permissive license Apache-2.0 Active released

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-sdk

uv

uv add stellar-sdk

poetry

poetry add stellar-sdk

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

stellar blockchain pythonbuild stellar transactionsstellar horizon clientxlm cryptocurrency sdkstellar soroban contractsdistributed exchange pythonstellar rpc server
blockchaincryptocurrencycryptography

More Python Modules packages