Imgbb
A simple tool enabling you to asynchronously upload images to imgbb.
Install / Use
/learn @extr3mis/ImgbbREADME
imgbb
<img src='https://img.shields.io/badge/Python-3.5+-blue'> <img src='https://img.shields.io/badge/license-MIT-green'> <img src='https://img.shields.io/badge/async-enabled-blue'> <img src='https://www.code-inspector.com/project/10298/score/svg'>
A simple tool enabling you to asynchronously upload images to <a href='https://www.imgbb.com'>imgbb</a>. Requires Python 3.5+
Installation
Install this package using pip.
$ pip install git+https://github.com/extr3mis/imgbb.git
Usage
Import the package using the given import statement.
$ from imgbb.client import Client
Now you can make a Client object and initialize it with your own API key from imgbb. Optionally, also pass the aiohttp.ClientSession() object you want the imgbb client to use.
$ myclient = Client(api_key_here)
Now you can use your Client to upload an image using the Client.post() method. Since Client.post() is a coroutine make sure to await it. Catch the response from the request in request.
$ response = await myclient.post('/path_to_image/image.jpg','name')
Now you can get the URL to the image you've just uploaded using response['data']['url'].
$ URL = response['data']['url']
Quick Example
from imgbb.client import Client
import os
import aiohttp
import asyncio
key = os.getenv('IMGBB_API_KEY')
session = aiohttp.ClientSession()
myclient = Client(key,session)
async def upload(image,name):
response = await myclient.post(image,name)
url = response['data']['url']
print(f'Uploaded image URL: {url}')
if __name__=='__main__':
asyncio.run(upload('image.jpg','Cool picture'))
Related Skills
gh-issues
344.1kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
344.1kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
tmux
344.1kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
