create account

[ANN] steemtools - A High-Level Python library for Steem by furion

View this thread on: hive.blogpeakd.comecency.com
· @furion ·
$1,963.32
[ANN] steemtools - A High-Level Python library for Steem
![](http://i.imgur.com/jVLWgAY.png)
*graphics by @etherdesign*

## Why steemtools
I have been pretty busy in the past month, working on several Steem related projects:
- SteemQ, a video platform on top of STEEM
- steem.li, real-time voting and curation tools
- IM market-maker, running 24/7
- a set of curation bots
- weekly reports on various topics

I had spent a fair amount of time writing code and looking for solutions that would enable me to in part do these things.

The need for the library emerged, as I realized I had scattered code over all of my projects, in many cases, implementing the same functionalities.

I have also been contacted by half a dozen people on https://steemit.chat, asking for advice on certain problems - problems I had already solved myself.

I think that different people solving the same problems makes no sense - when all we really want is to achieve a higher level goal.

The purpose of this library is to enable others to do what I do, and avoid the colossal waste of time.


## Acknowledgments
steemtools is built on top of [piston](https://github.com/xeroc/piston) and [python-steemlib](https://github.com/xeroc/python-steemlib), the awesome Python libraries made by @xeroc.

@jesta has been very helpful in #piston channel on https://steemit.chat, and **steem.ws**, a fast and reliable node cluster has saved me a lot of time, and allowed me to keep working while my local node was re-compiling/replaying.

And lastly, @burnin, a guy that [reverse-engineered the voting mechanisms](https://steemit.com/steemit/@burnin/reward-shares-understanding-how-your-votes-affect-a-post), and saved me so much time with the Converter module. 

Thank you guys, I could not have done this without you.

# Installation
I highly recommend starting off with [Anaconda distribution of Python 3.5](https://www.continuum.io/downloads).

After that, we only need to run one command:
```
pip install steemtools
```


# Modules
steemtools is currently comprised of 4 modules:
- `blockchain`: all utilities for blockchain traversal/parsing
- `base`: contains our `Post`, `Account` and `Converter` classes
- `helpers`: static helper functions
- `node`: a convenient way to connect to local RPC, with automatic failover to steem.ws

## Blockchain
-----------------

**Replaying History:**
```
from steemtools.blockchain import Blockchain

for event in Blockchain().replay():
    print("Event: %s" % event['op_type'])
    print("Time: %s" % event['timestamp'])
    print("Body: %s\n" % event['op'])
```

This function allows us to go back in time, and replay the entire STEEM blockchain from start to finish. Once it reaches the present moment, it will keep going, printing events with every new block (every 3 seconds or so).

The output will look a little bit like this:
![](http://i.imgur.com/HPhjgyp.png)

**Operation Types:**
Perhaps we aren't interested in all the events, but just specific ones.
We can ask `replay` to only give us **votes**:
```
for event in Blockchain().replay(filter_by="vote")
```
Or a set of events, such as **votes and comments**:
```
for event in Blockchain().replay(filter_by=["vote", "comment"])
```

For the reference, the full list of currently available operations is:
```
blockchain_operations = [
    'vote', 'comment', 'delete_comment', 'account_create', 'account_update',
    'limit_order_create', 'limit_order_cancel',
    'transfer',  'transfer_to_vesting', 'withdraw_vesting', 'convert', 'set_withdraw_vesting_route',
    'pow', 'pow2', 'feed_publish',  'witness_update',
    'account_witness_vote', 'account_witness_proxy',
    'recover_account', 'request_account_recovery', 'change_recovery_account',
    'custom', 'custom_json'
]
```

**Time Constraints:**
Parsing the ENTIRE blockchain is often unnecessary. We can specify a desired range:
```
start_block = 3598980
end_block = 4260042
for event in Blockchain().replay(start_block, end_block=end_block, filter_by=["vote", "comment"]):
	pprint(event)
```

Working with block numbers is painful, and this is why `blockchain` module comes with 2 helpers:
```
get_current_block()
get_block_from_time("2016-09-01T00:00:00")
```

**Putting it all together...**
```
b = Blockchain()
history = b.replay(
    start_block=b.get_block_from_time("2016-09-01T00:00:00"),
    end_block=b.get_current_block(),
    filter_by=['transfer']
)
for event in history:
    payment = event['op']
    print("@%s sent %s to @%s" % (payment['from'], payment['amount'], payment['to']))
```
The above code will fetch all the transfers from September 9th going forward, up until present.
```
...
@victoriart sent 1.000 SBD to @null
@dude sent 5.095 STEEM to @bittrex
@devil sent 5.107 STEEM to @poloniex
@pinoytravel sent 0.010 SBD to @null
@aladdin sent 5.013 STEEM to @poloniex
@mrwang sent 31.211 STEEM to @blocktrades
@kodi sent 0.030 SBD to @steembingo
...
```

## Account History
-----------------
Account module allows us to lookup virtual operations, as well as some of the common operations for an individual account.
Usually it is more efficient to query the account history over parsing the blockchain block-by-block.


**Looking up the account history:**
Accounts module gives us 2 generators for the task, **history**, which gives us account history from inception forward and **history2** which gives us account history newest to oldest. The interface should look familiar, as it is similar to the **replay** from the *blockchain* module.
```
from steemtools.base import Account
from steemtools.helpers import parse_payout

for event in Account("furion").history(filter_by=["transfer"]):
    transfer = event['op']
    if transfer['to'] == "null":
        print("$%.1f :: %s" % (parse_payout(transfer['amount']), transfer['memo']))
```
The code above will pull the transfer history for my account, find promoted posts by looking for transfers to @null, and finally print the $ amount spent as well as the permlink to the post.

```
$11.1 :: @furion/steem-analysis-ownership-distribution-and-the-whale-selling-pressure
$11.0 :: @furion/using-machine-learning-to-fight-plagiarism
$41.0 :: @furion/a-quick-look-at-null-and-the-profitability-of-promoted-posts
```

**Virtual Operations:**
As mentioned above, there are several operations that are *virtual*, and we cannot obtain these by parsing the blockchain itself. We can however lookup the history of virtual operations on a specific account with the **history** method.
```
Account("furion").history(filter_by=["curate_reward", "fill_order"])
```
Currently, the following types are available for the lookup (both virtual and not):
```
account_operations = {
    'account_create',
    'account_update',
    'account_witness_vote',
    'comment',
    'comment_reward',
    'convert',
    'curate_reward',
    'fill_order',
    'fill_vesting_withdraw',
    'fill_convert_request',
    'interest',
    'limit_order_cancel',
    'limit_order_create',
    'transfer',
    'transfer_to_vesting',
    'vote',
    'witness_update',
    'account_witness_proxy',
    'feed_publish',
    'pow', 'pow2',
    'withdraw_vesting',
}
```

## Account Methods
-----------------
Account has several helper methods. Here are a few:
```
from steemtools.base import Account

account = Account("furion")

account.get_sp()
#> 6211.590278675119

account.reputation()
#> 62.76

account.voting_power()
#> 80.75

account.avg_payout_per_post()
#> 142.7166
```

We can also easily obtain the latest blog posts. Lets get the titles of most recent 3:
```
blog = account.get_blog()
for post in blog[:3]:
	print(post['title'])

# outputs:
# A quick look at @null, and the profitability of Promoted Posts
# A quick look at the top curators and their rewards
# Homepage Payout Distribution, Power Law and Project Curie

```
How about a list of followers:
```
followers = account.get_followers()
#> ['anns', 'benjy33', 'negoshi', ...]

```

Lets obtain the curation stats:
```
account.curation_stats()
# outputs
# {'24hr': 9.627790750805277, '7d': 57.82547153222017, 'avg': 8.260781647460025}
```

Or get a basket of features:
```
account.get_features(max_posts, payout_requirement)
```

Outputs:
```
{'author': {'followers': 281,
  'post_count': 10,
  'ppp': 142,
  'rep': 62.76,
  'sp': 6211,
  'ttw': 281.0,
  'winners': 2},
 'name': 'furion',
 'settings': {'max_posts': 10, 'payout_requirement': 300}}
 ```
 Check out the `base.py` module for all the methods.

## Posts
-----------------
Post is a superset of `piston.steem.Post`. This means that, it behaves the same way, and has all the niceties and helpers that piston's Post object has.

We can initialize it in any of these ways:
a) using the identifier string
```
Post("@furion/homepage-payout-distribution-power-law-and-project-curie")
```

b) using a piston.steem.Post object
```
last_post = Account("furion").get_blog()[0]
Post(last_post)
```

c) using a author+permlink containing dictionary, such as vote
```
for vote in s.rpc.stream("vote"):
        print(vote)
        print(Post(vote))
        
# {'voter': 'ats-david', 'author': 'whatsup', 'weight': 10000, 'permlink': 're-steve-walschot-investigating-the-wale-scam-assumptions-above-knowledge-20160912t020220232z'}
# <Steem.Post-@whatsup/re-steve-walschot-investigating-the-wale-scam-assumptions-above-knowledge-20160912t020220232z>
```

----------
Now that our Post is initialized, we have access to extra methods. Here are a few:
```
p = Post("@furion/homepage-payout-distribution-power-law-and-project-curie")

p.payout()
#> 456.003

# if the post was 10 minutes old, this would output 33.33
p.calc_reward_pct()
#> 100

p.is_comment()
#> False

# not a spam tagged post
p.contains_tags(filter_by=["spam"])
#> False

p.get_votes()
#> [list of active votes]

```
Check out the `base.py` module for all the methods.


## Converter
-----------------
Converter is a class that tries to convert/calculate different units. I won't go into details in this post, aside from listing the available methods:
```
from steemtools.base import Converter

c = Converter()

c.sbd_median_price()
c.steem_per_mvests()

c.vests_to_sp(vests)
c.sp_to_vests(sp)
c.sp_to_rshares(sp)
c.steem_to_sbd(steem)
c.sbd_to_steem(sbd)
c.sbd_to_shares(sbd)
c.rshares_to_weight(rshares)
```

## Helpers
-----------------
Helpers is a set of static methods that are generally useful when dealing with Steem objects.
```
from steemtools import helpers

# get just the digit part of any asset (STEEM, VESTS, SBD)
helpers.parse_payout("12.3456 SBD") 
#> 12.3456

# break down our asset
helpers.read_asset("12.3456 SBD")
#> {'symbol': 'SBD', 'value': 12.3456}

# get time difference in seconds between lets say 2 posts
helpers.time_diff(time1, time2)
#> 1337

# determine if our object is a post or a comment
helpers.is_comment(object)
#> False

# time elapsed in seconds 
helpers.time_elapsed(post)
#> 9001
```


## Going forward
I wanted to be as minimal as possible with the first version, and only include the most essential components.

There are many new features, and areas in which steemtools can be expanded upon. For instance, an exchange module, that would allow for quick bootstrapping of a market-maker or arbitrage bot. These features may be added later on.

For now, I am looking for feedback and new ideas on how to improve whats already there, and make the library stable, so people can depend on it.

Github: [Netherdrake/steemtools](https://github.com/Netherdrake/steemtools)

-------------------

<center>![](http://i.imgur.com/5MaAhy7.png)  Don't miss out on the next post. [Follow me.](https://steemit.com/@furion)</center>

-------------------
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 356 others
properties (23)
authorfurion
permlinkann-steemtools-a-high-level-python-library-for-steem
categorysteemtools
json_metadata{"tags":["steemtools","steem","programming","python","piston"],"users":["etherdesign","xeroc","jesta","burnin","null"],"image":["http://i.imgur.com/jVLWgAY.png","http://i.imgur.com/HPhjgyp.png","http://i.imgur.com/5MaAhy7.png"],"links":["https://steemit.chat","https://github.com/xeroc/piston","https://github.com/xeroc/python-steemlib","https://steemit.com/steemit/@burnin/reward-shares-understanding-how-your-votes-affect-a-post","https://www.continuum.io/downloads","https://github.com/Netherdrake/steemtools","https://steemit.com/@furion"]}
created2016-09-13 11:25:42
last_update2016-09-13 11:25:42
depth0
children37
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value1,788.656 HBD
curator_payout_value174.668 HBD
pending_payout_value0.000 HBD
promoted56.000 HBD
body_length11,558
author_reputation116,503,940,714,958
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,230,572
net_rshares195,956,408,723,107
author_curate_reward""
vote details (420)
@airmike · (edited)
wow, very nice and useful post. thank you
👍  
properties (23)
authorairmike
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t115021347z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 11:50:21
last_update2016-09-13 11:54:24
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length41
author_reputation373,331,389,438
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,230,773
net_rshares89,044,991
author_curate_reward""
vote details (1)
@bhavnapatel68 ·
All the code language
👍  
properties (23)
authorbhavnapatel68
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t073433764z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-14 07:34:33
last_update2016-09-14 07:34:33
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length21
author_reputation4,976,629,087,476
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,240,941
net_rshares3,745,978,172
author_curate_reward""
vote details (1)
@bitcalm ·
This will make a nice addition to the other programming tools available for steem. Looking forward to getting my hands dirty with it. Thanks!
👍  , , , , ,
properties (23)
authorbitcalm
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t113329740z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 11:33:21
last_update2016-09-13 11:33:21
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length141
author_reputation24,919,530,803,138
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,230,642
net_rshares70,341,835,214
author_curate_reward""
vote details (6)
@bonitaxm · (edited)
thanks for this fantastic resource, making the library available to avoid reinventing the wheel, and as you said: "when all we really want is to achieve a higher level goal." This will enable faster and efficient development of new useful tools for the Steem community.
👍  
properties (23)
authorbonitaxm
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t132652511z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-14 13:27:12
last_update2016-09-14 13:27:51
depth1
children1
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length269
author_reputation16,266,652,407
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,243,057
net_rshares157,568,604
author_curate_reward""
vote details (1)
@jasonxg ·
Thats exactly it. A source of really wonderful and powerful tools at our finger tips. Like you say, no need to onvent the wheel twice.
properties (22)
authorjasonxg
permlinkre-bonitaxm-re-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t180009049z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-14 18:00:00
last_update2016-09-14 18:00:00
depth2
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length134
author_reputation16,487,583,851
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,245,435
net_rshares0
@chitty ·
amazing! thanks a lot
properties (22)
authorchitty
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t203113316z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-14 20:31:15
last_update2016-09-14 20:31:15
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length21
author_reputation86,901,300,608,582
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,246,919
net_rshares0
@chitty ·
$0.03
I couldnt wait and I built a simple script using steemtools: https://steemit.com/steemtools/@chitty/share-your-code-using-steemtools-to-get-an-accounts-info

 Thanks a lot to all you guys, I am just learning python and could never build something myself without steemtools lol
👍  
properties (23)
authorchitty
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t211941735z
categorysteemtools
json_metadata{"tags":["steemtools"],"links":["https://steemit.com/steemtools/@chitty/share-your-code-using-steemtools-to-get-an-accounts-info"]}
created2016-09-14 21:19:42
last_update2016-09-14 21:19:42
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.029 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length276
author_reputation86,901,300,608,582
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,247,410
net_rshares145,111,088,962
author_curate_reward""
vote details (1)
@clayop ·
Can I add other nodes? Currently public node (steem.ws) seems down.
properties (22)
authorclayop
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t194618893z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-14 19:46:21
last_update2016-09-14 19:46:21
depth1
children1
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length67
author_reputation270,845,899,918,618
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,246,464
net_rshares0
@furion · (edited)
$3.23
Every class takes `steem` as optional second argument.

So you can do something like:
```
my_steem_instance = piston.steem.Steem(node="mysteemnode.com")
Account("clayop", steem=my_steem_instance).get_sp()
```

I think I should add more fallback nodes into the default, thanks for pointing it out.
👍  ,
properties (23)
authorfurion
permlinkre-clayop-re-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t222429793z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-14 22:24:30
last_update2016-09-14 22:25:00
depth2
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value2.427 HBD
curator_payout_value0.807 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length296
author_reputation116,503,940,714,958
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,248,063
net_rshares6,280,189,555,284
author_curate_reward""
vote details (2)
@cristi ·
ah damn! can't wait to get my hands on it! :D you rock ;)
properties (22)
authorcristi
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t120220614z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 12:02:24
last_update2016-09-13 12:02:24
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length57
author_reputation128,305,218,872,904
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,230,885
net_rshares0
@cryptohazard ·
In the end normal steemit users will never win. Technical skills are too much of an advantages: html, bots, miners, ...
👍  
properties (23)
authorcryptohazard
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t112905285z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 11:29:03
last_update2016-09-13 11:29:03
depth1
children2
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length119
author_reputation17,111,780,434,071
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,230,594
net_rshares262,929,802
author_curate_reward""
vote details (1)
@l0k1 ·
and so it should be. ignorance is no kind of virtue.
properties (22)
authorl0k1
permlinkre-cryptohazard-re-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t045118851z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-14 04:51:21
last_update2016-09-14 04:51:21
depth2
children1
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length52
author_reputation94,800,257,230,993
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,240,083
net_rshares0
@cryptohazard ·
maybe but Steemit is not advertised that way. From the idea they present and the reality, the gap is huge. This is not about ignorance, it's about what kind of users you want on the platform.
👍  
properties (23)
authorcryptohazard
permlinkre-l0k1-re-cryptohazard-re-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t075426462z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-14 07:54:27
last_update2016-09-14 07:54:27
depth3
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length191
author_reputation17,111,780,434,071
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,241,020
net_rshares257,774,316
author_curate_reward""
vote details (1)
@cryptomental ·
I definitely will check your tool and start using it. Did you also make any experiments with the steem  debug node? I mean the node started with this script: https://github.com/steemit/steem/blob/develop/python_scripts/steemdebugnode/debugnode.py . Your library looks like a good candidate for the test/experimental tool to interact with the blockchain.
👍  , ,
properties (23)
authorcryptomental
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t113431704z
categorysteemtools
json_metadata{"tags":["steemtools"],"links":["https://github.com/steemit/steem/blob/develop/python_scripts/steemdebugnode/debugnode.py"]}
created2016-09-13 11:34:30
last_update2016-09-13 11:34:30
depth1
children1
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length353
author_reputation6,756,831,217,523
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,230,649
net_rshares20,766,314,170
author_curate_reward""
vote details (3)
@furion ·
I will look into it. Thanks for bringing it up.
properties (22)
authorfurion
permlinkre-cryptomental-re-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t113545245z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 11:35:45
last_update2016-09-13 11:35:45
depth2
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length47
author_reputation116,503,940,714,958
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,230,659
net_rshares0
@denise12 ·
Syntax and switches

The command syntax is
netstat [-a] [-b] [-e] [-f] [-n] [-o] [-p proto] [-r] [-s] [-t] [-v] [interval]
A brief description of the switches is given in Table I below. Some switches are only in certain Windows versions, as noted in the table..Note that switches for Netstat use the dash symbol "-" rather than the slash "/".

Switch	Description
-a	Displays all connections and listening ports
-b	Displays the executable involved in creating each connection or listening port. (Added in XP SP2.)
-e	Displays Ethernet statistics
-f	Displays Fully Qualified Domain Names for foreign addresses. (In Windows Vista/7 only)
-n	Displays addresses and port numbers in numerical form
-o	Displays the owning process ID associated with each connection
-p proto	Shows connections for the protocol specified by proto; proto may be any of: TCP, UDP, TCPv6, or UDPv6.
-r	Displays the routing table
-s	Displays per-protocol statistics
-t	Displays the current connection offload state, (Windows Vista/7)
-v	When used in conjunction with -b, will display sequence of components involved in creating the connection or listening port for all executables. (Windows XP SP2, SP3)
[interval]	An integer used to display results multiple times with specified number of seconds between displays. Continues until stopped by command ctrl+c. Default setting is to display once,
Applications of Netstat

Netstat is one of a number of command-line tools available to check the functioning of a network. (See this page for discussion of other tools.) It provides a way to check if various aspects of TCP/IP are working and what connections are present. In Windows XP SP2, a new switch "-B" was added that allows the actual executable file that has opened a connection to be displayed. This newer capability provides a chance to catch malware that may be phoning home or using your computer in unwanted ways on the Internet. There are various ways that a system administrator might use the assortment of switches but I will give two examples that might be useful to home PC users.
properties (22)
authordenise12
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160915t172949296z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-15 17:32:30
last_update2016-09-15 17:32:30
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,063
author_reputation-75,434,254,840
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,256,515
net_rshares0
@fooblic ·
Great tool! One point I could not catch: how you get virtual operations like "reward" if they are not in blockchain? What a database store such transactions and how we can trust its without confirmations in blockchain ? Thanks in advance for reply.
properties (22)
authorfooblic
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t203952865z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-14 20:39:51
last_update2016-09-14 20:39:51
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length248
author_reputation3,437,490,587,774
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,247,021
net_rshares0
@furion ·
$0.03
If you don't have a local node (its highly recommended to have a local node for use of this library), you will need to get the develop version of `piston` installed, to get the automatic fallback to remote node (new feature in python-steemlib, not on master yet).

Just run this after installing steemtools:
```
pip install --upgrade --no-deps --force-reinstall  git+git://github.com/xeroc/piston@develop
pip install --upgrade --no-deps --force-reinstall  git+git://github.com/xeroc/python-steemlib@develop
pip install --upgrade --no-deps --force-reinstall  git+git://github.com/xeroc/python-graphenelib@develop
```
👍  , , ,
properties (23)
authorfurion
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t115112382z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 11:51:12
last_update2016-09-13 11:51:12
depth1
children5
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.029 HBD
curator_payout_value0.002 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length615
author_reputation116,503,940,714,958
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,230,784
net_rshares157,862,314,108
author_curate_reward""
vote details (4)
@cryptomental · (edited)
Exception: Block is None. Are you trying to fetch a block from the future?

Hmm any idea what could have gone wrong? I have a fresh Ubuntu 16.04 64bit + pyenv named pysteem:

```
(pysteem) 09:08:45 (master)/sandbox/steemtools$ pip install --upgrade --no-deps --force-reinstall  git+git://github.com/xeroc/piston@develop
Collecting git+git://github.com/xeroc/piston@develop
  Cloning git://github.com/xeroc/piston (to develop) to /tmp/pip-04vpcgco-build
Installing collected packages: steem-piston
  Found existing installation: steem-piston 0.3.3
    Uninstalling steem-piston-0.3.3:
      Successfully uninstalled steem-piston-0.3.3
  Running setup.py install for steem-piston ... done
Successfully installed steem-piston-0.3.3
(pysteem) 09:08:54 (master) /sandbox/steemtools$ pip install --upgrade --no-deps --force-reinstall  git+git://github.com/xeroc/python-steemlib@develop
Collecting git+git://github.com/xeroc/python-steemlib@develop
  Cloning git://github.com/xeroc/python-steemlib (to develop) to /tmp/pip-67_ya3r5-build
Installing collected packages: steem
  Found existing installation: steem 0.2.2
    Uninstalling steem-0.2.2:
      Successfully uninstalled steem-0.2.2
  Running setup.py install for steem ... done
Successfully installed steem-0.2.2
(pysteem) 09:09:17 (master) /sandbox/steemtools$ pip install --upgrade --no-deps --force-reinstall  git+git://github.com/xeroc/python-graphenelib@develop
Collecting git+git://github.com/xeroc/python-graphenelib@develop
  Cloning git://github.com/xeroc/python-graphenelib (to develop) to /tmp/pip-ywwee05e-build
Installing collected packages: graphenelib
  Found existing installation: graphenelib 0.4.5
    Uninstalling graphenelib-0.4.5:
      Successfully uninstalled graphenelib-0.4.5
  Running setup.py install for graphenelib ... done
Successfully installed graphenelib-0.4.5
(pysteem) 09:09:34 (master) /sandbox/steemtools$ python examples/blockchain.py 
Lost connection to node during wsconnect(): ws://127.0.0.1:8090 (1/-1) Retrying in 0 seconds
Please provide a password for the new wallet
Passphrase: 
Confirm Passphrase: 
Traceback (most recent call last):
  File "examples/blockchain.py", line 6, in <module>
    for event in Blockchain().replay():
  File "/sandbox/pysteem/lib/python3.5/site-packages/steemtools-1-py3.5.egg/steemtools/blockchain.py", line 53, in replay
Exception: Block is None. Are you trying to fetch a block from the future?
```

Timezone is GMT+2 (9:08 - it is currently 21:08 Berlin time).
👍  
properties (23)
authorcryptomental
permlinkre-furion-re-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t191321095z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 19:13:21
last_update2016-09-13 19:15:09
depth2
children4
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,489
author_reputation6,756,831,217,523
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,235,088
net_rshares157,568,604
author_curate_reward""
vote details (1)
@furion · (edited)
Good catch. Try `for event in Blockchain().replay(start_block=1)`

I have been refactoring a lot today, and I forgot that the blocks start at 1 (default is 0). Will push a bugfix update out asap.
Edit: The bugfix is out,  `pip install --upgrade steemtools`
👍  ,
properties (23)
authorfurion
permlinkre-cryptomental-re-furion-re-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t191915566z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 19:19:15
last_update2016-09-13 19:31:36
depth3
children3
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length256
author_reputation116,503,940,714,958
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,235,171
net_rshares3,902,535,297
author_curate_reward""
vote details (2)
@good-karma ·
Great work, mate... more library tools more developer apps and helps new developers in future to keep building on top of Steem!
👍  
properties (23)
authorgood-karma
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t123114525z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 12:31:15
last_update2016-09-13 12:31:15
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length127
author_reputation656,210,817,936,836
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,231,079
net_rshares2,613,680,509
author_curate_reward""
vote details (1)
@jasonxg ·
There so many great steamtools its bloody brilliant !
properties (22)
authorjasonxg
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t175718875z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-14 17:57:09
last_update2016-09-14 17:57:09
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length53
author_reputation16,487,583,851
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,245,398
net_rshares0
@jesta ·
This is absolutely fantastic! I started writing some of this code the other day for the @bounty bot, I think since my codes still rather immature and not a working library, I might have to take a stab at using this instead.

I was going through and analyzing @burnin's code as well hahaha.
👍  , , ,
properties (23)
authorjesta
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t053037057z
categorysteemtools
json_metadata{"tags":["steemtools"],"users":["bounty","burnin"]}
created2016-09-14 05:30:36
last_update2016-09-14 05:30:36
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length289
author_reputation140,605,453,893,072
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,240,311
net_rshares50,893,505,401
author_curate_reward""
vote details (4)
@kaptainkrayola ·
This almost makes me want to learn Python :) .  Looks awesome
👍  
properties (23)
authorkaptainkrayola
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t125748436z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 12:57:48
last_update2016-09-13 12:57:48
depth1
children6
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length61
author_reputation2,518,560,260,114
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,231,314
net_rshares2,767,426,421
author_curate_reward""
vote details (1)
@bitcoiner ·
Do it! Join the Python side.
👍  
properties (23)
authorbitcoiner
permlinkre-kaptainkrayola-re-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t232017025z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 23:20:15
last_update2016-09-13 23:20:15
depth2
children5
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length28
author_reputation28,017,014,641,958
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,237,610
net_rshares4,876,299,293
author_curate_reward""
vote details (1)
@kaptainkrayola ·
If i can get over it being a whitespace language I just might.  Seems to have a big following with Steem and I'd love to be able to work on some of those projects with you fine devs.
properties (22)
authorkaptainkrayola
permlinkre-bitcoiner-re-kaptainkrayola-re-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t011457841z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-14 01:14:57
last_update2016-09-14 01:14:57
depth3
children3
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length182
author_reputation2,518,560,260,114
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,238,653
net_rshares0
@l0k1 ·
i for one welcome you all to the whitespace darkside. i have been a student of CS since i was a littlie, and readability has always been a problem for new folk looking at old code.
👍  
properties (23)
authorl0k1
permlinkre-bitcoiner-re-kaptainkrayola-re-furion-ann-steemtools-a-high-level-python-library-for-steem-20160914t045009756z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-14 04:50:09
last_update2016-09-14 04:50:09
depth3
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length180
author_reputation94,800,257,230,993
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,240,076
net_rshares5,228,577,263
author_curate_reward""
vote details (1)
@linkback-bot-v0 ·
This post has been linked to from another place on Steem.


  - [SHARE YOUR CODE: Using SteemTools to get accounts info](https://steemit.com/steemtools/@chitty/share-your-code-using-steemtools-to-get-an-accounts-info) by @chitty


Learn more about [**linkback bot v0.4**](https://steemit.com/steem/@ontofractal/steem-linkback-bot-v0-4-released). Upvote if you want the bot to continue posting linkbacks for your posts. Flag if otherwise.

Built by @ontofractal
properties (22)
authorlinkback-bot-v0
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-linkbacks
categorysteemtools
json_metadata{}
created2016-09-16 13:46:54
last_update2016-09-16 13:46:54
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length461
author_reputation1,915,954,976,722
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,265,845
net_rshares0
@noisy ·
$0.03
High level perspective of this library is great! :) I love it :)

So right now stack looks like this:

steemtools use piston
piston use steemlib
steemlib use graphenelib
graphenelib connects with steemblockchain
👍  , , , ,
properties (23)
authornoisy
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t113553935z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 11:35:54
last_update2016-09-13 11:35:54
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.024 HBD
curator_payout_value0.003 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length211
author_reputation59,974,373,499,600
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,230,661
net_rshares134,530,831,268
author_curate_reward""
vote details (5)
@pgarcgo ·
Impresive! Good job!
properties (22)
authorpgarcgo
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t113023206z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 11:30:24
last_update2016-09-13 11:30:24
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length20
author_reputation118,205,269,281,710
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,230,611
net_rshares0
@steevc ·
This looks really cool. I've been learning Python and I need to try it out on Steemit. Thanks
properties (22)
authorsteevc
permlinkre-furion-ann-steemtools-a-high-level-python-library-for-steem-20160913t122817509z
categorysteemtools
json_metadata{"tags":["steemtools"]}
created2016-09-13 12:27:36
last_update2016-09-13 12:27:36
depth1
children0
last_payout2016-10-15 04:22:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length93
author_reputation1,373,798,941,674,792
root_title"[ANN] steemtools - A High-Level Python library for Steem"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,231,040
net_rshares0