A Python library for uploading images to ImgBB via their API.
Project description
IbbUploader 0.0.1
IbbUploader is a Python library for uploading images to ImgBB via their API. This library simplifies the process of uploading images from local file paths, file-like objects, or directly via URLs.
Features
- Upload images from local file paths.
- Upload images from in-memory file-like objects.
- Upload images directly via image URLs.
- Configure image storage duration through an optional expiration setting.
- Specify a custom name for the uploaded image.
Installation
To install IbbUploader, simply run the following command:
pip install ibbuploader
Usage
Uploading an Image from a File Path
from ibbuploader import IbbUploader uploader = IbbUploader(api_key='YOUR_API_KEY') response = uploader.upload('path/to/your/image.jpg') print(response)
Uploading an Image via URL
response = uploader.upload('http://example.com/image.jpg') print(response)
Uploading an Image from a File-like Object
from io import BytesIO image_file = BytesIO(image_data) response = uploader.upload(image_file) print(response)
Additional params
response = uploader.upload(image_file, name=image_name, expiration_days=10)
Configuration
To use IbbUploader, you will need to provide:
API Key: Your personal API key from ImgBB. Expiration: Optionally, set an expiration time in days for the uploaded image, up to a maximum of 180 days. Name: Optionally, The name of the image to be uploaded.
Running Tests
Execute the following command to run tests:
pytest
Acknowledgments
-Thanks to ImgBB for providing the API used in this library.
-This library is free software: you can redistribute it and/or modify
-This library is distributed in the hope that it will be useful, by dlrodev92.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file IbbUploader-0.0.1.tar.gz.
File metadata
- Download URL: IbbUploader-0.0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2d7edd02c424bdcbffe97f06c5f7a73b19ad2ddcff8a7586194f24ae2a1b631
|
|
| MD5 |
26cc16d646d555541de0da3a85058197
|
|
| BLAKE2b-256 |
1c8b84763aa3e4f73b2190880731e6ab16b5425d16864a90204710dd89de33fb
|
File details
Details for the file IbbUploader-0.0.1-py3-none-any.whl.
File metadata
- Download URL: IbbUploader-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7957557efee2ff09b03ba6aeac7b14c3dee135a465b3a525739f7b2cd80077ef
|
|
| MD5 |
8310c1588157e3fd34c13df9fadf42a1
|
|
| BLAKE2b-256 |
0a72b18abba22ab0c6d074a6d15c7b4d0de2bdfe0ceef1355444a9f6026ac5d9
|