You are viewing a single comment's thread from:

RE: Python requests for Hive JSON-RPC

in HiveDevs2 months ago

I think its hard to grasp why Beem gets referenced so much more than lighthive in posts like this, I'm absolutely not a Beem fan, but lighthive is pretty good.

I wrote a Python lib for this way back in steemit days, but it was Python 2.x using the Twisted async framework.

I'm currently working on a less generic Python lib called aiohivebot, not really suitable for comand line tools and other basic tools, but quite powerfull if it the project fits the abstractions and requires a proper async solution, not yet production ready, but maybe you'd like to give it a look.

With respect to getting multiple requests, keeping the session open is great, but JSON-RPC defines batches too what is even better. The problem with JSON-RPC batches though is that something about the tech stack of the public API nodes seems to be non-univorm across nodes. I know at least one node supports them, but most don't, what is a shame. But if you are going to rely on just one node (many nodes seem to have regular availability hickups), you could pick a node that support JSON-RPC batches.

Sort:  

I have looked at aiohivebot before.

I also know about batch calls.

If you want -for example- more data than the bath-size allows (pagination), you could use above approach to keep the connection open for the next call- it could be faster than light hive, or any other library.

As for aysnc and other stuff, I have a better approach and just posted about it.
For some approaches, it doesn't really matter, if you use Beem or lighthive or requests or build your own lib...