A Twisted-based asynchronous JSON-RPC STEEM library for Python

in #utopian-io6 years ago (edited)

image.png

ASYNCSTEEM

The asyncsteem library is a Twisted-based asynchronous python library for interacting with STEEM JSON-RPC API nodes. The library aims for minimal dependancies and minimal boilerplate code requirements for writing simple bots or statistics gathering cron jobs.

Currently, the library supports only unsigned operations (no votes, comments, etc), but these are planned for the 0.7 version of the library.

The library is being designed with asynchronous networking in mind, You can either use the low level RpcClient API, that implements a command queue based interface that uses both parallel HTTPS POST operations, and (if "stage" is selected as nodeset), JSON-RPC batch operations, or you can use the higher level ActiveBlockchain API that allows you to write a simple bot class that implements methods for those operations that your bot requires to do its work. The use of the ActiveBlockchain API is meant to minimize required boilerplate code for writing simple bots.

Technology stack

The technology stack for *asyncsteem currently consists of Python 2.7 and the asynchonous Python framework Twisted. The library will talk to the STEEM network through JSON-RPC API nodes.

Roadmap

The roadmap for the project is currently planned as followes:

  • Today the 0.5 version was released. This version includes properly documented code and an install script.
  • The next step will be extensive testing and bug fixing (if needed). The @pibarabot Watching The Watchers bot shall be ported from steem-python to asyncsteem, and shall, in the 0.6 version of asyncsteem be published as an example bot. It is hoped that running this bot for a few weeks will tease out any remaining bugs in the current code base.
  • The one big feature planned for version 0.7 will be signing of operations. This should allow for a wider range of bots to be created with asyncsteem, as this will allow voting, flagging and posting content.
  • The rest of the roadmap hasn't completely solidified yet, there are some more advanced operations needed such as posting with beneficaries and downvoting with a guarantee to never cut into the reputation of the downvoted party, and there is the desire to also support python 3 in a post 1.0 version.

How to contribute?

Pull requests with bug fixes or listed issues are very much welcomed, but the most important contributions I'm currently looking for are people who give the current, early, version a bit of a spin and report any issues they run into. Feature requests are also welcomed. Please use the github issue tracker to submit your issues to the project. Oh, and if you take the library for a spin and you don't run into problems, consider writing a short howto to help other potential users. If you have any questions regarding the use of asyncsteem, this discord server is meant for anything you don't want to communicate through github issues.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

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

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • This is your first accepted contribution here in Utopian. Welcome!

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

Approved.

Great work so far. Looking forward to see its progress. We really need a better maintained library than steem-python.

You can contact us on Discord.
[utopian-moderator]

Per popular demand, I have ported the code to work with Python 3. See my fork on GitHub.

My attempts to get Python 2 & 3 support in the same code via the future package were not successful, so this version is Python 3 only.

Great work. I was considering using six for getting Python 2 & 3 support in the same code. Not sure how/if it differs from 'future'.

Thanks. I'm not sure about the precise differences between six and future, but it seems like future is the preferred method, at least according to the official Python docs. That page mentions that six is able to provide Python 2.5 support, while future does not.

I removed the future stuff because it wasn't working on Python 2 and I wanted to eliminate the dependency on future. When I get back to it, I'll make a branch for further testing with getting 2 & 3 working on the same code.

Hey, congrats on the new release! I've spent a little time playing with asyncsteem, and I'm impressed so far.

I wrote a guide on getting started with the library that you can find here.

Haven't found any bugs yet, but I do see a few opportunities to update the README, if you'd like help with that.

My biggest question about asyncsteem at this point is how I might query an api method like get_replies periodically. I'm guessing that's what the methods like day and hour could be used for, but I'd like to check more like every minute or five. Better yet, is there a way to just stream replies to one user, without filtering through every comment happening on the chain?

@mattockfs, Approve is not my ability, but I can upvote you.

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 63974.07
ETH 3426.40
USDT 1.00
SBD 2.54