Skip to main content

Conservative Version of library for managing Stellar.org blockchain transactions and accounts using stellar-base in python. Allows full functionality interfacing with the Horizon front end. Code is audited. See https://www.stellar.org/developers/ for more info

Project description

Python libraries that allow you to interface with the stellar.org horizon interface. Stellar-base library consists of classes to read, write, hash, and sign the xdr structures that are used in stellar-core.

# install

pip install stellar-base

# requirements

ed25519 requires python-dev to be installed ubuntu/debian: sudo apt-get install python-dev # for python2.x installs sudo apt-get install python3-dev # for python3.x installs yum: sudo yum install python-devel

check out full stellar development docs at: https://www.stellar.org/developers/guides/

And the laboratory: https://www.stellar.org/laboratory/#?network=test

#getting lumens

The Stellar blockchain functions with lumens for settlement and account creation. To get some lumens (xlm)

Test network: url = ‘https://horizon-testnet.stellar.org’ r = requests.get(url + ‘/friendbot?addr=’ + kp.address().decode(‘ascii’)) # Get 1000 lumens Live: https://binance.com https://tempo.eu.com https://btc38.com

Travis (.org) Read the Docs Codecov

It provides:

  • a networking layer API for Horizon endpoints.

  • facilities for building and signing transactions, for communicating with a Stellar Horizon instance, and for submitting transactions or querying network history.

  • you can use stellar.org’s version of Horizon or setup your own node to query and submit transactions

  • I review all code submitted onto pypi manually

  • the maintainer email address is maintained with 2 factor hardware authentication and the pypi account password is 18 random characters.

Installing

Install from pypi, there are two packages here, please choose one of them:

  • The current conservative package is maintained by antb123. PyPI

pip install -U stellar-base
  • The package is built automatically by Travis-CI. PyPI

pip install -U stellar-sdk

Install from latest source code(may be unstable):

pip install git+git://github.com/StellarCN/py-stellar-base

A Simple Example

# Alice pay 10.25 XLM to Bob
from stellar_base.builder import Builder

alice_secret = 'SCB6JIZUC3RDHLRGFRTISOUYATKEE63EP7MCHNZNXQMQGZSLZ5CNRTKK'
bob_address = 'GA7YNBW5CBTJZ3ZZOWX3ZNBKD6OE7A7IHUQVWMY62W2ZBG2SGZVOOPVH'

builder = Builder(secret=alice_secret)
builder.add_text_memo("Hello, Stellar!").append_payment_op(
    destination=bob_address, amount='10.25', asset_code='XLM')
builder.sign()
response = builder.submit()
print(response)

Document

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stellar-base-1.0.1.2.tar.gz (115.3 kB view hashes)

Uploaded Source

Built Distribution

stellar_base-1.0.1.2-py2.py3-none-any.whl (119.7 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page