bhive.imageuploader module

class bhive.imageuploader.ImageUploader(base_url='https://images.hive.blog', challenge='ImageSigningChallenge', hive_instance=None)

Bases: object

upload(image, account, image_name=None)

Uploads an image

Parameters
  • image (str, bytes) – path to the image or image in bytes representation which should be uploaded

  • account (str) – Account which is used to upload. A posting key must be provided.

  • image_name (str) – optional

from bhive import Hive
from bhive.imageuploader import ImageUploader
hv = Hive(keys=["5xxx"]) # private posting key
iu = ImageUploader(hive_instance=hv)
iu.upload("path/to/image.png", "account_name") # "private posting key belongs to account_name