create account

How to set beneficiaries with steem-python by felixxx

View this thread on: hive.blogpeakd.comecency.com
· @felixxx · (edited)
$69.56
How to set beneficiaries with steem-python
## It only took me 22 days to figure out ...
##
This was my issue:

https://github.com/steemit/steem-python/issues/9

In the [commit.py](https://github.com/steemit/steem-python/blob/452b6423aaae3428781628c02eec0eaf6af564e2/steem/commit.py#L214) it says:

```
For example, if we would like to split rewards between account1 and account2:

    beneficiaries = [
                     {'account': 'account1', 'weight': 5000},
                     {'account': 'account2', 'weight': 5000}
                    ]
```
###
And that **doesn't work** and it was driving me crazy.

# This worked:
##
```
beneficiaries = [
                 OrderedDict('account': 'account1', 'weight': 5000),
                 OrderedDict('account': 'account2', 'weight': 5000)
                ]
```
##
( You need ```from collections import OrderedDict``` )

Now you can make a post with the ```beneficiaries``` argument.

I almost put a 100 SBD bounty on solving this issue.

For my report with @deutschbot, I use it like this:
#
```
bene_list = []
bene_weight = 10000 // len(mentioned_authors)
bene_rest = 10000 - (bene_weight * len(mentioned_authors))

for author in mentioned_authors:

    bene_dict = OrderedDict()
    bene_dict['account'] = author
    bene_dict['weight'] = bene_weight

    if author == report_author:
        
        bene_dict['weight'] = bene_weight + bene_rest

    bene_list.append(bene_dict)
```
##
### Now you can 
##
```
steem.post(
      title = 'My funky title', 
      body = beautiful_post, 
      author = 'beststeemitaccountever111', 
      tags = ['such', 'code', 'much', 'win']
      beneficiaries = bene_list) 
```
##
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 18 others
properties (23)
authorfelixxx
permlinkhot-to-set-beneficiaries-with-steem-python
categorysteemdev
json_metadata{"tags":["steemdev","steem-python","python","code"],"links":["https://github.com/steemit/steem-python/issues/9","https://github.com/steemit/steem-python/blob/452b6423aaae3428781628c02eec0eaf6af564e2/steem/commit.py#L214"],"app":"steemit/0.1","format":"markdown","users":["deutschbot"]}
created2017-06-23 19:31:24
last_update2017-06-24 06:58:21
depth0
children10
last_payout2017-06-30 19:31:24
cashout_time1969-12-31 23:59:59
total_payout_value55.052 HBD
curator_payout_value14.505 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,625
author_reputation214,898,450,825,704
root_title"How to set beneficiaries with steem-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id5,813,405
net_rshares5,915,327,106,971
author_curate_reward""
vote details (82)
@cryptofunk ·
$0.04
You say you are not an advanced developer, I disagree! :]
πŸ‘  
properties (23)
authorcryptofunk
permlinkre-felixxx-hot-to-set-beneficiaries-with-steem-python-20170623t221223572z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-06-23 22:12:24
last_update2017-06-23 22:12:24
depth1
children1
last_payout2017-06-30 22:12:24
cashout_time1969-12-31 23:59:59
total_payout_value0.032 HBD
curator_payout_value0.008 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length57
author_reputation22,006,702,786,195
root_title"How to set beneficiaries with steem-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id5,830,715
net_rshares3,689,313,478
author_curate_reward""
vote details (1)
@felixxx ·
Nah, I'm a noob.
properties (22)
authorfelixxx
permlinkre-cryptofunk-re-felixxx-hot-to-set-beneficiaries-with-steem-python-20170623t224003224z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-06-23 22:40:03
last_update2017-06-23 22:40:03
depth2
children0
last_payout2017-06-30 22:40: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_length16
author_reputation214,898,450,825,704
root_title"How to set beneficiaries with steem-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id5,833,325
net_rshares0
@flurgx ·
$0.04
Versteh leider nur Bahnhof, bin halt kein Programmierer, dir scheints aber zu taugen :-D
πŸ‘  
properties (23)
authorflurgx
permlinkre-felixxx-hot-to-set-beneficiaries-with-steem-python-20170623t210520508z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-06-23 21:05:24
last_update2017-06-23 21:05:24
depth1
children0
last_payout2017-06-30 21:05:24
cashout_time1969-12-31 23:59:59
total_payout_value0.030 HBD
curator_payout_value0.010 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length88
author_reputation11,309,016,996,281
root_title"How to set beneficiaries with steem-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id5,823,583
net_rshares3,689,313,478
author_curate_reward""
vote details (1)
@jesta ·
$1.79
Ugh, I've run into headaches like this in the past, and they can be frustrating!

Hopefully steem-python will get first-class support for that at some point. 
πŸ‘  , , ,
properties (23)
authorjesta
permlinkre-felixxx-hot-to-set-beneficiaries-with-steem-python-2017623t183834371z
categorysteemdev
json_metadata{"app":"chainbb/0.2","format":"markdown+html","tags":[]}
created2017-06-23 22:38:33
last_update2017-06-23 22:38:33
depth1
children0
last_payout2017-06-30 22:38:33
cashout_time1969-12-31 23:59:59
total_payout_value1.418 HBD
curator_payout_value0.372 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length158
author_reputation140,605,453,893,072
root_title"How to set beneficiaries with steem-python"
beneficiaries
0.
accountchainbb
weight1,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id5,833,194
net_rshares175,005,315,504
author_curate_reward""
vote details (4)
@jumowa · (edited)
Wo kann ein Programmnixkapierer nachlesen, was hier gemeint ist?
properties (22)
authorjumowa
permlinkre-felixxx-hot-to-set-beneficiaries-with-steem-python-20170629t182934660z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-06-29 18:29:36
last_update2017-06-29 18:29:42
depth1
children1
last_payout2017-07-06 18:29:36
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_length64
author_reputation33,607,268,748,503
root_title"How to set beneficiaries with steem-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id6,659,529
net_rshares0
@felixxx ·
Ich wΓΌsste nicht wo ...
properties (22)
authorfelixxx
permlinkre-jumowa-re-felixxx-hot-to-set-beneficiaries-with-steem-python-20170629t183202614z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-06-29 18:32:00
last_update2017-06-29 18:32:00
depth2
children0
last_payout2017-07-06 18:32:00
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_length23
author_reputation214,898,450,825,704
root_title"How to set beneficiaries with steem-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id6,659,806
net_rshares0
@schererf ·
$0.31
Great work!
I still have not gained experience in programming the steemit API but I think it's really time to start...
πŸ‘  
properties (23)
authorschererf
permlinkre-felixxx-hot-to-set-beneficiaries-with-steem-python-20170626t080440332z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-06-26 08:04:39
last_update2017-06-26 08:04:39
depth1
children0
last_payout2017-07-03 08:04:39
cashout_time1969-12-31 23:59:59
total_payout_value0.304 HBD
curator_payout_value0.003 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length118
author_reputation26,658,463,264,121
root_title"How to set beneficiaries with steem-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id6,149,788
net_rshares31,628,552,606
author_curate_reward""
vote details (1)
@sumiiit ·
great going!!
properties (22)
authorsumiiit
permlinkre-felixxx-hot-to-set-beneficiaries-with-steem-python-20170624t075747002z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-06-24 07:57:27
last_update2017-06-24 07:57:27
depth1
children0
last_payout2017-07-01 07:57:27
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_length13
author_reputation91,303,667,510
root_title"How to set beneficiaries with steem-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id5,880,253
net_rshares0
@troof ·
$0.04
I loved this notes and your profile picture, I also wanted to play like that with the default image, very inspiring!
πŸ‘  
properties (23)
authortroof
permlinkre-felixxx-hot-to-set-beneficiaries-with-steem-python-20170624t061351238z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-06-24 06:13:57
last_update2017-06-24 06:13:57
depth1
children1
last_payout2017-07-01 06:13:57
cashout_time1969-12-31 23:59:59
total_payout_value0.030 HBD
curator_payout_value0.008 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length116
author_reputation88,002,672,556
root_title"How to set beneficiaries with steem-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id5,871,186
net_rshares3,690,553,999
author_curate_reward""
vote details (1)
@felixxx ·
I'm kinda proud of my profile picture :D
properties (22)
authorfelixxx
permlinkre-troof-re-felixxx-hot-to-set-beneficiaries-with-steem-python-20170624t072756399z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2017-06-24 07:27:54
last_update2017-06-24 07:27:54
depth2
children0
last_payout2017-07-01 07:27:54
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_length40
author_reputation214,898,450,825,704
root_title"How to set beneficiaries with steem-python"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id5,877,678
net_rshares0