Python client of Utopian API

in #utopian-io7 years ago (edited)

I use Utopian API a lot to automate things and gather info about the Utopian contributions and stats. After seeing release of the node library for it, I have decided to do the same with Python.

It supports a good encapsulation over the HTTP api, includes a bunch of flow tests, and released under the Utopian organization at github.

Installation

$ (sudo) pip install utopian_api

Usage

Client instance

from utopian_api import Client
c = Client()

Methods

  • Getting Moderators
print(c.moderators)
  • Check an account is a moderator?
print(c.is_moderator("emrebeyler"))
  • Getting Sponsors
print(c.sponsors)
  • Check an account is a sponsor?
print(c.is_sponsor("emrebeyler"))
  • Get approved posts
print(c.posts())
  • Get flagged posts
print(c.posts({"status": "flagged"})
  • Get contributions waiting for review on Blog category (old first)
print(c.posts({"filterBy": "review", "type": "blog"}))
  • Get count of approved contributions
print(c.count())
  • Get count of hidden contributions
print(c.count({"status": "flagged"}))
  • Get count of hidden contributions on blog posts category
print(c.count({"status": "flagged", "type": "blog"}))
  • Get post detail
print(c.post("emrebeyler", "introducing-utopian-tip-a-voting-bot-votes-moderation-comments"))
  • Get stats
print(c.stats)
  • Check Utopian.io bot is actively voting or not
print(c.bot_is_voting)

Running Flow Tests

$ python flow_tests.py
.......
----------------------------------------------------------------------
Ran 7 tests in 18.916s

Let me know if you encounter any issues.



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Ah @sanjeevm - I see you under every post - Always a pleasure :D :)

THIS IS AWESOME! Thanks for wrapping the http API calls in python, this is a great help to get Utopian statistics and I will use this for sure!

Thanks! Let me know if you see anything abnormal.

Hey man, you mentioned trbot makes 1-100% vote, however for users the slider is available only after 500SP. Is that a GUI and thing and you can just bypass it programatically? Or am I missing something here..

It's a GUI thing. Every account can set voting weight per vote. However, if the output of vote value is too small in shares, then the blockchain doesn't accept it. (Vote dust)

Ah! Awesome do you know precise value? I assume it to be $0.1 or $0.2 ; Also do you know whether the GUI slider on busy is then working for all users (<500SP)

PS: I've sent msg request on discord pls do get back to me

The one on utopian works for all users.

nice addition dude!

thanks mate.

Great stuff man, definitely going to use this!

Cool stuff ! I'll try it out later today.

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

Achievements

  • WOW WOW WOW People loved what you did here. GREAT JOB!
  • Seems like you contribute quite often. AMAZING!

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

Hi I am following to you and your articles are very interesting good going. I am new to steemit plz help me

2 years old !BEER

Coin Marketplace

STEEM 0.27
TRX 0.21
JST 0.038
BTC 96276.55
ETH 3627.68
SBD 3.80