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
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:
pip install -U stellar-base
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
Links
Examples: https://github.com/StellarCN/py-stellar-base/tree/master/examples
Releases: https://pypi.org/project/stellar-base/
Issue tracker: https://github.com/StellarCN/py-stellar-base/issues
License Apache License 2.0: https://github.com/StellarCN/py-stellar-base/blob/master/LICENSE
Thank you to all the people who have already contributed to py-stellar-base!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file stellar-base-1.0.1.2.tar.gz
.
File metadata
- Download URL: stellar-base-1.0.1.2.tar.gz
- Upload date:
- Size: 115.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12f28eea83ca8d958298e02a4d29992d763f9cbb276fa2f0681a7cf7cfab031d |
|
MD5 | 79e2d6a60d6722835918df558ef4dd4b |
|
BLAKE2b-256 | 41125a1751904609b69c753a4cdd2f133b54d4781591eed7429aa502c1ebe23b |
File details
Details for the file stellar_base-1.0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: stellar_base-1.0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 119.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0e987d47ec4164269b563dbcef78a443c01549185d9f075f3c34ef637c84afd |
|
MD5 | f6db54f7ad9e8e33ef40469155f017fb |
|
BLAKE2b-256 | 2a12e767bb2d6591d8c9129fbd5c6d9e24d966a809ef344463e23a706b125490 |