Python Steem Libraries Version 1.0 released!
This library allows you to interface with the wallet and/or a steem node
for polling data via RPC calls.
Download
You can download directly from github:
git clone https://github.com/xeroc/python-steem/
cd python-steem
python3 setup.py install --user
Or use pip
pip3 install steem --user
Setup
Even though you can connect to a remote full node, you can start a local
node via:
cd <path-to-steem>
./programs/steemd/steemd --rpc-endpoint="127.0.0.1:8090"
Then you can connect a cli_wallet
to your full node and open a new
port at 8092
:
./programs/cli_wallet/cli_wallet --server-rpc-endpoint=ws://localhost:8090 \
--rpc-http-endpoint=127.0.0.1:8092 \
--rpc-http-allowip=127.0.0.1
We will use both open ports in the example.
Usage Examples
from steemapi.steemclient import SteemClient
from pprint import pprint
class Config():
# Port and host of the RPC-HTTP-Endpoint of the wallet
wallet_host = "localhost"
wallet_port = 8092
# Websocket URL to the full node
witness_url = "ws://localhost:8090"
client = SteemClient(Config)
# Calls to the Wallet
pprint(client.wallet.vote("", "hello", "world", 100, True))
# Calls to the Node
pprint(client.node.get_trending_categories("", 20))
pprint(client.node.get_content("hello", "world"))
More examples can be found in the examples/
directory.