An easy introduction to begin to take advantage of the official STEEM library for Python and the Command Line Interface, steempy, to improve ourselves in Steemit.
Requirements
- Install Python3 from https://www.python.org/.
- Your operating system, preferably Linux, if you use Windows then install Python3 (requires Python 3.5 or higher) with Anacondapoint 1. from https://www.continuum.io/downloads and It is no longer necessary
- For wallet and query operations, an austere computer is enough; i.e., from 1GB RAM, 1.6 GHz CPU, it's OK.
Easy Installation
From your Console an internet connection do:
$pip install steem
In the future to keep steem-python updated:
$pip install -U steem
The library is under active development in https://github.com/steemit/steem-python
First steps
Testing the steem-python installation
If you need more background on the Python language:
Then let's start with the python console, on your system terminal :
$python
From python3:
>>>from steem import Steem
>>>s = Steem()
>>>s.get_account('jesuscirino')['sbd_balance'] #show SBD balance of the user jesuscirino
>>>'2.980 SBD'
>>>s.get_account('jesuscirino')['upvoting_power'] #show upvote power of the user jesuscirino
>>>9950
>>>s.get_account('jesuscirino').keys() #show all you can query about jesuscirino
dict_keys([ ...
... ... ...
... ])
>>>exit() #If everything works, then for now it's enough python
Testing the CLI utility steempy
Steem-python comes with a BIP38 encrypted wallet and a practical CLI utility called steempy. Open your operating system terminal for test it.
Set a passphrase for steempy use:
$steempy changewalletpassphrase
Now import your Steem account:
$steempy importaccount "youraccount"
Show balances or you can add more than one:
$steempy balance "youraccount" "otheraccount" "other"
List accounts:
steempy listaccounts
Show help:
steempy -h
To identifying results in steemit platform see example with my account, in the CLI:
In steemit:
On steemd, about balance:
References and thanks
For next blogs I will show more practical examples, different from some very good ones that exist in http://steem.readthedocs.io/en/latest/examples.html
Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://steemit.com/steem-dev/@jesuscirino/steem-python-step-by-step-1-getting-started