imagehoster-python-client: A python client for SteemitImages

in #utopian-io7 years ago (edited)

Repository

Imagehoster is the project powers the images you upload at Steemit. It's an interesting project because only STEEM accounts can upload files here by signing the image content with their posting key. You can get more details on the ImageHoster README.


imagehoster-python-client is the python client of the steemitimages. You can upload images to steemitimages in your python applications.

Installation
$ (sudo) pip install imagehoster
Usage
image_uploader = ImageUploader(
    steem_username,
   private_posting_key,
)
resp = image_uploader.upload("/path/to/image.png)
if 'url' in resp:
    print("File uploaded: %s" % resp["url"])
else:
    print(resp)
Using the CLI APP


imagehosterception

Once you have installed the package via pip, you have also a CLI app installed.

Make sure you have set environment variables first:

export IMAGEHOSTER_USERNAME=emrebeyler
export IMAGEHOSTER_POSTING_WIF=PRIVATE_POSTING_WIF

Then...

$ imagehoster qq.jpeg
File uploaded: https://steemitimages.com/DQmZNzWiHHSJGdPjTXDAmeZEW5G84z47uSKbR9shABJRRaL/image
Notes
  • If you set up your own imagehoster server instance, all you need to do is change the image_uploader_instance.API_BASE_URL to your URL.

  • Have a look at here to see the java version of the same functionality.

  • Have a look at here to see the implementation on Condenser

Technology Stack

Code runs on Python 3.6+. It may run on previous versions of py3k, but didn't tried it myself.

Roadmap

It works fine at the moment. Since the server doesn't have many options, there is nothing to add more.

How to Contribute

Contribution process is same as any other open-source project. You can check out open issues at Github and can start working. Just make sure, you will comment on the related issue before starting working on it.

GitHub Account

https://github.com/emre

Sort:  

Thank you for your contribution. It would be nice if the commit messages would be little more descriptive. Also when the image is not uploaded you will get some error "# there must be something wrong.", in this comment if you would have mentioned what all the error a user can get then it will be better for developers to debug their code.

Your contribution has been evaluated according to Utopian rules and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post,Click here


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Hey @codingdefined
Here's a tip for your valuable feedback! @Utopian-io loves and incentivises informative comments.

Contributing on Utopian
Learn how to contribute on our website.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

nice work! Agree it's interesting to use the sign with STEEM key to restrict to STEEM users only.

Hey man, on your code sample:

resp = image_uploader.upload("/path/to/image.png)

there's a missing quote :)

congratulations on the contribution!

Awesome :) thanks for sharing

Hey @emrebeyler
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Contributing on Utopian
Learn how to contribute on our website or by watching this tutorial on Youtube.

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Hello, it'sme @gennyblaze. Please @emrebeyler i'm very sorry about what happened, i never knew that what i did was against the rule here. Please, forgive and forget, unflag and upvote my 3posts that you downvoted. I promise it will not repeat again. These are the 3links to tge posts, thank you and God bless you @emrebeyler: https://steemd.com/blog/@gennyblaze/oeyle-bir-basklik-kullanayim-ki-kimse-yazdigim-icerigi-okumadan-gecmesin-turkish-english
https://steemd.com/music/@gennyblaze/this-is-america-a-significant-piece-of-art-so-poignant-it-s-scary
https://steemd.com/funny/@gennyblaze/finally-men-are-not-left-out
Thank you@emrebeyler

This post has received votes totaling more than $50.00 from the following pay for vote services:

minnowbooster upvote in the amount of $126.24 STU, $179.73 USD.
buildawhale upvote in the amount of $22.10 STU, $31.47 USD.

For a total calculated value of $148 STU, $211 USD before curation, with a calculated curation of $37 USD.

This information is being presented in the interest of transparency on our platform and is by no means a judgement as to the quality of this post.

Wow.. I've learned from that.. Thanks @emrebeyler

Coin Marketplace

STEEM 0.26
TRX 0.20
JST 0.038
BTC 95773.21
ETH 3553.89
USDT 1.00
SBD 3.85