Suggestion: Adding follow, unfollow, has_followed in Steem Python Library

in #utopian-io9 years ago (edited)

I have searched the library of steemit/steem-python, the official Steem Python library, in order to find methods that allow me to follow, unfollow or check if followed given a steem ID. Currently, there is no relative methods in steemit/steem-python librarys.

The closest methods are only read-only the lists. For example, in Account.py:

https://github.com/steemit/steem-python/blob/master/steem/account.py

The get_following is defined as:

def get_following(self):
  return [x['following'] for x in self._get_followers(direction="following")]

So, what I am proposing is to add follow, unfollow and has_followed methods that are self-explanatory. Example usage (in Python code) will be something like this:

account = Account("justyy")
if not account.has_followed("utopian-io"):
   account.follow("utopian-io")
if account.has_followed("ned"):
   account.unfollow("ned")



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

nice job dude. keep it up..ur posts are valuable for all.thnx :)

Hello @justyy, your contribution can not be approved yet as it contains direct mentioning of other accounts. I recommend that you use markdown to hide the mentions (e.g @ned, @justyy etc ). Please kindly edit your contribution to reapply for approval. thank you :)
[utopian-moderator]

Thanks, removed mentioning, please could you check.

Hey @justyy I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.089
BTC 61897.09
ETH 1733.97
USDT 1.00
SBD 0.38