Convert your image url from web or your image field from database to base64
Project description
=== CONVERT IMAGE TO BASE64
IMGTOBASE64 convert your image url from web or your image field from database to base64
Detailed documentation is in the "docs" directory.
Quick start
-
Install the module:
pip install imgtobase64
-
CASE OF IMAGE FROM WEB URL
from imgtobase64.job import png_to_base64
web_url = "https://sb.kaleidousercontent.com/67418/800x533/a5ddfb21a6/persons3-nobg.png"
image_base4 = png_to_base64(web_url)
-
CASE OF IMAGE FROM FIELD OF A TABLE ON YOUR DB
`We have a table named Banner with attribute name image and description so : So if we want tranform image to base64 to print blog on pdf,we will do this:
import imgtobase64
image_base4 = imgtobase64(banner.image)`
Project details
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
Hashes for imgtobase64-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af58b30ac066a085f830b897c0fef2eef919f0f0c1063e123f58238a9a47f5c7 |
|
MD5 | b686cbc92f661c67837eb01c4634fe2f |
|
BLAKE2b-256 | f7ce66eba1a05531ba574b2a1b1ae4c398b4a75b29d1f3ef39a15aed7edb2622 |