|
| 1 | +py-stellar-base |
| 2 | +=============== |
| 3 | + |
| 4 | +.. image:: https://img.shields.io/travis/StellarCN/py-stellar-base.svg?maxAge=1800 |
| 5 | + :alt: Travis (.org) |
| 6 | + :target: https://travis-ci.org/StellarCN/py-stellar-base/ |
| 7 | + |
| 8 | +.. image:: https://img.shields.io/readthedocs/stellar-base.svg?maxAge=1800 |
| 9 | + :alt: Read the Docs |
| 10 | + :target: https://stellar-base.readthedocs.io/en/latest/ |
| 11 | + |
| 12 | +.. image:: https://img.shields.io/pypi/v/stellar-base.svg?maxAge=1800 |
| 13 | + :alt: PyPI |
| 14 | + :target: https://pypi.python.org/pypi/stellar-base |
| 15 | + |
| 16 | + |
| 17 | +.. image:: https://img.shields.io/codecov/c/github/StellarCN/py-stellar-base.svg?maxAge=1800 |
| 18 | + :alt: Codecov |
| 19 | + :target: https://codecov.io/gh/StellarCN/py-stellar-base |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +py-stellar-sdk is a Python library for communicating with |
| 24 | +a `Stellar Horizon server`_. It is used for building Stellar apps on Python. |
| 25 | + |
| 26 | +It provides: |
| 27 | + |
| 28 | +- a networking layer API for Horizon endpoints. |
| 29 | +- facilities for building and signing transactions, for communicating with a Stellar Horizon instance, and for submitting transactions or querying network history. |
| 30 | + |
| 31 | +Installing |
| 32 | +---------- |
| 33 | + |
| 34 | +Install from pypi: |
| 35 | + |
| 36 | +.. code-block:: text |
| 37 | +
|
| 38 | + pip install -U stellar-base |
| 39 | +
|
| 40 | +Install from latest source code(*may be unstable*): |
| 41 | + |
| 42 | +.. code-block:: text |
| 43 | +
|
| 44 | + pip install -U git+git://github.com/StellarCN/py-stellar-base |
| 45 | +
|
| 46 | +
|
| 47 | +A Simple Example |
| 48 | +---------------- |
| 49 | + |
| 50 | +.. code-block:: python |
| 51 | +
|
| 52 | + # Alice pay 10 XLM to Bob |
| 53 | + from stellar_base.builder import Builder |
| 54 | +
|
| 55 | + alice_secret = 'SCB6JIZUC3RDHLRGFRTISOUYATKEE63EP7MCHNZNXQMQGZSLZ5CNRTKK' |
| 56 | + bob_address = 'GA7YNBW5CBTJZ3ZZOWX3ZNBKD6OE7A7IHUQVWMY62W2ZBG2SGZVOOPVH' |
| 57 | +
|
| 58 | + builder = Builder(secret=alice_secret) |
| 59 | + builder.add_text_memo("Hello, Stellar!").append_payment_op( |
| 60 | + destination=bob_address, amount='12.25', asset_code='XLM') |
| 61 | + builder.sign() |
| 62 | + response = builder.submit() |
| 63 | + print(response) |
| 64 | +
|
| 65 | +
|
| 66 | +Document |
| 67 | +-------- |
| 68 | +* Quick Start: https://stellar-base.readthedocs.io/en/latest/quickstart.html |
| 69 | +* API: https://stellar-base.readthedocs.io/en/latest/api.html |
| 70 | + |
| 71 | + |
| 72 | +Links |
| 73 | +----- |
| 74 | +* Examples: https://github.com/StellarCN/py-stellar-base/tree/master/examples |
| 75 | +* Releases: https://pypi.org/project/stellar-base/ |
| 76 | +* Code: https://github.com/StellarCN/py-stellar-base |
| 77 | +* Issue tracker: https://github.com/StellarCN/py-stellar-base/issues |
| 78 | +* License: `Apache License 2.0 <https://github.com/StellarCN/py-stellar-base/blob/master/LICENSE>`_ |
| 79 | + |
| 80 | +Thank you to all the people who have already contributed to py-stellar-base! |
| 81 | + |
| 82 | +.. _Stellar Horizon server: https://github.com/stellar/go/tree/master/services/horizon |
0 commit comments