Demo project
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
import imgtobase64
web_url = "https://sb.kaleidousercontent.com/67418/800x533/a5ddfb21a6/persons3-nobg.png"
image_base4 = imgtobase64(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
imgtobase64-1.0.0.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for imgtobase64-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72a645a07d4a8f59ca3b0f56d5cab5480194b8a1f25346b85ef26bc3452a5b25 |
|
MD5 | af5854e9bbcaa14d99cfd94ffad986a8 |
|
BLAKE2b-256 | 48da2800624319fefe8df77d653146e9fe941e3b5d312804a70bfec08bbfe6df |