Python client of Utopian API
utopian-io·@emrebeyler·
0.000 HBDPython client of Utopian API
I use Utopian API a lot to [automate things](https://steemit.com/utopian-io/@emrebeyler/an-attempt-to-reduce-moderator-work-at-utopian-automating-accepted-posts-channel) and [gather info about the Utopian contributions](https://steemit.com/utopian-io/@emrebeyler/introducing-utopy-utopian-curation-bot) and stats. After seeing [release of the node library](https://utopian.io/utopian-io/@wehmoen/first-public-release-of-the-utopian-io-api-npm-package) 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](https://github.com/utopian-io/utopian-api-python-client) at github. #### Installation ``` $ (sudo) pip install utopian_api ``` #### Usage **Client instance** ```python from utopian_api import Client c = Client() ``` **Methods** - Getting Moderators ```python print(c.moderators) ``` - Check an account is a moderator? ```python print(c.is_moderator("emrebeyler")) ``` - Getting Sponsors ```python print(c.sponsors) ``` - Check an account is a sponsor? ```python print(c.is_sponsor("emrebeyler")) ``` - Get approved posts ```python print(c.posts()) ``` - Get flagged posts ```python print(c.posts({"status": "flagged"}) ``` - Get contributions waiting for review on Blog category (old first) ```python print(c.posts({"filterBy": "review", "type": "blog"})) ``` - Get count of approved contributions ```python print(c.count()) ``` - Get count of hidden contributions ```python print(c.count({"status": "flagged"})) ``` - Get count of hidden contributions on blog posts category ```python print(c.count({"status": "flagged", "type": "blog"})) ``` - Get post detail ```python print(c.post("emrebeyler", "introducing-utopian-tip-a-voting-bot-votes-moderation-comments")) ``` - Get stats ```python print(c.stats) ``` - Check Utopian.io bot is actively voting or not ```python print(c.bot_is_voting) ``` #### Running Flow Tests ```bash $ python flow_tests.py ....... ---------------------------------------------------------------------- Ran 7 tests in 18.916s ``` Let me know if you encounter any issues. <br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@emrebeyler/python-client-of-utopian-api">Utopian.io - Rewarding Open Source Contributors</a></em><hr/>
👍 emrebeyler, muhammetcan, onursa, turbot, yucealiosman, crokkon, levent.eren, msp3k, nettybot, crimsonclad, coonass, discordiant, conflaxus, tittilatey, cajun, matrixonsteem, steemliberator, witnessstats, r2steem2, steemcreate, thashadowbrokers, brotato, pizaz, triplethreat, dootdoot, squirrelnuts, steemdevs, jeezy, test.with.dots, pi-pi, listentosteem, gravy, ausbitbank, thinknzombie, suheri, fonsetucker, rizwan23, dogancankilment, cryptonik, embity, sambillingham, amosbastian, wehmoen, qurator, gregory-f, fronttowardenemy, theleapingkoala, favcau, ethandsmith, utopian.pay, elear, kvg, duekie, planet-power, deevi, techslut, steempty, fminerten, jrmiller87, drmake, mkt, ecoman1, masterwriter, cyyy1998, abh12345, mys, mciszczon, elguille, g0nr0gue, kslo, henaff, codemojo, minersean, sanjeevm, walnut1, cometobesiktas, rockonbhai, feedyourminnows, kit.andres, drishitmitra, wakjems, bantha, joe28, dez1337, gavdaly, dakeshi, utopian-io, niemand, murattatar, sethroot, dancing-spirit, famil, jestemkioskiem, alpayasteem, habercitr, evilest-fiend, ubg, boontjie, othello, zafar82, akifane, sudefteri, fixmod, teamsteem, turymenecier, zulfikarhusein, muhammar, cryptobyte, faiyazislam, sundown, bobsthinking, canburaksimsek, t-bam, abigailmtz, paulmadean, hakansorucu, edpsahn, shinrip,