update for beem: first release for HF 21

holger80(74)
Published in
#beem
Words
164
Reading
1 min
Listen
Play
7y

Repository

https://github.com/holgern/beem


beem-logo

beem is a python library for steem. The current version is 0.21.1.

There is also a discord channel for beem: https://discord.gg/4HM592V

The newest beem version can be installed by:

pip install -U beem

Changelog

0.21.1
------
* Fix non ascii text handling on some nodes
* Add STEEM_REVERSE_AUCTION_WINDOW_SECONDS_HF21 constant
* Fix get_curation_rewards

0.21.0
------
* First release for HF21
* get_downvoting_power added to account
* get_downvote_manabar added to account
* add options use_tags_api to use database api to get comments
* fix get_similar_account_names
* add more try expect to fail back to condenser api
* operations for account_update2, create_proposal, update_proposal_votes and remove_proposal were added
* update_proposal_votes was added to steem
* update_account_jsonmetadata was added to account
* new beempy delete were added

Get content without using the tags api

At the moment most nodes have disabled the tags api. I added a new parameter, so that it is still possible to receive comments.

from beem import Steem
from beem.comment import Comment
stm = Steem(node="https://api.steemit.com")
c = Comment("@holger80/bumpy-start-with-hf-21-scotbot-is-running", steem_instance=stm)
set_full = set(list((c.keys())))
c = Comment("@holger80/bumpy-start-with-hf-21-scotbot-is-running", use_tags_api=False, steem_instance=stm)
set_lite = set(list((c.keys())))
print(set_full - set_lite)
print(set_lite - set_full)

Which shows the missing fields, when not using the tags_api:

{'active_votes',
 'author_reputation',
 'body_length',
 'pending_payout_value',
 'post_id',
 'promoted',
 'replies',
 'root_title',
 'url'}

and the added fields:

{'abs_rshares',
 'active',
 'allow_curation_rewards',
 'allow_replies',
 'allow_votes',
 'author_rewards',
 'children_abs_rshares',
 'max_cashout_time',
 'net_votes',
 'reward_weight',
 'root_author',
 'root_permlink',
 'total_vote_weight',
 'vote_rshares'}

use_tags_api=False can be used when the active votes of the post are not needed.

json-parsing was fixed

from beem import Steem
stm  = Steem("https://anyx.io")
from beem.block import Block
b = Block(35097419, steem_instance=stm)
print(b.operations[-22]["value"]["title"])

returns now the correct utf-8 string:
<스파이더맨 : 파 프롬 홈> 블루엔젤 니어 프롬 (퓨처) 홈 💙

Downvote manabar

from beem.account import Account
acc = Account("holger80")
print(acc.get_downvote_manabar())

returns

{'last_mana': 30121812653872, 'last_update_time': 1567022076, 'current_mana': 30429666853775, 'max_mana': 32442250357182.0, 'current_mana_pct': 93.79641214388982}

New proposal operation

The new proposal operation were added as operation, so far only update_proposal_votes was added as function to steem:

from beem import Steem
stm = Steem()
stm.wallet.unlock("...")
stm.update_proposal_votes([0], True, account="holger80")

Outlook

The following things are on my todo list:

  • add the other proposal operations
  • fix get_replies
  • fix curation rewards calculations
  • add functions to show information about proposals
  • add proposal to beempy
update for beem: first release for HF 21 | Ecency