Update for beem - all broadcast operation are now supported and beempy curation improved

in #utopian-io7 years ago (edited)

Repository

https://github.com/holgern/beem

beem-logo.png

beem is a python library for steem. beem has now 477 unit tests and a coverage of 81 %. The current version is 0.19.32.

I created a discord channel for answering a question or discussing beem: https://discord.gg/4HM592V

New Features

Missing broadcast operation were added

  • Account_witness_proxy added
  • Custom added
  • Custom_binary added
  • Prove_authority added
  • Limit_order_create2 added
  • Request_account_recovery added
  • Recover_account added
  • Escrow_transfer added
  • Escrow_dispute added
  • Escrow_release added
  • Escrow_approve added
  • Decline_voting_rights added

active key permission can be used for posting operation

When no posting key is found, an active key is used instead for signing posting operation (e.g. voting).
When no key could be found, MissingKeyError is now always raised when a transaction should be signed.

refactoring of beem

  • beemgrapheneapi is depreated and all python files are moved to beemapi
  • GrapheneRPC uses now a Nodes class instead of cycle([urls])
  • get_nodes_list is removed from beem.utils and available in beem.nodelist.

get_replies added to Comment class

from beem.comment import Comment
c =Comment("@utopian-io/people-of-utopian-2-nepeta")
replies = c.get_replies()

Keys for accounts with more than one key can be obtained

  • getKeysForAccount added
  • getOwnerKeysForAccount, getActiveKeysForAccount, getPostingKeysForAccount added

beempy curation improved


image.png

Besides the curation of a single post, the complete curation history of the last d (default is 7) days can be displayed. The curation command shows all votes from now on and goes backward. The first 7 days are pending rewards and then paid curation rewards are shown, when -d is set to a number higher than 7.
E.g.

beempy curation -a holger80 -v 0.5 -x 100 -s

shows the curation of the last 7 days for votes higher than 0.5 SBD and with a performance better than 100 %. -s supresses the summery:
image.png
There are two votes with a performance better than 100%.
Without -s:
image.png
The highest vote and the vote with the highest curation performance are addionally shown for each post. The sum shows the resulting sum of all votes. The performance is in this case the curation percentage (maximum value is 25 %).

It possible to analyze a post by taking the id which is shown by the author name (ihtiht/logo-design-contribution-for-gplanner can also be used instead of 24) :
image.png

  • -e curation.html exports the result as html file
  • -p shows the permlink
  • -t shows the title

Commit history

Add missing operations with unit tests

beembase\objects

  • Amount improve handling of new appbase Amount format

beembase\operations

  • missing broadcast operation were added

Unit tests

  • add test_order_create2, test_witness_proxy, test_custom, test_request_account_recovery, test_recover_account, test_escrow_transfer, test_escrow_dispute, test_escrow_release, test_escrow_approve, test_decline_voting_rights, test_delegate_vesting_shares, test_account_create_with_delegation added

Comment: get_replies added, get_curation_penalty improved and get_rewards fixed

beemgrapheneapi is deprecated, all classes and functions are available under beemapi

Fix remaining references to beemgrapheneapi and fix not working wss:/testnet.steem.vc

common steem constants added and used in account, comment and steem

Add unit test for constants

Add export option for curation and votes

CLI
  • speed up votes and added export to text file
  • curation can be used to export all pending curation rewards of one account

New nodes class for better node url handling

Wallet
  • getKeysForAccount added
  • getOwnerKeysForAccount, getActiveKeysForAccount, getPostingKeysForAccount added
beemapi
  • WorkingNodeMissing is raised when no working node could be found
GrapheneRPC
  • cycle([urls]) is replaced by the nodes class
Nodes
  • Node handling and management of url and error_counts is performed by the nodes class
  • sleep_and_check_retries is moved to the nodes class
  • Websocket, steemnodrpc were adpapted to the changes
Unit tests
  • new tests for the nodes class
  • tests adapted for websocket and rpcutils

NodeList class added for better nodelist handling

NodeList
  • replaces get_node_list from utils.py
  • is a list and contains all nodes as dict
  • get_nodes() returns the url in a list
Utils
  • get_node_list removed
Unit Tests and Examples adapted to the changes

Several improvements

Account
  • datetime.date is also supported
CLI
  • curation improved
Comment
  • doc improved
Transactionbuilder
  • doc fixed
  • owner key is used, when provided and when no other permission is given
utils
  • datetime.date supported
Wallet
  • raise MissingKeyError when a wrong key is given by Steem(keys=[])
Unit tests
  • several unit tests has to be changed as now it is really tested if a given wif belongs to the account or not.

If keys are empty try with next higher permission

Fix flake8 and add unit tests for permission downgrade

Fix and improve curation even more

GitHub Account

https://github.com/holgern

Sort:  

Good to see projects having code coverage greater than %80. :) I will leave my comfort zone and will give Beem a try for my next Steem related project.

Keep up the good work! :)

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

This post has been just added as new item to timeline of beem on Steem Projects.

If you want to be notified about new updates from this project, register on Steem Projects and add beem to your favorite projects.

Hey @holger80
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!