Update for beem: huge performance improvements and bridge API support

in HiveDevs4 years ago (edited)

Repository

https://github.com/holgern/beem


beem-logo

beem is a python library for STEEM and HIVE. The current version is 0.22.13.

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

The newest beem version can be installed by:

pip install -U beem

Check that you are using hive nodes. The following command

beempy updatenodes --hive

updates the nodelist and uses only hive nodes. The list of nodes can be checked with

beempy config

and

beempy currentnode

shows the currently connected node.

Changelog for versions 0.22.13

  • HiveSigner support added
  • api link to steemconnect has been fixed
  • change recovery account added to beempy
  • hive node has been added
  • add account get_notifications and mark_notifications_as_read
  • beempy notifications has been added
  • bridge api support added
  • config storage improved and add get_default_config_storage, get_default_key_storage and get_default_token_storage
  • list_all_subscriptions and get_account_posts added
  • reduce number of performed api calls on Steem object creation

Performance boost for beem

All integration tests are finishing now in

========== 469 passed, 27 skipped, 11 warnings in 1040.19s (0:17:20) ===========

which is an improvement of 49% (version 0.22.12 needed 1551 seconds).

This huge boost could be accomplished by reducing the number of API calls when creating the Steem object. When importing objects from beem, a configStorage object is no longer created during import. The config storage is now read during object creation with get_default_config_storage. This speeds up importing beem modules and read stored parameter only when needed.

These changes improves also the speed of all beempy commands.

Bridge API

beem supports now parts of the bridge API. More functions to support the missing API calls will follow.

notifications

beempy notifications holger80

prints a table with unread notifications.

+---------------------+------+-------------------------------------------+
|                Date | Type |                                   Message |
+---------------------+------+-------------------------------------------+
| 2020-04-06 10:15:57 | vote |       @uwelang voted on your post ($0.23) |
| 2020-04-06 12:52:00 | vote | @steemcleaners voted on your post ($2.45) |
+---------------------+------+-------------------------------------------+

They can also marked as read with -m

beempy notifications -m holger80

which broadcasts notify custom_json.

list all subscribtions

The account object has now a list_all_subscriptions functions which returns a list with all cummunities which the account has subscript.

get_account_posts

The account object has now the get_account_posts function, which can be used to fetch all posts shown in the feed of the account.

get_ranked_posts

A new class RankedPosts was added to beem.comment which can be used to receive ranked posts.

Change recovery account with beempy

It is now possible to change the recovery account using beempy

beempy changerecovery -a holge80 recovery.account

HiveSigner support was added

The following python example shows how to create a login link:

from beem.hivesigner import HiveSigner
hivesigner = HiveSigner(client_id="rewarding.app", scope="login", get_refresh_token=False)
hivesigner.get_login_url('https://rewarding.app/welcome')

returns

'https://hivesigner.com/oauth2/authorize?client_id=rewarding.app&redirect_uri=https%3A%2F%2Frewarding.app%2Fwelcome&scope=login'

The received token can then be used to check if a user was successfully entering its posting key in a python script:

try:
    hivesigner.set_access_token(access_token)
    name = hivesigner.me()["name"]
except:
    print("Wrong token")

If you like what I do, consider casting a vote for me as witness on Hivesigner or on PeakD.

Sort:  

Good job on the unittesting!!

Thank you and thanks a lot for your work on https://github.com/xeroc/python-graphenelib. This really helps me a lot in creating beem.

This will help to bring BEER to the BEEs

@tipu curate


A huge hug from @amico! 🤗

Awesome thanks!

As always great update, this is the time we can bring back Utopian as a community on Hive

Nice! I had 0.22.11 installed, a 50% performance improvement is great. Just installed the new version and anxious to see it in action.

Nice work!

Informative post. It'll be useful

excellent progress. Thank you !

Awesome updates!

It seems like every time I start working on coding something up myself, you release an update to beem with everything I need.

Great news!

is there any node.js library for steem and hive ?

Amazing! Thanks!

I have picked your post for my daily hive voting initiative, Keep it up and Hive On!!